Loading android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +34 −27 Original line number Diff line number Diff line Loading @@ -668,41 +668,48 @@ class AdapterProperties { } } void cleanupPrevBondRecordsFor(BluetoothDevice currentDevice) { String currentAddress = currentDevice.getAddress(); String currentBrEdrAddress = void cleanupPrevBondRecordsFor(BluetoothDevice device) { String address = device.getAddress(); String identityAddress = Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(currentDevice, mService) : mService.getIdentityAddress(currentAddress); debugLog("cleanupPrevBondRecordsFor: " + currentDevice); if (currentBrEdrAddress == null) { ? Utils.getBrEdrAddress(device, mService) : mService.getIdentityAddress(address); debugLog("cleanupPrevBondRecordsFor: " + device); if (identityAddress == null) { return; } for (BluetoothDevice device : mBondedDevices) { String address = device.getAddress(); String brEdrAddress = for (BluetoothDevice existingDevice : mBondedDevices) { String existingAddress = existingDevice.getAddress(); String existingIdentityAddress = Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(device, mService) : mService.getIdentityAddress(address); if (currentBrEdrAddress.equals(brEdrAddress) && !currentAddress.equals(address)) { if (mService.getNative() .removeBond(Utils.getBytesFromAddress(device.getAddress()))) { mBondedDevices.remove(device); infoLog("Removing old bond record: " + device + " for current device: " + currentDevice); ? Utils.getBrEdrAddress(existingDevice, mService) : mService.getIdentityAddress(existingAddress); if (!identityAddress.equals(existingIdentityAddress) || address.equals( existingAddress)) { continue; } // Found an existing device with same identity address but different pseudo address if (mService.getNative().removeBond(Utils.getBytesFromAddress(existingAddress))) { mBondedDevices.remove(existingDevice); infoLog( "Removing old bond record: " + existingDevice + " for the device: " + device); } else { Log.e(TAG, "Unexpected error while removing old bond record:" + device + " for current device: " + currentDevice); Log.e( TAG, "Unexpected error while removing old bond record:" + existingDevice + " for the device: " + device); } break; } } } int getDiscoverableTimeout() { return mDiscoverableTimeout; Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +34 −27 Original line number Diff line number Diff line Loading @@ -668,41 +668,48 @@ class AdapterProperties { } } void cleanupPrevBondRecordsFor(BluetoothDevice currentDevice) { String currentAddress = currentDevice.getAddress(); String currentBrEdrAddress = void cleanupPrevBondRecordsFor(BluetoothDevice device) { String address = device.getAddress(); String identityAddress = Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(currentDevice, mService) : mService.getIdentityAddress(currentAddress); debugLog("cleanupPrevBondRecordsFor: " + currentDevice); if (currentBrEdrAddress == null) { ? Utils.getBrEdrAddress(device, mService) : mService.getIdentityAddress(address); debugLog("cleanupPrevBondRecordsFor: " + device); if (identityAddress == null) { return; } for (BluetoothDevice device : mBondedDevices) { String address = device.getAddress(); String brEdrAddress = for (BluetoothDevice existingDevice : mBondedDevices) { String existingAddress = existingDevice.getAddress(); String existingIdentityAddress = Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(device, mService) : mService.getIdentityAddress(address); if (currentBrEdrAddress.equals(brEdrAddress) && !currentAddress.equals(address)) { if (mService.getNative() .removeBond(Utils.getBytesFromAddress(device.getAddress()))) { mBondedDevices.remove(device); infoLog("Removing old bond record: " + device + " for current device: " + currentDevice); ? Utils.getBrEdrAddress(existingDevice, mService) : mService.getIdentityAddress(existingAddress); if (!identityAddress.equals(existingIdentityAddress) || address.equals( existingAddress)) { continue; } // Found an existing device with same identity address but different pseudo address if (mService.getNative().removeBond(Utils.getBytesFromAddress(existingAddress))) { mBondedDevices.remove(existingDevice); infoLog( "Removing old bond record: " + existingDevice + " for the device: " + device); } else { Log.e(TAG, "Unexpected error while removing old bond record:" + device + " for current device: " + currentDevice); Log.e( TAG, "Unexpected error while removing old bond record:" + existingDevice + " for the device: " + device); } break; } } } int getDiscoverableTimeout() { return mDiscoverableTimeout; Loading