Loading android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java +7 −8 Original line number Diff line number Diff line Loading @@ -880,22 +880,21 @@ final class A2dpStateMachine extends StateMachine { boolean okToConnect(BluetoothDevice device) { AdapterService adapterService = AdapterService.getAdapterService(); int priority = mService.getPriority(device); boolean ret = false; //check if this is an incoming connection in Quiet mode. if((adapterService == null) || ((adapterService.isQuietModeEnabled()) && (mTargetDevice == null))) { ret = false; return false; } // check priority and accept or reject the connection. if priority is undefined // it is likely that our SDP has not completed and peer is initiating the // connection. Allow this connection, provided the device is bonded else if((BluetoothProfile.PRIORITY_OFF < priority) || ((BluetoothProfile.PRIORITY_UNDEFINED == priority) && (device.getBondState() != BluetoothDevice.BOND_NONE))){ ret= true; if ((BluetoothProfile.PRIORITY_OFF < priority) || ( (BluetoothProfile.PRIORITY_UNDEFINED == priority) && (device.getBondState() != BluetoothDevice.BOND_NONE))) { return true; } return ret; return false; } synchronized List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { Loading android/app/src/com/android/bluetooth/avrcpcontroller/PlayerApplicationSettings.java +5 −5 Original line number Diff line number Diff line Loading @@ -147,13 +147,13 @@ class PlayerApplicationSettings { try { if ((supportedSettings & settingSubset) == settingSubset) { for (Integer settingId : mSettings.keySet()) { if ((settingId & settingSubset )== settingId && (!mSupportedValues.get(settingId).contains(settingsToCheck. getSettingValue(settingId)))) // The setting is in both settings to check and supported settings but the // value is not supported. if ((settingId & settingSubset) == settingId && (!mSupportedValues.get( settingId).contains(settingsToCheck.getSettingValue(settingId)))) { return false; } } return true; } } catch (NullPointerException e) { Loading android/app/src/com/android/bluetooth/gatt/GattService.java +8 −16 Original line number Diff line number Diff line Loading @@ -226,10 +226,8 @@ public class GattService extends ProfileService { } boolean permissionCheck(UUID uuid) { if (isRestrictedCharUuid(uuid) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED))) return false; else return true; return !(isRestrictedCharUuid(uuid) && (0 != checkCallingOrSelfPermission( BLUETOOTH_PRIVILEGED))); } boolean permissionCheck(int connId, int handle) { Loading @@ -239,22 +237,16 @@ public class GattService extends ProfileService { for (BluetoothGattService service : db) { for (BluetoothGattCharacteristic characteristic: service.getCharacteristics()) { if (handle == characteristic.getInstanceId()) { if ((isRestrictedCharUuid(characteristic.getUuid()) || isRestrictedSrvcUuid(service.getUuid())) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED))) return false; else return true; return !((isRestrictedCharUuid(characteristic.getUuid()) || isRestrictedSrvcUuid(service.getUuid())) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED))); } for (BluetoothGattDescriptor descriptor: characteristic.getDescriptors()) { if (handle == descriptor.getInstanceId()) { if ((isRestrictedCharUuid(characteristic.getUuid()) || isRestrictedSrvcUuid(service.getUuid())) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED))) return false; else return true; return !((isRestrictedCharUuid(characteristic.getUuid()) || isRestrictedSrvcUuid(service.getUuid())) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED))); } } } Loading android/app/src/com/android/bluetooth/hdp/HealthService.java +2 −3 Original line number Diff line number Diff line Loading @@ -277,9 +277,8 @@ public class HealthService extends ProfileService { Log.e(TAG, "failed to dup ParcelFileDescriptor"); break; } } } else{ /*set the channel fd to null if channel state isnot equal to connected*/ else{ chan.mChannelFd = null; } callHealthChannelCallback(chan.mConfig, chan.mDevice, newState, Loading android/app/src/com/android/bluetooth/hfp/AtPhonebook.java +3 −3 Original line number Diff line number Diff line Loading @@ -324,10 +324,10 @@ public class AtPhonebook { } String atCommand = (atString.split("="))[1]; String[] indices = atCommand.split(","); for(int i = 0; i < indices.length; i++) //replace AT command separator ';' from the index if any for (int i = 0; i < indices.length; i++) { indices[i] = indices[i].replace(';', ' ').trim(); try { } try { index1 = Integer.parseInt(indices[0]); if (indices.length == 1) index2 = index1; Loading Loading
android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java +7 −8 Original line number Diff line number Diff line Loading @@ -880,22 +880,21 @@ final class A2dpStateMachine extends StateMachine { boolean okToConnect(BluetoothDevice device) { AdapterService adapterService = AdapterService.getAdapterService(); int priority = mService.getPriority(device); boolean ret = false; //check if this is an incoming connection in Quiet mode. if((adapterService == null) || ((adapterService.isQuietModeEnabled()) && (mTargetDevice == null))) { ret = false; return false; } // check priority and accept or reject the connection. if priority is undefined // it is likely that our SDP has not completed and peer is initiating the // connection. Allow this connection, provided the device is bonded else if((BluetoothProfile.PRIORITY_OFF < priority) || ((BluetoothProfile.PRIORITY_UNDEFINED == priority) && (device.getBondState() != BluetoothDevice.BOND_NONE))){ ret= true; if ((BluetoothProfile.PRIORITY_OFF < priority) || ( (BluetoothProfile.PRIORITY_UNDEFINED == priority) && (device.getBondState() != BluetoothDevice.BOND_NONE))) { return true; } return ret; return false; } synchronized List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { Loading
android/app/src/com/android/bluetooth/avrcpcontroller/PlayerApplicationSettings.java +5 −5 Original line number Diff line number Diff line Loading @@ -147,13 +147,13 @@ class PlayerApplicationSettings { try { if ((supportedSettings & settingSubset) == settingSubset) { for (Integer settingId : mSettings.keySet()) { if ((settingId & settingSubset )== settingId && (!mSupportedValues.get(settingId).contains(settingsToCheck. getSettingValue(settingId)))) // The setting is in both settings to check and supported settings but the // value is not supported. if ((settingId & settingSubset) == settingId && (!mSupportedValues.get( settingId).contains(settingsToCheck.getSettingValue(settingId)))) { return false; } } return true; } } catch (NullPointerException e) { Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +8 −16 Original line number Diff line number Diff line Loading @@ -226,10 +226,8 @@ public class GattService extends ProfileService { } boolean permissionCheck(UUID uuid) { if (isRestrictedCharUuid(uuid) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED))) return false; else return true; return !(isRestrictedCharUuid(uuid) && (0 != checkCallingOrSelfPermission( BLUETOOTH_PRIVILEGED))); } boolean permissionCheck(int connId, int handle) { Loading @@ -239,22 +237,16 @@ public class GattService extends ProfileService { for (BluetoothGattService service : db) { for (BluetoothGattCharacteristic characteristic: service.getCharacteristics()) { if (handle == characteristic.getInstanceId()) { if ((isRestrictedCharUuid(characteristic.getUuid()) || isRestrictedSrvcUuid(service.getUuid())) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED))) return false; else return true; return !((isRestrictedCharUuid(characteristic.getUuid()) || isRestrictedSrvcUuid(service.getUuid())) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED))); } for (BluetoothGattDescriptor descriptor: characteristic.getDescriptors()) { if (handle == descriptor.getInstanceId()) { if ((isRestrictedCharUuid(characteristic.getUuid()) || isRestrictedSrvcUuid(service.getUuid())) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED))) return false; else return true; return !((isRestrictedCharUuid(characteristic.getUuid()) || isRestrictedSrvcUuid(service.getUuid())) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED))); } } } Loading
android/app/src/com/android/bluetooth/hdp/HealthService.java +2 −3 Original line number Diff line number Diff line Loading @@ -277,9 +277,8 @@ public class HealthService extends ProfileService { Log.e(TAG, "failed to dup ParcelFileDescriptor"); break; } } } else{ /*set the channel fd to null if channel state isnot equal to connected*/ else{ chan.mChannelFd = null; } callHealthChannelCallback(chan.mConfig, chan.mDevice, newState, Loading
android/app/src/com/android/bluetooth/hfp/AtPhonebook.java +3 −3 Original line number Diff line number Diff line Loading @@ -324,10 +324,10 @@ public class AtPhonebook { } String atCommand = (atString.split("="))[1]; String[] indices = atCommand.split(","); for(int i = 0; i < indices.length; i++) //replace AT command separator ';' from the index if any for (int i = 0; i < indices.length; i++) { indices[i] = indices[i].replace(';', ' ').trim(); try { } try { index1 = Integer.parseInt(indices[0]); if (indices.length == 1) index2 = index1; Loading