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));
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));
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");
}
}
}
+
BluetoothHealthProfileHandler::~BluetoothHealthProfileHandler()
{
// unset platform callback
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));