From 6a3a45c4f7a4cc3eb33e3636d69853bfd1e357a4 Mon Sep 17 00:00:00 2001 From: "dukan.kim" Date: Thu, 11 Apr 2013 20:45:29 +0900 Subject: [PATCH] Add E_USER_NOT_CONSENTED for new privacy policy. Change-Id: I9c5427a31684e82e366f1b3f0c6e0b95600e6e44 Signed-off-by: dukan.kim --- inc/FNetBtBluetoothHealth.h | 5 +++++ inc/FNetBtBluetoothManager.h | 10 ++++++++++ inc/FNetBtBluetoothOppClient.h | 2 ++ inc/FNetBtBluetoothOppServer.h | 5 +++++ inc/FNetBtBluetoothSppAcceptor.h | 7 +++++++ inc/FNetBtBluetoothSppInitiator.h | 4 ++++ src/FNetBtBluetoothHealth.cpp | 20 +++++++++---------- src/FNetBtBluetoothManager.cpp | 36 +++++++++++++++++------------------ src/FNetBtBluetoothOppClient.cpp | 6 ++++-- src/FNetBtBluetoothOppServer.cpp | 20 +++++++++---------- src/FNetBtBluetoothSppAcceptor.cpp | 18 ++++++++++++------ src/FNetBtBluetoothSppInitiator.cpp | 9 ++++++--- src/FNetBt_BluetoothManagerImpl.cpp | 4 ++-- src/inc/FNetBt_BluetoothManagerImpl.h | 3 ++- 14 files changed, 97 insertions(+), 52 deletions(-) mode change 100644 => 100755 src/FNetBtBluetoothHealth.cpp mode change 100644 => 100755 src/FNetBtBluetoothManager.cpp mode change 100644 => 100755 src/FNetBtBluetoothOppClient.cpp mode change 100644 => 100755 src/FNetBtBluetoothOppServer.cpp mode change 100644 => 100755 src/FNetBtBluetoothSppAcceptor.cpp mode change 100644 => 100755 src/FNetBtBluetoothSppInitiator.cpp diff --git a/inc/FNetBtBluetoothHealth.h b/inc/FNetBtBluetoothHealth.h index 60fc709..e2aac67 100755 --- a/inc/FNetBtBluetoothHealth.h +++ b/inc/FNetBtBluetoothHealth.h @@ -120,6 +120,7 @@ public: * @exception E_SERVICE_UNAVAILABLE The sink role with the specified data type is currently busy with another * instance or application. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The method has failed. */ result StartAsSink(int dataType); @@ -139,6 +140,7 @@ public: * operation. @n * For example, the sink role is not started yet. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The method has failed. */ result Stop(void); @@ -160,6 +162,7 @@ public: * For example, the sink role is not started yet. * @exception E_DEVICE_BUSY The pairing and connection process is in progress. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The method has failed. * @remarks If the local device is not paired with the specified target device, the pairing process starts * internally before the connect request is sent. @@ -186,6 +189,7 @@ public: * operation. @n * For example, there is no connection with the specified channel ID. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The method has failed. */ result Disconnect(int channelId); @@ -209,6 +213,7 @@ public: * For example, there is no connection with the specified channel ID. * @exception E_INVALID_ARG The input buffer has no data. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The operation has failed. * @see IBluetoothHealthEventListener::OnHealthDataReceived() */ diff --git a/inc/FNetBtBluetoothManager.h b/inc/FNetBtBluetoothManager.h index eadec09..7f2d285 100755 --- a/inc/FNetBtBluetoothManager.h +++ b/inc/FNetBtBluetoothManager.h @@ -113,6 +113,7 @@ public: * For example, %Bluetooth is already activated. * @exception E_OUT_OF_MEMORY The memory is insufficient. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothManagerEventListener::OnBluetoothActivated() */ @@ -133,6 +134,7 @@ public: * For example, the %Bluetooth is already deactivated. * @exception E_OUT_OF_MEMORY The memory is insufficient. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothManagerEventListener::OnBluetoothDeactivated() */ @@ -298,6 +300,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The specified device name is an empty string. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @remarks This method does not affect the system settings. */ @@ -320,6 +323,7 @@ public: * is @c BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE. * @exception E_INVALID_OPERATION %Bluetooth is not activated. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothManagerEventListener::OnBluetoothDiscoverableModeChanged() */ @@ -474,6 +478,7 @@ public: * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this * operation. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothDeviceEventListener::OnBluetoothDiscoveryStarted() * @see IBluetoothDeviceEventListener::OnBluetoothRemoteDeviceFoundN() @@ -495,6 +500,7 @@ public: * operation. @n * For example, the discovery has not started as yet. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothDeviceEventListener::OnBluetoothDiscoveryDone() */ @@ -516,6 +522,7 @@ public: * For example, the discovery is in progress. * @exception E_NOT_PAIRED The input device is not found in the paired device list. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @remarks The target remote device should be a paired device. * @see IBluetoothDeviceEventListener::OnBluetoothServiceListReceived() @@ -537,6 +544,7 @@ public: * For example, the %Bluetooth is not activated. * @exception E_DEVICE_BUSY The device cannot be approached because other operation is in progress. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @remarks IBluetoothDeviceEventListener::OnBluetoothPaired() is called if the pairing is successful, @n * IBluetoothDeviceEventListener::OnBluetoothPairingFailed() if the pairing has failed. @@ -557,6 +565,7 @@ public: * For example, the pairing process is not in progress. * @exception E_IN_PROGRESS The termination of the pairing process is in progress. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @remarks If the canceling of the pairing process is successful, @n * IBluetoothDeviceEventListener::OnBluetoothPairingFailed() is called with @c E_OPERATION_CANCELED. @@ -582,6 +591,7 @@ public: * list is in progress. * @exception E_NOT_PAIRED The input device is not found in the paired device list. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothDeviceEventListener::OnBluetoothUnpaired() */ diff --git a/inc/FNetBtBluetoothOppClient.h b/inc/FNetBtBluetoothOppClient.h index f49d6fe..7ab92ff 100755 --- a/inc/FNetBtBluetoothOppClient.h +++ b/inc/FNetBtBluetoothOppClient.h @@ -115,6 +115,7 @@ public: * For example, %Bluetooth is not activated. * @exception E_IN_PROGRESS The push process is in progress. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SERVICE_UNAVAILABLE The OPP service is unavailable. * @exception E_INACCESSIBLE_PATH The specified @c filePath is inaccessible. * @exception E_REMOTE_DEVICE_NOT_FOUND The input device is not found. @n @@ -145,6 +146,7 @@ public: * operation. @n * For example, the push request is not sent or accepted by a remote device. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. */ result CancelPush(void); diff --git a/inc/FNetBtBluetoothOppServer.h b/inc/FNetBtBluetoothOppServer.h index 8563389..ec3fed0 100755 --- a/inc/FNetBtBluetoothOppServer.h +++ b/inc/FNetBtBluetoothOppServer.h @@ -109,6 +109,7 @@ public: * For example, the service is not started yet or a push request is not * received from a remote device. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothOppClientEventListener::OnOppPushResponded() */ @@ -131,6 +132,7 @@ public: * For example, the service is not started yet or a push request is not * received from a remote device. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothOppClientEventListener::OnOppPushResponded() */ @@ -180,6 +182,7 @@ public: * For example, %Bluetooth is not activated. * @exception E_IN_PROGRESS The service has already started. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SERVICE_UNAVAILABLE The OPP service is unavailable. * @exception E_INACCESSIBLE_PATH The specified @c dstPath is inaccessible. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified @@ -205,6 +208,7 @@ public: * operation. @n * For example, the service is not started as yet. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_IN_PROGRESS The stop process is in progress. * @exception E_FAILURE The method has failed. */ @@ -227,6 +231,7 @@ public: * operation. @n * For example, the file transfer is not in progress. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The operation has failed. */ result StopTransfer(void); diff --git a/inc/FNetBtBluetoothSppAcceptor.h b/inc/FNetBtBluetoothSppAcceptor.h index 16154bb..a8b8049 100755 --- a/inc/FNetBtBluetoothSppAcceptor.h +++ b/inc/FNetBtBluetoothSppAcceptor.h @@ -110,6 +110,7 @@ public: * For example, the service is not started yet or the connection request is * not yet received from a remote device. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppInitiatorEventListener::OnSppConnectionResponded() */ @@ -132,6 +133,7 @@ public: * For example, the service is not started yet or the connection request is * not yet received from a remote device. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppInitiatorEventListener::OnSppConnectionResponded() */ @@ -152,6 +154,7 @@ public: * @exception E_IN_PROGRESS The service has already started. * @exception E_ALREADY_CONNECTED The connection with an SPP initiator has already been established. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SERVICE_UNAVAILABLE The SPP service with the specified UUId is unavailable. * @exception E_FAILURE The method has failed. */ @@ -174,6 +177,7 @@ public: * @exception E_IN_PROGRESS The service has already started. * @exception E_ALREADY_CONNECTED The connection with an SPP initiator has already been established. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SERVICE_UNAVAILABLE The SPP service with the specified UUId is unavailable. * @exception E_FAILURE The method has failed. */ @@ -196,6 +200,7 @@ public: * operation. @n * For example, the service is not started yet. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. */ result StopService(void); @@ -217,6 +222,7 @@ public: * For example, the service is not started yet or a connection with a remote * device is not established. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppAcceptorEventListener::OnSppDisconnected() * @see IBluetoothSppInitiatorEventListener::OnSppDisconnected() @@ -244,6 +250,7 @@ public: * @exception E_INVALID_ARG The specified @c buffer is empty. * @exception E_SYSTEM A system error has occurred. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppInitiatorEventListener::OnSppDataReceived() */ diff --git a/inc/FNetBtBluetoothSppInitiator.h b/inc/FNetBtBluetoothSppInitiator.h index 9bc7e44..2a8f6d0 100755 --- a/inc/FNetBtBluetoothSppInitiator.h +++ b/inc/FNetBtBluetoothSppInitiator.h @@ -110,6 +110,7 @@ public: * @exception E_IN_PROGRESS The connection process is in progress. * @exception E_ALREADY_CONNECTED The connection with an SPP acceptor has already been established. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SERVICE_UNAVAILABLE The SPP connection is unavailable. * @exception E_REMOTE_DEVICE_NOT_FOUND The input device is not found. @n * This exception is currently not in use. @@ -139,6 +140,7 @@ public: * @exception E_IN_PROGRESS The connection process is in progress. * @exception E_ALREADY_CONNECTED The connection with an SPP acceptor has already been established. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SERVICE_UNAVAILABLE The SPP connection is unavailable. * @exception E_REMOTE_DEVICE_NOT_FOUND The input device is not found. @n * This exception is currently not in use. @@ -170,6 +172,7 @@ public: * For example, the connection request is not sent or a connection with a * remote device is not established yet. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppAcceptorEventListener::OnSppDisconnected() */ @@ -196,6 +199,7 @@ public: * @exception E_INVALID_ARG The argument has no data. * @exception E_SYSTEM A system error has occurred. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppAcceptorEventListener::OnSppDataReceived() */ diff --git a/src/FNetBtBluetoothHealth.cpp b/src/FNetBtBluetoothHealth.cpp old mode 100644 new mode 100755 index 24fa8e8..df10464 --- a/src/FNetBtBluetoothHealth.cpp +++ b/src/FNetBtBluetoothHealth.cpp @@ -75,8 +75,8 @@ BluetoothHealth::StartAsSink(int dataType) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_HEALTH); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -91,8 +91,8 @@ BluetoothHealth::Stop(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_HEALTH); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -107,8 +107,8 @@ BluetoothHealth::ConnectToSource(const BluetoothDevice& remoteDevice) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_HEALTH); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -123,8 +123,8 @@ BluetoothHealth::Disconnect(int channelId) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_HEALTH); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -139,8 +139,8 @@ BluetoothHealth::SendData(int channelId, const Tizen::Base::ByteBuffer& buffer) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_HEALTH); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); diff --git a/src/FNetBtBluetoothManager.cpp b/src/FNetBtBluetoothManager.cpp old mode 100644 new mode 100755 index e0bffbd..44ea9fc --- a/src/FNetBtBluetoothManager.cpp +++ b/src/FNetBtBluetoothManager.cpp @@ -82,8 +82,8 @@ BluetoothManager::Activate(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_ADMIN); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -97,8 +97,8 @@ BluetoothManager::Deactivate(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_ADMIN); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -185,8 +185,8 @@ BluetoothManager::SetLocalDeviceName(const Tizen::Base::String& deviceName) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_ADMIN); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -285,8 +285,8 @@ BluetoothManager::StartDiscovery(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_GAP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -300,8 +300,8 @@ BluetoothManager::CancelDiscovery(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_GAP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -315,8 +315,8 @@ BluetoothManager::RetrieveServiceList(const BluetoothDevice& pairedDevice) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_GAP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -330,8 +330,8 @@ BluetoothManager::Pair(const BluetoothDevice& remoteDevice) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_GAP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -345,8 +345,8 @@ BluetoothManager::CancelPair(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_GAP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -360,8 +360,8 @@ BluetoothManager::Unpair(const BluetoothDevice& pairedDevice) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_GAP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); diff --git a/src/FNetBtBluetoothOppClient.cpp b/src/FNetBtBluetoothOppClient.cpp old mode 100644 new mode 100755 index bd33dc0..e3b7edd --- a/src/FNetBtBluetoothOppClient.cpp +++ b/src/FNetBtBluetoothOppClient.cpp @@ -76,7 +76,8 @@ BluetoothOppClient::PushFile(const BluetoothDevice& remoteDevice, const Base::St // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_OPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -91,7 +92,8 @@ BluetoothOppClient::CancelPush(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_OPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); diff --git a/src/FNetBtBluetoothOppServer.cpp b/src/FNetBtBluetoothOppServer.cpp old mode 100644 new mode 100755 index 6408760..d07a742 --- a/src/FNetBtBluetoothOppServer.cpp +++ b/src/FNetBtBluetoothOppServer.cpp @@ -74,8 +74,8 @@ BluetoothOppServer::AcceptPush(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_OPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -90,8 +90,8 @@ BluetoothOppServer::RejectPush(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_OPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -124,8 +124,8 @@ BluetoothOppServer::StartService(const Tizen::Base::String& dstPath) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_OPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -140,8 +140,8 @@ BluetoothOppServer::StopService(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_OPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -156,8 +156,8 @@ BluetoothOppServer::StopTransfer(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_OPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); diff --git a/src/FNetBtBluetoothSppAcceptor.cpp b/src/FNetBtBluetoothSppAcceptor.cpp old mode 100644 new mode 100755 index 658c6ca..4353786 --- a/src/FNetBtBluetoothSppAcceptor.cpp +++ b/src/FNetBtBluetoothSppAcceptor.cpp @@ -75,7 +75,8 @@ BluetoothSppAcceptor::AcceptConnection(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_SPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -90,7 +91,8 @@ BluetoothSppAcceptor::RejectConnection() // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_SPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -112,7 +114,8 @@ BluetoothSppAcceptor::StartService(const Tizen::Base::UuId& serviceUuid) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_SPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -127,7 +130,8 @@ BluetoothSppAcceptor::StopService(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_SPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -142,7 +146,8 @@ BluetoothSppAcceptor::SendData(const Tizen::Base::ByteBuffer& buffer) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_SPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -157,7 +162,8 @@ BluetoothSppAcceptor::Disconnect(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_SPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); diff --git a/src/FNetBtBluetoothSppInitiator.cpp b/src/FNetBtBluetoothSppInitiator.cpp old mode 100644 new mode 100755 index ecdf810..273417c --- a/src/FNetBtBluetoothSppInitiator.cpp +++ b/src/FNetBtBluetoothSppInitiator.cpp @@ -77,7 +77,8 @@ BluetoothSppInitiator::SendData(const Tizen::Base::ByteBuffer& buffer) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_SPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -99,7 +100,8 @@ BluetoothSppInitiator::Connect(const BluetoothDevice& remoteDevice, const Tizen: // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_SPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -114,7 +116,8 @@ BluetoothSppInitiator::Disconnect(void) // Privilege check r = _AccessController::CheckUserPrivilege(_PRV_BLUETOOTH_SPP); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED, E_OUT_OF_MEMORY); + SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, r, "The application is not permitted to call this method."); // Check Construct SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); diff --git a/src/FNetBt_BluetoothManagerImpl.cpp b/src/FNetBt_BluetoothManagerImpl.cpp index 01c3f24..05b42d5 100755 --- a/src/FNetBt_BluetoothManagerImpl.cpp +++ b/src/FNetBt_BluetoothManagerImpl.cpp @@ -396,8 +396,8 @@ _BluetoothManagerImpl::SetDiscoverableMode(BluetoothDiscoverableMode mode, int s // Sets the discoverable mode through osp-connectivity-service. r = __pIpcProxy->SetDiscoverableMode((int)mode, seconds); - SysTryReturnResult(NID_NET_BT, r != E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, - "The application does not have the privilege to call this method."); + SysTryReturnResult(NID_NET_BT, r != E_PRIVILEGE_DENIED && r != E_USER_NOT_CONSENTED, r, + "The application is not permitted to call this method."); SysTryReturn(NID_NET_BT, r == E_SUCCESS, r, r, "[%s] Setting the the discoverable mode through osp-connectivity-service has failed.", GetErrorMessage(r)); diff --git a/src/inc/FNetBt_BluetoothManagerImpl.h b/src/inc/FNetBt_BluetoothManagerImpl.h index aa78864..6602723 100755 --- a/src/inc/FNetBt_BluetoothManagerImpl.h +++ b/src/inc/FNetBt_BluetoothManagerImpl.h @@ -257,7 +257,7 @@ public: * * @visibility partner-manufacturer * @privlevel platform - * @privilege http://tizen.org/privilege/bluetoothmanager + * @privilege %http://tizen.org/privilege/bluetoothmanager * * @return An error code * @param[in] mode The new discoverable mode @@ -267,6 +267,7 @@ public: * @c mode is BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE. * @exception E_INVALID_OPERATION %Bluetooth is not activated. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothManagerEventListener::OnBluetoothDiscoverableModeChanged() * @remarks @c seconds is adopted only if the specified @c mode is BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE. -- 2.7.4