Loading src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java +10 −1 Original line number Diff line number Diff line Loading @@ -170,6 +170,15 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback, update(cachedDevice); } @Override public void onAclConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { if (DBG) { Log.d(TAG, "onAclConnectionStateChanged() device: " + cachedDevice.getName() + ", state: " + state); } update(cachedDevice); } @Override public void onServiceConnected() { // When bluetooth service connected update the UI Loading Loading @@ -282,6 +291,6 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback, ", is connected : " + device.isConnected() + " , is profile connected : " + cachedDevice.isConnected()); } return device.getBondState() == BluetoothDevice.BOND_BONDED && cachedDevice.isConnected(); return device.getBondState() == BluetoothDevice.BOND_BONDED && device.isConnected(); } } src/com/android/settings/bluetooth/SavedBluetoothDeviceUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class SavedBluetoothDeviceUpdater extends BluetoothDeviceUpdater ", is connected : " + device.isConnected() + ", is profile connected : " + cachedDevice.isConnected()); } return device.getBondState() == BluetoothDevice.BOND_BONDED && !cachedDevice.isConnected(); return device.getBondState() == BluetoothDevice.BOND_BONDED && !device.isConnected(); } @Override Loading tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceUpdaterTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ public class BluetoothDeviceUpdaterTest { @Test public void isDeviceConnected_deviceConnected() { doReturn(BluetoothDevice.BOND_BONDED).when(mBluetoothDevice).getBondState(); doReturn(true).when(mCachedBluetoothDevice).isConnected(); doReturn(true).when(mBluetoothDevice).isConnected(); assertThat(mBluetoothDeviceUpdater.isDeviceConnected(mCachedBluetoothDevice)).isTrue(); } Loading @@ -188,7 +188,7 @@ public class BluetoothDeviceUpdaterTest { @Test public void isDeviceConnected_deviceNotConnected() { doReturn(BluetoothDevice.BOND_BONDED).when(mBluetoothDevice).getBondState(); doReturn(false).when(mCachedBluetoothDevice).isConnected(); doReturn(false).when(mBluetoothDevice).isConnected(); assertThat(mBluetoothDeviceUpdater.isDeviceConnected(mCachedBluetoothDevice)).isFalse(); } Loading tests/robotests/src/com/android/settings/bluetooth/SavedBluetoothDeviceUpdaterTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public class SavedBluetoothDeviceUpdaterTest { @Test public void update_filterMatch_addPreference() { doReturn(BluetoothDevice.BOND_BONDED).when(mBluetoothDevice).getBondState(); doReturn(false).when(mCachedBluetoothDevice).isConnected(); doReturn(false).when(mBluetoothDevice).isConnected(); mBluetoothDeviceUpdater.update(mCachedBluetoothDevice); Loading @@ -87,7 +87,7 @@ public class SavedBluetoothDeviceUpdaterTest { @Test public void update_filterNotMatch_removePreference() { doReturn(BluetoothDevice.BOND_NONE).when(mBluetoothDevice).getBondState(); doReturn(true).when(mCachedBluetoothDevice).isConnected(); doReturn(true).when(mBluetoothDevice).isConnected(); mBluetoothDeviceUpdater.update(mCachedBluetoothDevice); Loading @@ -96,7 +96,7 @@ public class SavedBluetoothDeviceUpdaterTest { @Test public void onProfileConnectionStateChanged_deviceConnected_removePreference() { when(mCachedBluetoothDevice.isConnected()).thenReturn(true); when(mBluetoothDevice.isConnected()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); Loading @@ -106,7 +106,7 @@ public class SavedBluetoothDeviceUpdaterTest { @Test public void onProfileConnectionStateChanged_deviceDisconnected_addPreference() { when(mCachedBluetoothDevice.isConnected()).thenReturn(false); when(mBluetoothDevice.isConnected()).thenReturn(false); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.A2DP); Loading Loading
src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java +10 −1 Original line number Diff line number Diff line Loading @@ -170,6 +170,15 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback, update(cachedDevice); } @Override public void onAclConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { if (DBG) { Log.d(TAG, "onAclConnectionStateChanged() device: " + cachedDevice.getName() + ", state: " + state); } update(cachedDevice); } @Override public void onServiceConnected() { // When bluetooth service connected update the UI Loading Loading @@ -282,6 +291,6 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback, ", is connected : " + device.isConnected() + " , is profile connected : " + cachedDevice.isConnected()); } return device.getBondState() == BluetoothDevice.BOND_BONDED && cachedDevice.isConnected(); return device.getBondState() == BluetoothDevice.BOND_BONDED && device.isConnected(); } }
src/com/android/settings/bluetooth/SavedBluetoothDeviceUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class SavedBluetoothDeviceUpdater extends BluetoothDeviceUpdater ", is connected : " + device.isConnected() + ", is profile connected : " + cachedDevice.isConnected()); } return device.getBondState() == BluetoothDevice.BOND_BONDED && !cachedDevice.isConnected(); return device.getBondState() == BluetoothDevice.BOND_BONDED && !device.isConnected(); } @Override Loading
tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceUpdaterTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ public class BluetoothDeviceUpdaterTest { @Test public void isDeviceConnected_deviceConnected() { doReturn(BluetoothDevice.BOND_BONDED).when(mBluetoothDevice).getBondState(); doReturn(true).when(mCachedBluetoothDevice).isConnected(); doReturn(true).when(mBluetoothDevice).isConnected(); assertThat(mBluetoothDeviceUpdater.isDeviceConnected(mCachedBluetoothDevice)).isTrue(); } Loading @@ -188,7 +188,7 @@ public class BluetoothDeviceUpdaterTest { @Test public void isDeviceConnected_deviceNotConnected() { doReturn(BluetoothDevice.BOND_BONDED).when(mBluetoothDevice).getBondState(); doReturn(false).when(mCachedBluetoothDevice).isConnected(); doReturn(false).when(mBluetoothDevice).isConnected(); assertThat(mBluetoothDeviceUpdater.isDeviceConnected(mCachedBluetoothDevice)).isFalse(); } Loading
tests/robotests/src/com/android/settings/bluetooth/SavedBluetoothDeviceUpdaterTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public class SavedBluetoothDeviceUpdaterTest { @Test public void update_filterMatch_addPreference() { doReturn(BluetoothDevice.BOND_BONDED).when(mBluetoothDevice).getBondState(); doReturn(false).when(mCachedBluetoothDevice).isConnected(); doReturn(false).when(mBluetoothDevice).isConnected(); mBluetoothDeviceUpdater.update(mCachedBluetoothDevice); Loading @@ -87,7 +87,7 @@ public class SavedBluetoothDeviceUpdaterTest { @Test public void update_filterNotMatch_removePreference() { doReturn(BluetoothDevice.BOND_NONE).when(mBluetoothDevice).getBondState(); doReturn(true).when(mCachedBluetoothDevice).isConnected(); doReturn(true).when(mBluetoothDevice).isConnected(); mBluetoothDeviceUpdater.update(mCachedBluetoothDevice); Loading @@ -96,7 +96,7 @@ public class SavedBluetoothDeviceUpdaterTest { @Test public void onProfileConnectionStateChanged_deviceConnected_removePreference() { when(mCachedBluetoothDevice.isConnected()).thenReturn(true); when(mBluetoothDevice.isConnected()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); Loading @@ -106,7 +106,7 @@ public class SavedBluetoothDeviceUpdaterTest { @Test public void onProfileConnectionStateChanged_deviceDisconnected_addPreference() { when(mCachedBluetoothDevice.isConnected()).thenReturn(false); when(mBluetoothDevice.isConnected()).thenReturn(false); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.A2DP); Loading