Loading src/com/android/settings/accessibility/AvailableHearingDeviceUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class AvailableHearingDeviceUpdater extends AvailableMediaBluetoothDevice static boolean isAvailableHearingDevice(CachedBluetoothDevice cachedDevice) { final BluetoothDevice device = cachedDevice.getDevice(); return cachedDevice.isHearingAidDevice() return cachedDevice.isHearingDevice() && device.getBondState() == BluetoothDevice.BOND_BONDED && device.isConnected(); } Loading src/com/android/settings/accessibility/SavedHearingDeviceUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ public class SavedHearingDeviceUpdater extends SavedBluetoothDeviceUpdater { static boolean isSavedHearingAidDevice(CachedBluetoothDevice cachedDevice) { final BluetoothDevice device = cachedDevice.getDevice(); return cachedDevice.isHearingAidDevice() return cachedDevice.isHearingDevice() && device.getBondState() == BluetoothDevice.BOND_BONDED && !device.isConnected(); } Loading src/com/android/settings/bluetooth/BluetoothDetailsRelatedToolsController.java +2 −2 Original line number Diff line number Diff line Loading @@ -60,12 +60,12 @@ public class BluetoothDetailsRelatedToolsController extends BluetoothDetailsCont @Override public boolean isAvailable() { return mCachedDevice.isHearingAidDevice(); return mCachedDevice.isHearingDevice(); } @Override protected void init(PreferenceScreen screen) { if (!mCachedDevice.isHearingAidDevice()) { if (!isAvailable()) { return; } Loading tests/robotests/src/com/android/settings/accessibility/AvailableHearingDevicePreferenceControllerTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -85,10 +85,10 @@ public class AvailableHearingDevicePreferenceControllerTest { } @Test public void updateDynamicRawDataToIndex_isNotHearingAidDevice_deviceIsNotSearchable() { public void updateDynamicRawDataToIndex_isNotHearingDevice_deviceIsNotSearchable() { when(mDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); when(mDevice.isConnected()).thenReturn(true); when(mCachedDevice.isHearingAidDevice()).thenReturn(false); when(mCachedDevice.isHearingDevice()).thenReturn(false); List<SearchIndexableRaw> searchData = new ArrayList<>(); mAvailableHearingDevicePreferenceController.updateDynamicRawDataToIndex(searchData); Loading @@ -97,10 +97,10 @@ public class AvailableHearingDevicePreferenceControllerTest { } @Test public void updateDynamicRawDataToIndex_isHearingAidDevice_deviceIsSearchable() { public void updateDynamicRawDataToIndex_isHearingDevice_deviceIsSearchable() { when(mDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); when(mDevice.isConnected()).thenReturn(true); when(mCachedDevice.isHearingAidDevice()).thenReturn(true); when(mCachedDevice.isHearingDevice()).thenReturn(true); List<SearchIndexableRaw> searchData = new ArrayList<>(); mAvailableHearingDevicePreferenceController.updateDynamicRawDataToIndex(searchData); Loading tests/robotests/src/com/android/settings/accessibility/AvailableHearingDeviceUpdaterTest.java +5 −4 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ public class AvailableHearingDeviceUpdaterTest { @Test public void isFilterMatch_connectedHearingDevice_returnTrue() { CachedBluetoothDevice connectedHearingDevice = mCachedBluetoothDevice; when(connectedHearingDevice.isHearingAidDevice()).thenReturn(true); when(connectedHearingDevice.isHearingDevice()).thenReturn(true); when(mBluetoothDevice.isConnected()).thenReturn(true); when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn( Loading @@ -91,7 +91,7 @@ public class AvailableHearingDeviceUpdaterTest { @Test public void isFilterMatch_nonConnectedHearingDevice_returnFalse() { CachedBluetoothDevice nonConnectedHearingDevice = mCachedBluetoothDevice; when(nonConnectedHearingDevice.isHearingAidDevice()).thenReturn(true); when(nonConnectedHearingDevice.isHearingDevice()).thenReturn(true); when(mBluetoothDevice.isConnected()).thenReturn(false); when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn( Loading @@ -102,8 +102,9 @@ public class AvailableHearingDeviceUpdaterTest { @Test public void isFilterMatch_connectedBondingHearingDevice_returnFalse() { CachedBluetoothDevice connectedBondingHearingDevice = mCachedBluetoothDevice; when(connectedBondingHearingDevice.isHearingAidDevice()).thenReturn(true); when(connectedBondingHearingDevice.isHearingDevice()).thenReturn(true); when(mBluetoothDevice.isConnected()).thenReturn(true); when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn( Loading @@ -115,7 +116,7 @@ public class AvailableHearingDeviceUpdaterTest { @Test public void isFilterMatch_hearingDeviceNotInCachedDevicesList_returnFalse() { CachedBluetoothDevice notInCachedDevicesListDevice = mCachedBluetoothDevice; when(notInCachedDevicesListDevice.isHearingAidDevice()).thenReturn(true); when(notInCachedDevicesListDevice.isHearingDevice()).thenReturn(true); when(mBluetoothDevice.isConnected()).thenReturn(true); when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn(new ArrayList<>()); Loading Loading
src/com/android/settings/accessibility/AvailableHearingDeviceUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class AvailableHearingDeviceUpdater extends AvailableMediaBluetoothDevice static boolean isAvailableHearingDevice(CachedBluetoothDevice cachedDevice) { final BluetoothDevice device = cachedDevice.getDevice(); return cachedDevice.isHearingAidDevice() return cachedDevice.isHearingDevice() && device.getBondState() == BluetoothDevice.BOND_BONDED && device.isConnected(); } Loading
src/com/android/settings/accessibility/SavedHearingDeviceUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ public class SavedHearingDeviceUpdater extends SavedBluetoothDeviceUpdater { static boolean isSavedHearingAidDevice(CachedBluetoothDevice cachedDevice) { final BluetoothDevice device = cachedDevice.getDevice(); return cachedDevice.isHearingAidDevice() return cachedDevice.isHearingDevice() && device.getBondState() == BluetoothDevice.BOND_BONDED && !device.isConnected(); } Loading
src/com/android/settings/bluetooth/BluetoothDetailsRelatedToolsController.java +2 −2 Original line number Diff line number Diff line Loading @@ -60,12 +60,12 @@ public class BluetoothDetailsRelatedToolsController extends BluetoothDetailsCont @Override public boolean isAvailable() { return mCachedDevice.isHearingAidDevice(); return mCachedDevice.isHearingDevice(); } @Override protected void init(PreferenceScreen screen) { if (!mCachedDevice.isHearingAidDevice()) { if (!isAvailable()) { return; } Loading
tests/robotests/src/com/android/settings/accessibility/AvailableHearingDevicePreferenceControllerTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -85,10 +85,10 @@ public class AvailableHearingDevicePreferenceControllerTest { } @Test public void updateDynamicRawDataToIndex_isNotHearingAidDevice_deviceIsNotSearchable() { public void updateDynamicRawDataToIndex_isNotHearingDevice_deviceIsNotSearchable() { when(mDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); when(mDevice.isConnected()).thenReturn(true); when(mCachedDevice.isHearingAidDevice()).thenReturn(false); when(mCachedDevice.isHearingDevice()).thenReturn(false); List<SearchIndexableRaw> searchData = new ArrayList<>(); mAvailableHearingDevicePreferenceController.updateDynamicRawDataToIndex(searchData); Loading @@ -97,10 +97,10 @@ public class AvailableHearingDevicePreferenceControllerTest { } @Test public void updateDynamicRawDataToIndex_isHearingAidDevice_deviceIsSearchable() { public void updateDynamicRawDataToIndex_isHearingDevice_deviceIsSearchable() { when(mDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); when(mDevice.isConnected()).thenReturn(true); when(mCachedDevice.isHearingAidDevice()).thenReturn(true); when(mCachedDevice.isHearingDevice()).thenReturn(true); List<SearchIndexableRaw> searchData = new ArrayList<>(); mAvailableHearingDevicePreferenceController.updateDynamicRawDataToIndex(searchData); Loading
tests/robotests/src/com/android/settings/accessibility/AvailableHearingDeviceUpdaterTest.java +5 −4 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ public class AvailableHearingDeviceUpdaterTest { @Test public void isFilterMatch_connectedHearingDevice_returnTrue() { CachedBluetoothDevice connectedHearingDevice = mCachedBluetoothDevice; when(connectedHearingDevice.isHearingAidDevice()).thenReturn(true); when(connectedHearingDevice.isHearingDevice()).thenReturn(true); when(mBluetoothDevice.isConnected()).thenReturn(true); when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn( Loading @@ -91,7 +91,7 @@ public class AvailableHearingDeviceUpdaterTest { @Test public void isFilterMatch_nonConnectedHearingDevice_returnFalse() { CachedBluetoothDevice nonConnectedHearingDevice = mCachedBluetoothDevice; when(nonConnectedHearingDevice.isHearingAidDevice()).thenReturn(true); when(nonConnectedHearingDevice.isHearingDevice()).thenReturn(true); when(mBluetoothDevice.isConnected()).thenReturn(false); when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn( Loading @@ -102,8 +102,9 @@ public class AvailableHearingDeviceUpdaterTest { @Test public void isFilterMatch_connectedBondingHearingDevice_returnFalse() { CachedBluetoothDevice connectedBondingHearingDevice = mCachedBluetoothDevice; when(connectedBondingHearingDevice.isHearingAidDevice()).thenReturn(true); when(connectedBondingHearingDevice.isHearingDevice()).thenReturn(true); when(mBluetoothDevice.isConnected()).thenReturn(true); when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDING); when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn( Loading @@ -115,7 +116,7 @@ public class AvailableHearingDeviceUpdaterTest { @Test public void isFilterMatch_hearingDeviceNotInCachedDevicesList_returnFalse() { CachedBluetoothDevice notInCachedDevicesListDevice = mCachedBluetoothDevice; when(notInCachedDevicesListDevice.isHearingAidDevice()).thenReturn(true); when(notInCachedDevicesListDevice.isHearingDevice()).thenReturn(true); when(mBluetoothDevice.isConnected()).thenReturn(true); when(mBluetoothDevice.getBondState()).thenReturn(BluetoothDevice.BOND_BONDED); when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn(new ArrayList<>()); Loading