From e3b9869fde72cd993b6cbf7dbc99fd85cc95b7a1 Mon Sep 17 00:00:00 2001 From: "dukan.kim" Date: Tue, 16 Apr 2013 21:13:44 +0900 Subject: [PATCH] Modified to remove objects before adding, avoid to conflict. Change-Id: If50acf93c70ade7811aed4c8879ea713b13de31d Signed-off-by: dukan.kim --- src/bluetooth-app-control/BluetoothAppControlDllEntry.cpp | 15 +++++++++++++++ src/setting-app-control/SettingAppControlDllEntry.cpp | 3 +++ 2 files changed, 18 insertions(+) mode change 100644 => 100755 src/setting-app-control/SettingAppControlDllEntry.cpp diff --git a/src/bluetooth-app-control/BluetoothAppControlDllEntry.cpp b/src/bluetooth-app-control/BluetoothAppControlDllEntry.cpp index c7219b9..3a7bea0 100755 --- a/src/bluetooth-app-control/BluetoothAppControlDllEntry.cpp +++ b/src/bluetooth-app-control/BluetoothAppControlDllEntry.cpp @@ -143,20 +143,25 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat pBuf = appsvc_get_data(pBundle, "http://tizen.org/appcontrol/data/bluetooth/address"); if (pBuf) { + pResult->Remove(String(L"http://tizen.org/appcontrol/data/bluetooth/address")); pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/address"), new (std::nothrow) String(pBuf)); + pResult->Remove(String(L"addr_val")); pResult->Add(new (std::nothrow) String(L"addr_val"), new (std::nothrow) String(pBuf)); } pBuf = appsvc_get_data(pBundle, "http://tizen.org/appcontrol/data/bluetooth/name"); if (pBuf) { + pResult->Remove(String(L"http://tizen.org/appcontrol/data/bluetooth/name")); pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/name"), new (std::nothrow) String(pBuf)); + pResult->Remove(String(L"dev_name")); pResult->Add(new (std::nothrow) String(L"dev_name"), new (std::nothrow) String(pBuf)); } pBuf = appsvc_get_data(pBundle, "http://tizen.org/appcontrol/data/bluetooth/rssi"); if (pBuf) { + pResult->Remove(String(L"http://tizen.org/appcontrol/data/bluetooth/rssi")); pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/rssi"), new (std::nothrow) String(pBuf)); } @@ -171,6 +176,7 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat { pBuf = "false"; } + pResult->Remove(String(L"http://tizen.org/appcontrol/data/bluetooth/is_paired")); pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/is_paired"), new (std::nothrow) String(pBuf)); } @@ -180,7 +186,9 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat Integer::Decode(String(pBuf), majClassType); majClassType = (int)_BluetoothAdapterUtility::ConvertToMajorDeviceClassType((bt_major_device_class_e)majClassType); + pResult->Remove(String(L"http://tizen.org/appcontrol/data/bluetooth/major_class")); pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/major_class"), new (std::nothrow) String(Integer::ToString(majClassType))); + pResult->Remove(String(L"maj_cls_type")); pResult->Add(new (std::nothrow) String(L"maj_cls_type"), new (std::nothrow) String(Integer::ToString(majClassType))); } @@ -190,7 +198,9 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat Integer::Decode(String(pBuf), minClassType); minClassType = (int)_BluetoothAdapterUtility::ConvertToMinorDeviceClassType((bt_major_device_class_e)majClassType, (bt_minor_device_class_e)minClassType); + pResult->Remove(String(L"http://tizen.org/appcontrol/data/bluetooth/minor_class")); pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/minor_class"), new (std::nothrow) String(Integer::ToString(minClassType))); + pResult->Remove(String(L"min_cls_type")); pResult->Add(new (std::nothrow) String(L"min_cls_type"), new (std::nothrow) String(Integer::ToString(minClassType))); } @@ -200,7 +210,9 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat Integer::Decode(String(pBuf), svcClassType); svcClassType = (int)_BluetoothAdapterUtility::ConvertToServiceClassList(svcClassType); + pResult->Remove(String(L"http://tizen.org/appcontrol/data/bluetooth/service_class")); pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/service_class"), new (std::nothrow) String(Integer::ToString(svcClassType))); + pResult->Remove(String(L"svc_cls_type")); pResult->Add(new (std::nothrow) String(L"svc_cls_type"), new (std::nothrow) String(Integer::ToString(svcClassType))); } @@ -213,9 +225,12 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat svcType = _BluetoothAdapterUtility::ConvertToServiceList(ppArrayBuf, len); pUuidList = dynamic_cast(_BluetoothAdapterUtility::ConvertServiceUuidListN(ppArrayBuf, len)); + pResult->Remove(String(L"http://tizen.org/appcontrol/data/bluetooth/service_type")); pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/service_type"), new (std::nothrow) String(Long::ToString(svcType))); + pResult->Remove(String(L"svc_type")); pResult->Add(new (std::nothrow) String(L"svc_type"), new (std::nothrow) String(Long::ToString(svcType))); + pResult->Remove(String(L"http://tizen.org/appcontrol/data/bluetooth/uuid_list")); pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/uuid_list"), pUuidList); } } diff --git a/src/setting-app-control/SettingAppControlDllEntry.cpp b/src/setting-app-control/SettingAppControlDllEntry.cpp old mode 100644 new mode 100755 index eb8145e..b5c7aef --- a/src/setting-app-control/SettingAppControlDllEntry.cpp +++ b/src/setting-app-control/SettingAppControlDllEntry.cpp @@ -276,7 +276,10 @@ OnBluetoothAppControlResult(void* b, int requestCode, service_result_e res, void pBuf = "off"; break; } + pResult->Remove(String(L"http://tizen.org/appcontrol/data/bluetooth/visibility")); pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/visibility"), new (std::nothrow) String(pBuf)); + + pResult->Remove(String(L"visibility")); pResult->Add(new (std::nothrow) String(L"visibility"), new (std::nothrow) String(pBuf)); } -- 2.7.4