[NFC] Fix the bug - missing AIDData 61/76061/1
authorsangrae.kim <sangrae.kim@samsung.com>
Wed, 22 Jun 2016 12:51:54 +0000 (21:51 +0900)
committersangrae.kim <sangrae.kim@samsung.com>
Wed, 22 Jun 2016 12:52:49 +0000 (21:52 +0900)
    before:
    TCT passrate 98.86% (176/174/2/0/0)
    after:
    TCT passrate 100.00% (176/176/0/0/0)

Change-Id: I104aa5f8a57c9c5e70f7e77f850ac966b2ca18d3
Signed-off-by: sangrae.kim <sangrae.kim@samsung.com>
src/nfc/aid_data.cc
src/nfc/aid_data.h
src/nfc/nfc_adapter.cc

index c6af525e5d71ba2e1fc81abb44a7c22778647627..04babe2c59e0b3b5f4bffce23b286f4b9bc3e1d6 100644 (file)
 
 #include "nfc/aid_data.h"
 #include "common/logger.h"
+#include "nfc/nfc_util.h"
 
 namespace extension {
 namespace nfc {
 
-AIDData::AIDData(nfc_se_type_e se_type, const char* aid, bool read_only)
+AIDData::AIDData(std::string se_type, std::string aid, bool read_only)
     : se_type_(se_type),
       aid_(aid),
       read_only_(read_only)
@@ -33,9 +34,9 @@ picojson::value AIDData::toJSON() const {
   picojson::value retval = picojson::value(picojson::object());
   picojson::object& obj = retval.get<picojson::object>();
 
-  obj["aid"] = picojson::value();
-  obj["type"] = picojson::value();
-  obj["readOnly"] = picojson::value();
+  obj["aid"] = picojson::value(aid_);
+  obj["type"] = picojson::value(se_type_);
+  obj["readOnly"] = picojson::value(read_only_);
   return retval;
 }
 
index 14774c32eaf10953863a6c421ff0a4c19026d728..51ed37d51f96f00379a9d47258dcba4131392384 100644 (file)
@@ -28,12 +28,12 @@ namespace nfc {
 
 class AIDData {
  public:
-  AIDData(nfc_se_type_e se_type, const char* aid, bool read_only);
+  AIDData(std::string se_type, std::string aid, bool read_only);
   picojson::value toJSON() const;
 
  private:
-  nfc_se_type_e se_type_;
-  const char* aid_;
+  std::string se_type_;
+  std::string aid_;
   bool read_only_;
 };
 
index 3ffec237177c3e69d3a394fe3eaf49018861781b..911f34dee9e6f4ce87567b6b4a11b609a0fe61d4 100644 (file)
@@ -1554,7 +1554,8 @@ static void SaveRow(nfc_se_type_e se_type,
   AssertMsg(aid, "Poiner can not be null!");
   AssertMsg(user_data, "Poiner can not be null!");
   AIDDataVector* aids = static_cast<AIDDataVector*>(user_data);
-  aids->push_back(AIDData(se_type, aid, read_only));
+  std::string aid_str = std::string(aid);
+  aids->push_back(AIDData(std::string(NFCUtil::ToStr(se_type)), aid_str, read_only));
 };
 
 void NFCAdapter::GetAIDsForCategory(