Update change log and spec for wrt-plugins-tizen_0.4.70
[framework/web/wrt-plugins-tizen.git] / src / Bluetooth / BluetoothHealthProfileHandler.cpp
index 834e8fa..8299baa 100644 (file)
@@ -71,10 +71,13 @@ void BluetoothHealthProfileHandler::onConnected(int result, const char *remote_a
             if(bt_adapter_get_bonded_device_info(remote_address, &deviceInfo) == BT_ERROR_NONE &&
                     deviceInfo != NULL) {            
                 BluetoothDeviceSharedPtr device(new BluetoothDevice(deviceInfo));
+                               // need to check
+                               device->copyAceCheckAccessFunction(getInstance());
                 bt_adapter_free_device_info(deviceInfo);
             
                 LoggerD("invoke BluetoothHealthApplication.onconnect");
                 healthChannel = new BluetoothHealthChannel(channel, device, type, application);
+                               healthChannel->copyAceCheckAccessFunction(getInstance());
                 object->mConnectedSocketMap.insert(std::pair<unsigned int, BluetoothHealthChannelPtr>(channel, healthChannel));
                 isChannelInserted = true;
                 callback->invokeCallback("onconnect", JSBluetoothHealthChannel::createJSObject(callback->getContext(), healthChannel));        
@@ -97,6 +100,7 @@ void BluetoothHealthProfileHandler::onConnected(int result, const char *remote_a
             if(result == BT_ERROR_NONE) {
                 if(isChannelInserted == false) {
                     healthChannel = new BluetoothHealthChannel(channel, i->second->mRemoteDevice, type, application);
+                                       healthChannel->copyAceCheckAccessFunction(getInstance());
                     object->mConnectedSocketMap.insert(std::pair<unsigned int, BluetoothHealthChannelPtr>(channel, healthChannel));
                 }
                 callback->invokeCallback("success", JSBluetoothHealthChannel::createJSObject(callback->getContext(), healthChannel));               
@@ -194,6 +198,8 @@ BluetoothHealthProfileHandler* BluetoothHealthProfileHandler::getInstance()
 
 BluetoothHealthProfileHandler::BluetoothHealthProfileHandler()
 {
+       Common::SecurityAccessor();             
+
     if(bt_hdp_set_connection_state_changed_cb(onConnected, onDisconnected, this) != BT_ERROR_NONE) {
         LoggerE("bt_hdp_set_connection_state_changed_cb() failed");
     }
@@ -203,6 +209,7 @@ BluetoothHealthProfileHandler::BluetoothHealthProfileHandler()
     }    
 }
 
+
 BluetoothHealthProfileHandler::~BluetoothHealthProfileHandler()
 {
     // unset platform callback
@@ -235,6 +242,8 @@ void BluetoothHealthProfileHandler::returnRegisteringSinkAppResult(unsigned shor
             std::string appID(app_id);
             //free(app_id);
             BluetoothHealthApplicationSharedPtr application(new BluetoothHealthApplication(appID, name, dataType));
+                       application->copyAceCheckAccessFunction(getInstance());
+
             mRegisteredHealthAppMap.insert(std::pair<std::string, BluetoothHealthApplicationSharedPtr>(appID, application));
             if(callback)
                 callback->invokeCallback("success", JSBluetoothHealthApplication::createJSObject(callback->getContext(), application));