Loading android/app/src/com/android/bluetooth/hid/HidDeviceService.java +9 −0 Original line number Diff line number Diff line Loading @@ -480,6 +480,7 @@ public class HidDeviceService extends ProfileService { synchronized boolean registerApp(BluetoothHidDeviceAppSdpSettings sdp, BluetoothHidDeviceAppQosSettings inQos, BluetoothHidDeviceAppQosSettings outQos, IBluetoothHidDeviceCallback callback) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (mUserUid != 0) { Log.w(TAG, "registerApp(): failed because another app is registered"); return false; Loading Loading @@ -526,6 +527,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean unregisterApp() { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "unregisterApp()"); } Loading @@ -550,6 +552,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean sendReport(BluetoothDevice device, int id, byte[] data) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "sendReport(): device=" + device + " id=" + id); } Loading @@ -559,6 +562,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean replyReport(BluetoothDevice device, byte type, byte id, byte[] data) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "replyReport(): device=" + device + " type=" + type + " id=" + id); } Loading @@ -568,6 +572,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean unplug(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "unplug(): device=" + device); } Loading @@ -577,6 +582,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean connect(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "connect(): device=" + device); } Loading @@ -585,6 +591,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean disconnect(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "disconnect(): device=" + device); } Loading @@ -598,6 +605,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean reportError(BluetoothDevice device, byte error) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "reportError(): device=" + device + " error=" + error); } Loading Loading @@ -669,6 +677,7 @@ public class HidDeviceService extends ProfileService { } int getConnectionState(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); if (mHidDevice != null && mHidDevice.equals(device)) { return mHidDeviceState; } Loading Loading
android/app/src/com/android/bluetooth/hid/HidDeviceService.java +9 −0 Original line number Diff line number Diff line Loading @@ -480,6 +480,7 @@ public class HidDeviceService extends ProfileService { synchronized boolean registerApp(BluetoothHidDeviceAppSdpSettings sdp, BluetoothHidDeviceAppQosSettings inQos, BluetoothHidDeviceAppQosSettings outQos, IBluetoothHidDeviceCallback callback) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (mUserUid != 0) { Log.w(TAG, "registerApp(): failed because another app is registered"); return false; Loading Loading @@ -526,6 +527,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean unregisterApp() { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "unregisterApp()"); } Loading @@ -550,6 +552,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean sendReport(BluetoothDevice device, int id, byte[] data) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "sendReport(): device=" + device + " id=" + id); } Loading @@ -559,6 +562,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean replyReport(BluetoothDevice device, byte type, byte id, byte[] data) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "replyReport(): device=" + device + " type=" + type + " id=" + id); } Loading @@ -568,6 +572,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean unplug(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "unplug(): device=" + device); } Loading @@ -577,6 +582,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean connect(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "connect(): device=" + device); } Loading @@ -585,6 +591,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean disconnect(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "disconnect(): device=" + device); } Loading @@ -598,6 +605,7 @@ public class HidDeviceService extends ProfileService { } synchronized boolean reportError(BluetoothDevice device, byte error) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (DBG) { Log.d(TAG, "reportError(): device=" + device + " error=" + error); } Loading Loading @@ -669,6 +677,7 @@ public class HidDeviceService extends ProfileService { } int getConnectionState(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); if (mHidDevice != null && mHidDevice.equals(device)) { return mHidDeviceState; } Loading