Home
last modified time | relevance | path

Searched refs:mBatteryOptimizeUtils (Results 1 – 9 of 9) sorted by relevance

/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/
DBatteryOptimizeUtilsTest.java55 private BatteryOptimizeUtils mBatteryOptimizeUtils; field in BatteryOptimizeUtilsTest
61 mBatteryOptimizeUtils = spy(new BatteryOptimizeUtils(mContext, UID, PACKAGE_NAME)); in setUp()
62 mBatteryOptimizeUtils.mAppOpsManager = mockAppOpsManager; in setUp()
63 mBatteryOptimizeUtils.mBatteryUtils = mockBatteryUtils; in setUp()
64 mBatteryOptimizeUtils.mPowerAllowListBackend = mockBackend; in setUp()
73 assertThat(mBatteryOptimizeUtils.getAppUsageState()).isEqualTo(RESTRICTED); in testGetAppUsageState_returnRestricted()
82 assertThat(mBatteryOptimizeUtils.getAppUsageState()).isEqualTo(UNRESTRICTED); in testGetAppUsageState_returnUnrestricted()
91 assertThat(mBatteryOptimizeUtils.getAppUsageState()).isEqualTo(OPTIMIZED); in testGetAppUsageState_returnOptimized()
99 assertThat(mBatteryOptimizeUtils.isSystemOrDefaultApp()).isTrue(); in testIsSystemOrDefaultApp_isSystemOrDefaultApp_returnTrue()
104 assertThat(mBatteryOptimizeUtils.isSystemOrDefaultApp()).isFalse(); in testIsSystemOrDefaultApp_notSystemOrDefaultApp_returnFalse()
[all …]
DAdvancedPowerUsageDetailTest.java125 private BatteryOptimizeUtils mBatteryOptimizeUtils; field in AdvancedPowerUsageDetailTest
185 mFragment.mBatteryOptimizeUtils = mBatteryOptimizeUtils; in setUp()
734 when(mBatteryOptimizeUtils.isValidPackageName()).thenReturn(false); in testInitPreferenceForTriState_isValidPackageName_hasCorrectString()
744 when(mBatteryOptimizeUtils.isValidPackageName()).thenReturn(true); in testInitPreferenceForTriState_isSystemOrDefaultApp_hasCorrectString()
745 when(mBatteryOptimizeUtils.isSystemOrDefaultApp()).thenReturn(true); in testInitPreferenceForTriState_isSystemOrDefaultApp_hasCorrectString()
755 when(mBatteryOptimizeUtils.isValidPackageName()).thenReturn(true); in testInitPreferenceForTriState_hasCorrectString()
756 when(mBatteryOptimizeUtils.isSystemOrDefaultApp()).thenReturn(false); in testInitPreferenceForTriState_hasCorrectString()
DOptimizedPreferenceControllerTest.java52 mController.mBatteryOptimizeUtils = mockBatteryOptimizeUtils; in setUp()
DRestrictedPreferenceControllerTest.java52 mController.mBatteryOptimizeUtils = mockBatteryOptimizeUtils; in setUp()
DUnrestrictedPreferenceControllerTest.java53 mController.mBatteryOptimizeUtils = mockBatteryOptimizeUtils; in setUp()
/packages/apps/Settings/src/com/android/settings/fuelgauge/
DRestrictedPreferenceController.java38 @VisibleForTesting BatteryOptimizeUtils mBatteryOptimizeUtils; field in RestrictedPreferenceController
42 mBatteryOptimizeUtils = new BatteryOptimizeUtils(context, uid, packageName); in RestrictedPreferenceController()
48 if (!mBatteryOptimizeUtils.isValidPackageName()) { in updateState()
56 if (mBatteryOptimizeUtils.isSystemOrDefaultApp()) { in updateState()
60 } else if (mBatteryOptimizeUtils.getAppUsageState() == RESTRICTED) { in updateState()
84 mBatteryOptimizeUtils.setAppUsageState(RESTRICTED); in handlePreferenceTreeClick()
DUnrestrictedPreferenceController.java37 @VisibleForTesting BatteryOptimizeUtils mBatteryOptimizeUtils; field in UnrestrictedPreferenceController
41 mBatteryOptimizeUtils = new BatteryOptimizeUtils(context, uid, packageName); in UnrestrictedPreferenceController()
47 if (!mBatteryOptimizeUtils.isValidPackageName()) { in updateState()
55 if (mBatteryOptimizeUtils.isSystemOrDefaultApp()) { in updateState()
58 } else if (mBatteryOptimizeUtils.getAppUsageState() == UNRESTRICTED) { in updateState()
82 mBatteryOptimizeUtils.setAppUsageState(UNRESTRICTED); in handlePreferenceTreeClick()
DOptimizedPreferenceController.java37 @VisibleForTesting BatteryOptimizeUtils mBatteryOptimizeUtils; field in OptimizedPreferenceController
41 mBatteryOptimizeUtils = new BatteryOptimizeUtils(context, uid, packageName); in OptimizedPreferenceController()
51 if (!mBatteryOptimizeUtils.isValidPackageName()) { in updateState()
58 if (mBatteryOptimizeUtils.isSystemOrDefaultApp()) { in updateState()
62 } else if (mBatteryOptimizeUtils.getAppUsageState() == OPTIMIZED) { in updateState()
81 mBatteryOptimizeUtils.setAppUsageState(OPTIMIZED); in handlePreferenceTreeClick()
DAdvancedPowerUsageDetail.java102 BatteryOptimizeUtils mBatteryOptimizeUtils; field in AdvancedPowerUsageDetail
268 final String packageName = mBatteryOptimizeUtils.getPackageName(); in onResume()
342 if (!mBatteryOptimizeUtils.isValidPackageName()) { in initPreferenceForTriState()
347 } else if (mBatteryOptimizeUtils.isSystemOrDefaultApp()) { in initPreferenceForTriState()
449 mBatteryOptimizeUtils.getPackageName()), in onRadioButtonClicked()
468 mBatteryOptimizeUtils = new BatteryOptimizeUtils( in onCreateForTriState()