Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java +13 −1 Original line number Diff line number Diff line Loading @@ -761,6 +761,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, CONNECTED, Inactive} // 2. Battery Level: 10 when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mBatteryLevel = 10; Loading @@ -774,6 +775,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, CONNECTED, Inactive} // 2. Battery Level: 10 when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mBatteryLevel = 10; Loading @@ -788,6 +790,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Left ear} // 2. Battery Level: 10 // 3. Audio Manager: Normal (Without In Call) when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -804,6 +807,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Left ear} // 2. Battery Level: 10 // 3. Audio Manager: Normal (Without In Call) when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -820,6 +824,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Left ear} // 2. Battery Level: 10 // 3. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -837,6 +842,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Left ear} // 2. Battery Level: 10 // 3. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -854,6 +860,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, Connected, Active, Right ear} // 2. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -869,6 +876,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, Connected, Active, Right ear} // 2. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -885,6 +893,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, Connected, Active, Both ear} // 2. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mSubCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); Loading @@ -903,6 +912,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, Connected, Active, Both ear} // 2. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mSubCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); Loading @@ -923,6 +933,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Both ear} // 2. Battery Level: 10 // 3. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mSubCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); Loading @@ -944,6 +955,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Both ear} // 2. Battery Level: 10 // 3. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mSubCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); Loading Loading @@ -2426,7 +2438,7 @@ public class CachedBluetoothDeviceTest { assertThat(batteryLevelsInfo.getCaseBatteryLevel()).isEqualTo( Integer.parseInt(TWS_BATTERY_CASE)); assertThat(batteryLevelsInfo.getOverallBatteryLevel()).isEqualTo( Integer.parseInt(TWS_BATTERY_CASE)); Integer.parseInt(TWS_BATTERY_LEFT)); } @Test Loading Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java +13 −1 Original line number Diff line number Diff line Loading @@ -761,6 +761,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, CONNECTED, Inactive} // 2. Battery Level: 10 when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mBatteryLevel = 10; Loading @@ -774,6 +775,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, CONNECTED, Inactive} // 2. Battery Level: 10 when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mBatteryLevel = 10; Loading @@ -788,6 +790,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Left ear} // 2. Battery Level: 10 // 3. Audio Manager: Normal (Without In Call) when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -804,6 +807,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Left ear} // 2. Battery Level: 10 // 3. Audio Manager: Normal (Without In Call) when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -820,6 +824,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Left ear} // 2. Battery Level: 10 // 3. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -837,6 +842,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Left ear} // 2. Battery Level: 10 // 3. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -854,6 +860,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, Connected, Active, Right ear} // 2. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -869,6 +876,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, Connected, Active, Right ear} // 2. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); mCachedDevice.onActiveDeviceChanged(true, BluetoothProfile.HEARING_AID); Loading @@ -885,6 +893,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, Connected, Active, Both ear} // 2. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mSubCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); Loading @@ -903,6 +912,7 @@ public class CachedBluetoothDeviceTest { // Arrange: // 1. Profile: {HEARING_AID, Connected, Active, Both ear} // 2. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mSubCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); Loading @@ -923,6 +933,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Both ear} // 2. Battery Level: 10 // 3. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mSubCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); Loading @@ -944,6 +955,7 @@ public class CachedBluetoothDeviceTest { // 1. Profile: {HEARING_AID, Connected, Active, Both ear} // 2. Battery Level: 10 // 3. Audio Manager: In Call when(mProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); mCachedDevice.setHearingAidInfo(getRightAshaHearingAidInfo()); updateProfileStatus(mHearingAidProfile, BluetoothProfile.STATE_CONNECTED); mSubCachedDevice.setHearingAidInfo(getLeftAshaHearingAidInfo()); Loading Loading @@ -2426,7 +2438,7 @@ public class CachedBluetoothDeviceTest { assertThat(batteryLevelsInfo.getCaseBatteryLevel()).isEqualTo( Integer.parseInt(TWS_BATTERY_CASE)); assertThat(batteryLevelsInfo.getOverallBatteryLevel()).isEqualTo( Integer.parseInt(TWS_BATTERY_CASE)); Integer.parseInt(TWS_BATTERY_LEFT)); } @Test Loading