Loading packages/SystemUI/Android.bp +4 −16 Original line number Diff line number Diff line Loading @@ -276,8 +276,6 @@ filegroup { filegroup { name: "SystemUI-tests-broken-robofiles-compile", srcs: [ "tests/src/**/*DeviceOnlyTest.java", "tests/src/**/*DeviceOnlyTest.kt", "tests/src/**/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiverTest.kt", "tests/src/**/systemui/accessibility/data/repository/AccessibilityQsShortcutsRepositoryImplForDeviceTest.kt", "tests/src/**/systemui/biometrics/AuthDialogPanelInteractionDetectorTest.kt", Loading @@ -293,7 +291,6 @@ filegroup { "tests/src/**/systemui/keyguard/ResourceTrimmerTest.kt", "tests/src/**/systemui/keyguard/ui/viewmodel/KeyguardBottomAreaViewModelTest.kt", "tests/src/**/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt", "tests/src/**/systemui/media/controls/domain/pipeline/MediaTimeoutListenerTest.kt", "tests/src/**/systemui/media/controls/ui/controller/MediaHierarchyManagerTest.kt", "tests/src/**/systemui/mediaprojection/taskswitcher/MediaProjectionTaskSwitcherCoreStartableTest.kt", "tests/src/**/systemui/media/taptotransfer/receiver/FakeMediaTttChipControllerReceiver.kt", Loading @@ -303,14 +300,12 @@ filegroup { "tests/src/**/systemui/screenshot/ActionIntentCreatorTest.kt", "tests/src/**/systemui/screenshot/DefaultScreenshotActionsProviderTest.kt", "tests/src/**/systemui/screenshot/TakeScreenshotServiceTest.kt", "tests/src/**/systemui/statusbar/commandline/CommandRegistryTest.kt", "tests/src/**/systemui/statusbar/notification/collection/TargetSdkResolverTest.kt", "tests/src/**/systemui/statusbar/notification/icon/IconManagerTest.kt", "tests/src/**/systemui/statusbar/notification/row/BigPictureIconManagerTest.kt", "tests/src/**/systemui/statusbar/notification/row/NotificationSettingsControllerTest.kt", "tests/src/**/systemui/statusbar/notification/stack/ui/view/NotificationStatsLoggerTest.kt", "tests/src/**/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImplTest.kt", "tests/src/**/systemui/statusbar/policy/BatteryStateNotifierTest.kt", "tests/src/**/systemui/statusbar/policy/FlashlightControllerImplTest.kt", "tests/src/**/systemui/statusbar/policy/SensitiveNotificationProtectionControllerFlagDisabledTest.kt", "tests/src/**/systemui/stylus/StylusUsiPowerStartableTest.kt", Loading Loading @@ -449,27 +444,20 @@ filegroup { "tests/src/**/systemui/media/dialog/MediaSwitchingControllerTest.java", "tests/src/**/systemui/navigationbar/views/NavigationBarTest.java", "tests/src/**/systemui/power/PowerNotificationWarningsTest.java", "tests/src/**/systemui/power/PowerUITest.java", "tests/src/**/systemui/qs/QSFooterViewControllerTest.java", "tests/src/**/systemui/qs/QSImplTest.java", "tests/src/**/systemui/qs/QSSecurityFooterTest.java", "tests/src/**/systemui/qs/tileimpl/QSTileImplTest.java", "tests/src/**/systemui/qs/tiles/QuickAccessWalletTileTest.java", "tests/src/**/systemui/shade/carrier/ShadeCarrierGroupControllerTest.java", "tests/src/**/systemui/shared/plugins/PluginActionManagerTest.java", "tests/src/**/systemui/statusbar/CommandQueueTest.java", "tests/src/**/systemui/statusbar/connectivity/CallbackHandlerTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerBaseTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerDataTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerEthernetTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerSignalTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerWifiTest.java", "tests/src/**/systemui/statusbar/KeyguardIndicationControllerTest.java", "tests/src/**/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java", "tests/src/**/systemui/statusbar/phone/ScrimControllerTest.java", "tests/src/**/systemui/statusbar/policy/RotationLockControllerImplTest.java", "tests/src/**/systemui/statusbar/policy/SecurityControllerTest.java", "tests/src/**/systemui/toast/ToastUITest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerDataTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerEthernetTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerSignalTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerWifiTest.java", ], visibility: ["//visibility:private"], } Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityControllerTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -16,11 +16,11 @@ package com.android.systemui.keyguard; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.argThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; Loading packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListenerTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -38,11 +38,11 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentCaptor import org.mockito.ArgumentMatchers import org.mockito.ArgumentMatchers.anyBoolean import org.mockito.ArgumentMatchers.anyString import org.mockito.Captor import org.mockito.Mock import org.mockito.Mockito import org.mockito.Mockito.clearInvocations import org.mockito.Mockito.mock import org.mockito.Mockito.never Loading @@ -61,7 +61,7 @@ private const val SESSION_TITLE = "SESSION_TITLE" private const val SMARTSPACE_KEY = "SMARTSPACE_KEY" private fun <T> anyObject(): T { return Mockito.anyObject<T>() return ArgumentMatchers.any<T>() } @SmallTest Loading packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; import static org.mockito.Matchers.eq; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.mock; Loading packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java +19 −20 Original line number Diff line number Diff line Loading @@ -19,9 +19,8 @@ import static android.provider.Settings.Global.SHOW_USB_TEMPERATURE_ALARM; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.anyObject; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; Loading Loading @@ -194,7 +193,7 @@ public class PowerUITest extends SysuiTestCase { TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_SKIN)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_SKIN)); } @Test Loading @@ -207,7 +206,7 @@ public class PowerUITest extends SysuiTestCase { TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_USB_PORT)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_USB_PORT)); } @Test Loading @@ -220,7 +219,7 @@ public class PowerUITest extends SysuiTestCase { TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(0)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_SKIN)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_SKIN)); } @Test Loading @@ -233,7 +232,7 @@ public class PowerUITest extends SysuiTestCase { TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(0)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_USB_PORT)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_USB_PORT)); } @Test Loading @@ -243,14 +242,14 @@ public class PowerUITest extends SysuiTestCase { // success registering skin thermal event listener when(mThermalServiceMock.registerThermalEventListenerWithType( anyObject(), eq(Temperature.TYPE_SKIN))).thenReturn(true); any(), eq(Temperature.TYPE_SKIN))).thenReturn(true); mPowerUI.doSkinThermalEventListenerRegistration(); // verify registering skin thermal event listener, return true (success) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_SKIN)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_SKIN)); // Settings SHOW_TEMPERATURE_WARNING is set to 0 Settings.Global.putInt(mContext.getContentResolver(), SHOW_TEMPERATURE_WARNING, 0); Loading @@ -259,7 +258,7 @@ public class PowerUITest extends SysuiTestCase { // verify unregistering skin thermal event listener TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)).unregisterThermalEventListener(anyObject()); verify(mThermalServiceMock, times(1)).unregisterThermalEventListener(any()); } @Test Loading @@ -269,14 +268,14 @@ public class PowerUITest extends SysuiTestCase { // fail registering skin thermal event listener when(mThermalServiceMock.registerThermalEventListenerWithType( anyObject(), eq(Temperature.TYPE_SKIN))).thenReturn(false); any(), eq(Temperature.TYPE_SKIN))).thenReturn(false); mPowerUI.doSkinThermalEventListenerRegistration(); // verify registering skin thermal event listener, return false (fail) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_SKIN)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_SKIN)); // Settings SHOW_TEMPERATURE_WARNING is set to 0 Settings.Global.putInt(mContext.getContentResolver(), SHOW_TEMPERATURE_WARNING, 0); Loading @@ -285,7 +284,7 @@ public class PowerUITest extends SysuiTestCase { // verify that cannot unregister listener (current state is unregistered) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(0)).unregisterThermalEventListener(anyObject()); verify(mThermalServiceMock, times(0)).unregisterThermalEventListener(any()); // Settings SHOW_TEMPERATURE_WARNING is set to 1 Settings.Global.putInt(mContext.getContentResolver(), SHOW_TEMPERATURE_WARNING, 1); Loading @@ -295,7 +294,7 @@ public class PowerUITest extends SysuiTestCase { // verify that can register listener (current state is unregistered) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(2)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_SKIN)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_SKIN)); } @Test Loading @@ -305,14 +304,14 @@ public class PowerUITest extends SysuiTestCase { // success registering usb thermal event listener when(mThermalServiceMock.registerThermalEventListenerWithType( anyObject(), eq(Temperature.TYPE_USB_PORT))).thenReturn(true); any(), eq(Temperature.TYPE_USB_PORT))).thenReturn(true); mPowerUI.doUsbThermalEventListenerRegistration(); // verify registering usb thermal event listener, return true (success) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_USB_PORT)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_USB_PORT)); // Settings SHOW_USB_TEMPERATURE_ALARM is set to 0 Settings.Global.putInt(mContext.getContentResolver(), SHOW_USB_TEMPERATURE_ALARM, 0); Loading @@ -320,7 +319,7 @@ public class PowerUITest extends SysuiTestCase { // verify unregistering usb thermal event listener mPowerUI.doUsbThermalEventListenerRegistration(); TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)).unregisterThermalEventListener(anyObject()); verify(mThermalServiceMock, times(1)).unregisterThermalEventListener(any()); } @Test Loading @@ -330,14 +329,14 @@ public class PowerUITest extends SysuiTestCase { // fail registering usb thermal event listener when(mThermalServiceMock.registerThermalEventListenerWithType( anyObject(), eq(Temperature.TYPE_USB_PORT))).thenReturn(false); any(), eq(Temperature.TYPE_USB_PORT))).thenReturn(false); mPowerUI.doUsbThermalEventListenerRegistration(); // verify registering usb thermal event listener, return false (fail) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_USB_PORT)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_USB_PORT)); // Settings SHOW_USB_TEMPERATURE_ALARM is set to 0 Settings.Global.putInt(mContext.getContentResolver(), SHOW_USB_TEMPERATURE_ALARM, 0); Loading @@ -346,7 +345,7 @@ public class PowerUITest extends SysuiTestCase { // verify that cannot unregister listener (current state is unregistered) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(0)).unregisterThermalEventListener(anyObject()); verify(mThermalServiceMock, times(0)).unregisterThermalEventListener(any()); // Settings SHOW_USB_TEMPERATURE_ALARM is set to 1 Settings.Global.putInt(mContext.getContentResolver(), SHOW_USB_TEMPERATURE_ALARM, 1); Loading @@ -356,7 +355,7 @@ public class PowerUITest extends SysuiTestCase { // verify that can register listener (current state is unregistered) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(2)).registerThermalEventListenerWithType( anyObject(), eq(Temperature.TYPE_USB_PORT)); any(), eq(Temperature.TYPE_USB_PORT)); } @Test Loading Loading
packages/SystemUI/Android.bp +4 −16 Original line number Diff line number Diff line Loading @@ -276,8 +276,6 @@ filegroup { filegroup { name: "SystemUI-tests-broken-robofiles-compile", srcs: [ "tests/src/**/*DeviceOnlyTest.java", "tests/src/**/*DeviceOnlyTest.kt", "tests/src/**/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiverTest.kt", "tests/src/**/systemui/accessibility/data/repository/AccessibilityQsShortcutsRepositoryImplForDeviceTest.kt", "tests/src/**/systemui/biometrics/AuthDialogPanelInteractionDetectorTest.kt", Loading @@ -293,7 +291,6 @@ filegroup { "tests/src/**/systemui/keyguard/ResourceTrimmerTest.kt", "tests/src/**/systemui/keyguard/ui/viewmodel/KeyguardBottomAreaViewModelTest.kt", "tests/src/**/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt", "tests/src/**/systemui/media/controls/domain/pipeline/MediaTimeoutListenerTest.kt", "tests/src/**/systemui/media/controls/ui/controller/MediaHierarchyManagerTest.kt", "tests/src/**/systemui/mediaprojection/taskswitcher/MediaProjectionTaskSwitcherCoreStartableTest.kt", "tests/src/**/systemui/media/taptotransfer/receiver/FakeMediaTttChipControllerReceiver.kt", Loading @@ -303,14 +300,12 @@ filegroup { "tests/src/**/systemui/screenshot/ActionIntentCreatorTest.kt", "tests/src/**/systemui/screenshot/DefaultScreenshotActionsProviderTest.kt", "tests/src/**/systemui/screenshot/TakeScreenshotServiceTest.kt", "tests/src/**/systemui/statusbar/commandline/CommandRegistryTest.kt", "tests/src/**/systemui/statusbar/notification/collection/TargetSdkResolverTest.kt", "tests/src/**/systemui/statusbar/notification/icon/IconManagerTest.kt", "tests/src/**/systemui/statusbar/notification/row/BigPictureIconManagerTest.kt", "tests/src/**/systemui/statusbar/notification/row/NotificationSettingsControllerTest.kt", "tests/src/**/systemui/statusbar/notification/stack/ui/view/NotificationStatsLoggerTest.kt", "tests/src/**/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImplTest.kt", "tests/src/**/systemui/statusbar/policy/BatteryStateNotifierTest.kt", "tests/src/**/systemui/statusbar/policy/FlashlightControllerImplTest.kt", "tests/src/**/systemui/statusbar/policy/SensitiveNotificationProtectionControllerFlagDisabledTest.kt", "tests/src/**/systemui/stylus/StylusUsiPowerStartableTest.kt", Loading Loading @@ -449,27 +444,20 @@ filegroup { "tests/src/**/systemui/media/dialog/MediaSwitchingControllerTest.java", "tests/src/**/systemui/navigationbar/views/NavigationBarTest.java", "tests/src/**/systemui/power/PowerNotificationWarningsTest.java", "tests/src/**/systemui/power/PowerUITest.java", "tests/src/**/systemui/qs/QSFooterViewControllerTest.java", "tests/src/**/systemui/qs/QSImplTest.java", "tests/src/**/systemui/qs/QSSecurityFooterTest.java", "tests/src/**/systemui/qs/tileimpl/QSTileImplTest.java", "tests/src/**/systemui/qs/tiles/QuickAccessWalletTileTest.java", "tests/src/**/systemui/shade/carrier/ShadeCarrierGroupControllerTest.java", "tests/src/**/systemui/shared/plugins/PluginActionManagerTest.java", "tests/src/**/systemui/statusbar/CommandQueueTest.java", "tests/src/**/systemui/statusbar/connectivity/CallbackHandlerTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerBaseTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerDataTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerEthernetTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerSignalTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerWifiTest.java", "tests/src/**/systemui/statusbar/KeyguardIndicationControllerTest.java", "tests/src/**/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java", "tests/src/**/systemui/statusbar/phone/ScrimControllerTest.java", "tests/src/**/systemui/statusbar/policy/RotationLockControllerImplTest.java", "tests/src/**/systemui/statusbar/policy/SecurityControllerTest.java", "tests/src/**/systemui/toast/ToastUITest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerDataTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerEthernetTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerSignalTest.java", "tests/src/**/systemui/statusbar/connectivity/NetworkControllerWifiTest.java", ], visibility: ["//visibility:private"], } Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityControllerTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -16,11 +16,11 @@ package com.android.systemui.keyguard; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.argThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; Loading
packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListenerTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -38,11 +38,11 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentCaptor import org.mockito.ArgumentMatchers import org.mockito.ArgumentMatchers.anyBoolean import org.mockito.ArgumentMatchers.anyString import org.mockito.Captor import org.mockito.Mock import org.mockito.Mockito import org.mockito.Mockito.clearInvocations import org.mockito.Mockito.mock import org.mockito.Mockito.never Loading @@ -61,7 +61,7 @@ private const val SESSION_TITLE = "SESSION_TITLE" private const val SMARTSPACE_KEY = "SMARTSPACE_KEY" private fun <T> anyObject(): T { return Mockito.anyObject<T>() return ArgumentMatchers.any<T>() } @SmallTest Loading
packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; import static org.mockito.Matchers.eq; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.mock; Loading
packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java +19 −20 Original line number Diff line number Diff line Loading @@ -19,9 +19,8 @@ import static android.provider.Settings.Global.SHOW_USB_TEMPERATURE_ALARM; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.anyObject; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; Loading Loading @@ -194,7 +193,7 @@ public class PowerUITest extends SysuiTestCase { TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_SKIN)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_SKIN)); } @Test Loading @@ -207,7 +206,7 @@ public class PowerUITest extends SysuiTestCase { TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_USB_PORT)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_USB_PORT)); } @Test Loading @@ -220,7 +219,7 @@ public class PowerUITest extends SysuiTestCase { TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(0)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_SKIN)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_SKIN)); } @Test Loading @@ -233,7 +232,7 @@ public class PowerUITest extends SysuiTestCase { TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(0)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_USB_PORT)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_USB_PORT)); } @Test Loading @@ -243,14 +242,14 @@ public class PowerUITest extends SysuiTestCase { // success registering skin thermal event listener when(mThermalServiceMock.registerThermalEventListenerWithType( anyObject(), eq(Temperature.TYPE_SKIN))).thenReturn(true); any(), eq(Temperature.TYPE_SKIN))).thenReturn(true); mPowerUI.doSkinThermalEventListenerRegistration(); // verify registering skin thermal event listener, return true (success) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_SKIN)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_SKIN)); // Settings SHOW_TEMPERATURE_WARNING is set to 0 Settings.Global.putInt(mContext.getContentResolver(), SHOW_TEMPERATURE_WARNING, 0); Loading @@ -259,7 +258,7 @@ public class PowerUITest extends SysuiTestCase { // verify unregistering skin thermal event listener TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)).unregisterThermalEventListener(anyObject()); verify(mThermalServiceMock, times(1)).unregisterThermalEventListener(any()); } @Test Loading @@ -269,14 +268,14 @@ public class PowerUITest extends SysuiTestCase { // fail registering skin thermal event listener when(mThermalServiceMock.registerThermalEventListenerWithType( anyObject(), eq(Temperature.TYPE_SKIN))).thenReturn(false); any(), eq(Temperature.TYPE_SKIN))).thenReturn(false); mPowerUI.doSkinThermalEventListenerRegistration(); // verify registering skin thermal event listener, return false (fail) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_SKIN)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_SKIN)); // Settings SHOW_TEMPERATURE_WARNING is set to 0 Settings.Global.putInt(mContext.getContentResolver(), SHOW_TEMPERATURE_WARNING, 0); Loading @@ -285,7 +284,7 @@ public class PowerUITest extends SysuiTestCase { // verify that cannot unregister listener (current state is unregistered) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(0)).unregisterThermalEventListener(anyObject()); verify(mThermalServiceMock, times(0)).unregisterThermalEventListener(any()); // Settings SHOW_TEMPERATURE_WARNING is set to 1 Settings.Global.putInt(mContext.getContentResolver(), SHOW_TEMPERATURE_WARNING, 1); Loading @@ -295,7 +294,7 @@ public class PowerUITest extends SysuiTestCase { // verify that can register listener (current state is unregistered) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(2)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_SKIN)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_SKIN)); } @Test Loading @@ -305,14 +304,14 @@ public class PowerUITest extends SysuiTestCase { // success registering usb thermal event listener when(mThermalServiceMock.registerThermalEventListenerWithType( anyObject(), eq(Temperature.TYPE_USB_PORT))).thenReturn(true); any(), eq(Temperature.TYPE_USB_PORT))).thenReturn(true); mPowerUI.doUsbThermalEventListenerRegistration(); // verify registering usb thermal event listener, return true (success) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_USB_PORT)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_USB_PORT)); // Settings SHOW_USB_TEMPERATURE_ALARM is set to 0 Settings.Global.putInt(mContext.getContentResolver(), SHOW_USB_TEMPERATURE_ALARM, 0); Loading @@ -320,7 +319,7 @@ public class PowerUITest extends SysuiTestCase { // verify unregistering usb thermal event listener mPowerUI.doUsbThermalEventListenerRegistration(); TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)).unregisterThermalEventListener(anyObject()); verify(mThermalServiceMock, times(1)).unregisterThermalEventListener(any()); } @Test Loading @@ -330,14 +329,14 @@ public class PowerUITest extends SysuiTestCase { // fail registering usb thermal event listener when(mThermalServiceMock.registerThermalEventListenerWithType( anyObject(), eq(Temperature.TYPE_USB_PORT))).thenReturn(false); any(), eq(Temperature.TYPE_USB_PORT))).thenReturn(false); mPowerUI.doUsbThermalEventListenerRegistration(); // verify registering usb thermal event listener, return false (fail) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(1)) .registerThermalEventListenerWithType(anyObject(), eq(Temperature.TYPE_USB_PORT)); .registerThermalEventListenerWithType(any(), eq(Temperature.TYPE_USB_PORT)); // Settings SHOW_USB_TEMPERATURE_ALARM is set to 0 Settings.Global.putInt(mContext.getContentResolver(), SHOW_USB_TEMPERATURE_ALARM, 0); Loading @@ -346,7 +345,7 @@ public class PowerUITest extends SysuiTestCase { // verify that cannot unregister listener (current state is unregistered) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(0)).unregisterThermalEventListener(anyObject()); verify(mThermalServiceMock, times(0)).unregisterThermalEventListener(any()); // Settings SHOW_USB_TEMPERATURE_ALARM is set to 1 Settings.Global.putInt(mContext.getContentResolver(), SHOW_USB_TEMPERATURE_ALARM, 1); Loading @@ -356,7 +355,7 @@ public class PowerUITest extends SysuiTestCase { // verify that can register listener (current state is unregistered) TestableLooper.get(this).processAllMessages(); verify(mThermalServiceMock, times(2)).registerThermalEventListenerWithType( anyObject(), eq(Temperature.TYPE_USB_PORT)); any(), eq(Temperature.TYPE_USB_PORT)); } @Test Loading