Revert "call getName() from CachedBluetoothDevice, not CachedBluetoothDeviceManager"

This reverts commit 3029efc5f7.

Reason for revert:
To fix null pointer crash in Pairing dialog. Dialog maybe triggered by intent, in which LocalBluetoothManager couldn't have instance for BluetoothDevice and will return null. As a result, we need to depend on method in CachedBluetoothManager to handle it.

Bug: 115754654
Bug: 112735753
Change-Id: I1ebf1f1c2829cfb75e6c382df5acf785fe54a185
This commit is contained in:
Lei Yu
2018-09-17 18:22:57 +00:00
parent 3029efc5f7
commit 499013b05e
2 changed files with 1 additions and 15 deletions

View File

@@ -85,7 +85,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
mType = intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, BluetoothDevice.ERROR);
mPasskey = intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_KEY, BluetoothDevice.ERROR);
mDeviceName = mBluetoothManager.getCachedDeviceManager().findDevice(mDevice).getName();
mDeviceName = mBluetoothManager.getCachedDeviceManager().getName(mDevice);
mPbapClientProfile = mBluetoothManager.getProfileManager().getPbapClientProfile();
mPasskeyFormatted = formatKey(mPasskey);
}