@Test public void testPowerSaveMode() { when(mockPowerManager.isPowerSaveMode()).thenReturn(true); shadowApplication.sendBroadcast(new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED)); Assert.assertTrue(powerTracker.isInPowerSave()); verify(mockListener).onPowerSaveModeChanged(); reset(mockListener); when(mockPowerManager.isPowerSaveMode()).thenReturn(false); shadowApplication.sendBroadcast(new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED)); Assert.assertFalse(powerTracker.isInPowerSave()); verify(mockListener).onPowerSaveModeChanged(); }
public boolean isInPowerSave() { return mPowerManager.isPowerSaveMode(); }
PowerTracker { public boolean isInPowerSave() { return mPowerManager.isPowerSaveMode(); } }
PowerTracker { public boolean isInPowerSave() { return mPowerManager.isPowerSaveMode(); } PowerTracker(Context context, PowerManager powerManager); }
PowerTracker { public boolean isInPowerSave() { return mPowerManager.isPowerSaveMode(); } PowerTracker(Context context, PowerManager powerManager); void onBootCompleted(); void addListener(Listener listener); boolean isInPowerSave(); boolean isCharging(); boolean isDeviceIdle(); void dump(IndentingPrintWriter ipw); }
PowerTracker { public boolean isInPowerSave() { return mPowerManager.isPowerSaveMode(); } PowerTracker(Context context, PowerManager powerManager); void onBootCompleted(); void addListener(Listener listener); boolean isInPowerSave(); boolean isCharging(); boolean isDeviceIdle(); void dump(IndentingPrintWriter ipw);  }