Loading android/app/jni/bluetooth_socket_manager.cc +20 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ Status BluetoothSocketManagerBinderServer::connectSocket( std::unique_ptr<ParcelFileDescriptor>* _aidl_return) { if (!isCallerActiveUserOrManagedProfile()) { LOG(WARNING) << "connectSocket() - Not allowed for non-active users"; return Status::ok(); return Status::fromExceptionCode( Status::EX_SECURITY, String8("Not allowed for non-active users")); } ENFORCE_PERMISSION(PERMISSION_BLUETOOTH); Loading Loading @@ -67,7 +68,8 @@ Status BluetoothSocketManagerBinderServer::createSocketChannel( std::unique_ptr<ParcelFileDescriptor>* _aidl_return) { if (!isCallerActiveUserOrManagedProfile()) { LOG(WARNING) << "createSocketChannel() - Not allowed for non-active users"; return Status::ok(); return Status::fromExceptionCode( Status::EX_SECURITY, String8("Not allowed for non-active users")); } ENFORCE_PERMISSION(PERMISSION_BLUETOOTH); Loading Loading @@ -100,5 +102,21 @@ Status BluetoothSocketManagerBinderServer::createSocketChannel( return Status::ok(); } Status BluetoothSocketManagerBinderServer::requestMaximumTxDataLength( const BluetoothDevice& device) { if (!isCallerActiveUserOrManagedProfile()) { LOG(WARNING) << __func__ << ": Not allowed for non-active users"; return Status::fromExceptionCode( Status::EX_SECURITY, String8("Not allowed for non-active users")); } ENFORCE_PERMISSION(PERMISSION_BLUETOOTH); VLOG(1) << __func__; socketInterface->request_max_tx_data_length(device.address); return Status::ok(); } } // namespace bluetooth } // namespace android android/app/jni/bluetooth_socket_manager.h +2 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ class BluetoothSocketManagerBinderServer : public BnBluetoothSocketManager { std::unique_ptr<::android::os::ParcelFileDescriptor>* _aidl_return) override; Status requestMaximumTxDataLength(const BluetoothDevice& device); private: const btsock_interface_t* socketInterface; DISALLOW_COPY_AND_ASSIGN(BluetoothSocketManagerBinderServer); Loading Loading
android/app/jni/bluetooth_socket_manager.cc +20 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ Status BluetoothSocketManagerBinderServer::connectSocket( std::unique_ptr<ParcelFileDescriptor>* _aidl_return) { if (!isCallerActiveUserOrManagedProfile()) { LOG(WARNING) << "connectSocket() - Not allowed for non-active users"; return Status::ok(); return Status::fromExceptionCode( Status::EX_SECURITY, String8("Not allowed for non-active users")); } ENFORCE_PERMISSION(PERMISSION_BLUETOOTH); Loading Loading @@ -67,7 +68,8 @@ Status BluetoothSocketManagerBinderServer::createSocketChannel( std::unique_ptr<ParcelFileDescriptor>* _aidl_return) { if (!isCallerActiveUserOrManagedProfile()) { LOG(WARNING) << "createSocketChannel() - Not allowed for non-active users"; return Status::ok(); return Status::fromExceptionCode( Status::EX_SECURITY, String8("Not allowed for non-active users")); } ENFORCE_PERMISSION(PERMISSION_BLUETOOTH); Loading Loading @@ -100,5 +102,21 @@ Status BluetoothSocketManagerBinderServer::createSocketChannel( return Status::ok(); } Status BluetoothSocketManagerBinderServer::requestMaximumTxDataLength( const BluetoothDevice& device) { if (!isCallerActiveUserOrManagedProfile()) { LOG(WARNING) << __func__ << ": Not allowed for non-active users"; return Status::fromExceptionCode( Status::EX_SECURITY, String8("Not allowed for non-active users")); } ENFORCE_PERMISSION(PERMISSION_BLUETOOTH); VLOG(1) << __func__; socketInterface->request_max_tx_data_length(device.address); return Status::ok(); } } // namespace bluetooth } // namespace android
android/app/jni/bluetooth_socket_manager.h +2 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ class BluetoothSocketManagerBinderServer : public BnBluetoothSocketManager { std::unique_ptr<::android::os::ParcelFileDescriptor>* _aidl_return) override; Status requestMaximumTxDataLength(const BluetoothDevice& device); private: const btsock_interface_t* socketInterface; DISALLOW_COPY_AND_ASSIGN(BluetoothSocketManagerBinderServer); Loading