Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +6 −8 Original line number Diff line number Diff line Loading @@ -85,8 +85,6 @@ public class AdapterService extends Service { static final String BLUETOOTH_ADMIN_PERM = android.Manifest.permission.BLUETOOTH_ADMIN; static final String BLUETOOTH_PERM = android.Manifest.permission.BLUETOOTH; static final String BLUETOOTH_PRIVILEGED_PERM = android.Manifest.permission.BLUETOOTH_PRIVILEGED; private static final int ADAPTER_SERVICE_TYPE=Service.START_STICKY; Loading Loading @@ -1050,8 +1048,8 @@ public class AdapterService extends Service { } boolean createBond(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED_PERM, "Need BLUETOOTH PRIVILEGED permission"); enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device); if (deviceProp != null && deviceProp.getBondState() != BluetoothDevice.BOND_NONE) { return false; Loading Loading @@ -1270,8 +1268,8 @@ public class AdapterService extends Service { } boolean setPin(BluetoothDevice device, boolean accept, int len, byte[] pinCode) { enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED_PERM, "Need BLUETOOTH PRIVILEGED permission"); enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device); if (deviceProp == null || deviceProp.getBondState() != BluetoothDevice.BOND_BONDING) { return false; Loading @@ -1294,8 +1292,8 @@ public class AdapterService extends Service { } boolean setPairingConfirmation(BluetoothDevice device, boolean accept) { enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED_PERM, "Need BLUETOOTH PRIVILEGED permission"); enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device); if (deviceProp == null || deviceProp.getBondState() != BluetoothDevice.BOND_BONDING) { return false; Loading android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +3 −3 Original line number Diff line number Diff line Loading @@ -228,7 +228,7 @@ final class RemoteDevices { intent.putExtra(BluetoothDevice.EXTRA_PAIRING_KEY, pin); intent.putExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_PRIVILEGED_PERM); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); } void devicePropertyChangedCallback(byte[] address, int[] types, byte[][] values) { Loading Loading @@ -354,7 +354,7 @@ final class RemoteDevices { intent.putExtra(BluetoothDevice.EXTRA_DEVICE, getDevice(address)); intent.putExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, BluetoothDevice.PAIRING_VARIANT_PIN); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_PRIVILEGED_PERM); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); return; } Loading Loading @@ -396,7 +396,7 @@ final class RemoteDevices { intent.putExtra(BluetoothDevice.EXTRA_PAIRING_KEY, passkey); } intent.putExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, variant); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_PRIVILEGED_PERM); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); } void aclStateChangeCallback(int status, byte[] address, int newState) { Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +6 −8 Original line number Diff line number Diff line Loading @@ -85,8 +85,6 @@ public class AdapterService extends Service { static final String BLUETOOTH_ADMIN_PERM = android.Manifest.permission.BLUETOOTH_ADMIN; static final String BLUETOOTH_PERM = android.Manifest.permission.BLUETOOTH; static final String BLUETOOTH_PRIVILEGED_PERM = android.Manifest.permission.BLUETOOTH_PRIVILEGED; private static final int ADAPTER_SERVICE_TYPE=Service.START_STICKY; Loading Loading @@ -1050,8 +1048,8 @@ public class AdapterService extends Service { } boolean createBond(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED_PERM, "Need BLUETOOTH PRIVILEGED permission"); enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device); if (deviceProp != null && deviceProp.getBondState() != BluetoothDevice.BOND_NONE) { return false; Loading Loading @@ -1270,8 +1268,8 @@ public class AdapterService extends Service { } boolean setPin(BluetoothDevice device, boolean accept, int len, byte[] pinCode) { enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED_PERM, "Need BLUETOOTH PRIVILEGED permission"); enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device); if (deviceProp == null || deviceProp.getBondState() != BluetoothDevice.BOND_BONDING) { return false; Loading @@ -1294,8 +1292,8 @@ public class AdapterService extends Service { } boolean setPairingConfirmation(BluetoothDevice device, boolean accept) { enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED_PERM, "Need BLUETOOTH PRIVILEGED permission"); enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device); if (deviceProp == null || deviceProp.getBondState() != BluetoothDevice.BOND_BONDING) { return false; Loading
android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +3 −3 Original line number Diff line number Diff line Loading @@ -228,7 +228,7 @@ final class RemoteDevices { intent.putExtra(BluetoothDevice.EXTRA_PAIRING_KEY, pin); intent.putExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_PRIVILEGED_PERM); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); } void devicePropertyChangedCallback(byte[] address, int[] types, byte[][] values) { Loading Loading @@ -354,7 +354,7 @@ final class RemoteDevices { intent.putExtra(BluetoothDevice.EXTRA_DEVICE, getDevice(address)); intent.putExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, BluetoothDevice.PAIRING_VARIANT_PIN); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_PRIVILEGED_PERM); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); return; } Loading Loading @@ -396,7 +396,7 @@ final class RemoteDevices { intent.putExtra(BluetoothDevice.EXTRA_PAIRING_KEY, passkey); } intent.putExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, variant); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_PRIVILEGED_PERM); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); } void aclStateChangeCallback(int status, byte[] address, int newState) { Loading