Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -371,7 +371,7 @@ public class BluetoothEventManager { || cachedDevice.getHiSyncId() != BluetoothHearingAid.HI_SYNC_ID_INVALID) { mDeviceManager.onDeviceUnpaired(cachedDevice); } int reason = intent.getIntExtra(BluetoothDevice.EXTRA_REASON, int reason = intent.getIntExtra(BluetoothDevice.EXTRA_UNBOND_REASON, BluetoothDevice.ERROR); showUnbondMessage(context, cachedDevice.getName(), reason); Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothEventManagerTest.java +7 −4 Original line number Diff line number Diff line Loading @@ -357,7 +357,8 @@ public class BluetoothEventManagerTest { mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); mIntent.putExtra(BluetoothDevice.EXTRA_REASON, BluetoothDevice.UNBOND_REASON_AUTH_TIMEOUT); mIntent.putExtra(BluetoothDevice.EXTRA_UNBOND_REASON, BluetoothDevice.UNBOND_REASON_AUTH_TIMEOUT); when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedDevice1); when(mCachedDevice1.getName()).thenReturn(DEVICE_NAME); Loading @@ -372,7 +373,7 @@ public class BluetoothEventManagerTest { mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); mIntent.putExtra(BluetoothDevice.EXTRA_REASON, mIntent.putExtra(BluetoothDevice.EXTRA_UNBOND_REASON, BluetoothDevice.UNBOND_REASON_REMOTE_DEVICE_DOWN); when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedDevice1); when(mCachedDevice1.getName()).thenReturn(DEVICE_NAME); Loading @@ -388,7 +389,8 @@ public class BluetoothEventManagerTest { mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); mIntent.putExtra(BluetoothDevice.EXTRA_REASON, BluetoothDevice.UNBOND_REASON_AUTH_REJECTED); mIntent.putExtra(BluetoothDevice.EXTRA_UNBOND_REASON, BluetoothDevice.UNBOND_REASON_AUTH_REJECTED); when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedDevice1); when(mCachedDevice1.getName()).thenReturn(DEVICE_NAME); Loading @@ -403,7 +405,8 @@ public class BluetoothEventManagerTest { mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); mIntent.putExtra(BluetoothDevice.EXTRA_REASON, BluetoothDevice.UNBOND_REASON_AUTH_FAILED); mIntent.putExtra(BluetoothDevice.EXTRA_UNBOND_REASON, BluetoothDevice.UNBOND_REASON_AUTH_FAILED); when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedDevice1); when(mCachedDevice1.getName()).thenReturn(DEVICE_NAME); Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -371,7 +371,7 @@ public class BluetoothEventManager { || cachedDevice.getHiSyncId() != BluetoothHearingAid.HI_SYNC_ID_INVALID) { mDeviceManager.onDeviceUnpaired(cachedDevice); } int reason = intent.getIntExtra(BluetoothDevice.EXTRA_REASON, int reason = intent.getIntExtra(BluetoothDevice.EXTRA_UNBOND_REASON, BluetoothDevice.ERROR); showUnbondMessage(context, cachedDevice.getName(), reason); Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothEventManagerTest.java +7 −4 Original line number Diff line number Diff line Loading @@ -357,7 +357,8 @@ public class BluetoothEventManagerTest { mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); mIntent.putExtra(BluetoothDevice.EXTRA_REASON, BluetoothDevice.UNBOND_REASON_AUTH_TIMEOUT); mIntent.putExtra(BluetoothDevice.EXTRA_UNBOND_REASON, BluetoothDevice.UNBOND_REASON_AUTH_TIMEOUT); when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedDevice1); when(mCachedDevice1.getName()).thenReturn(DEVICE_NAME); Loading @@ -372,7 +373,7 @@ public class BluetoothEventManagerTest { mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); mIntent.putExtra(BluetoothDevice.EXTRA_REASON, mIntent.putExtra(BluetoothDevice.EXTRA_UNBOND_REASON, BluetoothDevice.UNBOND_REASON_REMOTE_DEVICE_DOWN); when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedDevice1); when(mCachedDevice1.getName()).thenReturn(DEVICE_NAME); Loading @@ -388,7 +389,8 @@ public class BluetoothEventManagerTest { mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); mIntent.putExtra(BluetoothDevice.EXTRA_REASON, BluetoothDevice.UNBOND_REASON_AUTH_REJECTED); mIntent.putExtra(BluetoothDevice.EXTRA_UNBOND_REASON, BluetoothDevice.UNBOND_REASON_AUTH_REJECTED); when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedDevice1); when(mCachedDevice1.getName()).thenReturn(DEVICE_NAME); Loading @@ -403,7 +405,8 @@ public class BluetoothEventManagerTest { mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); mIntent.putExtra(BluetoothDevice.EXTRA_REASON, BluetoothDevice.UNBOND_REASON_AUTH_FAILED); mIntent.putExtra(BluetoothDevice.EXTRA_UNBOND_REASON, BluetoothDevice.UNBOND_REASON_AUTH_FAILED); when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedDevice1); when(mCachedDevice1.getName()).thenReturn(DEVICE_NAME); Loading