Searched refs:mBatteryOptimizeUtils (Results 1 – 9 of 9) sorted by relevance
55 private BatteryOptimizeUtils mBatteryOptimizeUtils; field in BatteryOptimizeUtilsTest61 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 …]
125 private BatteryOptimizeUtils mBatteryOptimizeUtils; field in AdvancedPowerUsageDetailTest185 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()
52 mController.mBatteryOptimizeUtils = mockBatteryOptimizeUtils; in setUp()
53 mController.mBatteryOptimizeUtils = mockBatteryOptimizeUtils; in setUp()
38 @VisibleForTesting BatteryOptimizeUtils mBatteryOptimizeUtils; field in RestrictedPreferenceController42 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()
37 @VisibleForTesting BatteryOptimizeUtils mBatteryOptimizeUtils; field in UnrestrictedPreferenceController41 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()
37 @VisibleForTesting BatteryOptimizeUtils mBatteryOptimizeUtils; field in OptimizedPreferenceController41 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()
102 BatteryOptimizeUtils mBatteryOptimizeUtils; field in AdvancedPowerUsageDetail268 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()