/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/ |
D | BatteryUtilsTest.java | 136 private BatteryUtils mBatteryUtils; field in BatteryUtilsTest 171 mBatteryUtils = spy(new BatteryUtils(mContext)); in setUp() 172 mBatteryUtils.mPowerUsageFeatureProvider = mProvider; in setUp() 173 doReturn(0L).when(mBatteryUtils) in setUp() 183 doReturn(TIME_STATE_FOREGROUND + 500).when(mBatteryUtils) in testGetProcessTimeMs_typeForeground_timeCorrect() 186 final long time = mBatteryUtils.getProcessTimeMs(BatteryUtils.StatusType.FOREGROUND, mUid, in testGetProcessTimeMs_typeForeground_timeCorrect() 194 final long time = mBatteryUtils.getProcessTimeMs(BatteryUtils.StatusType.BACKGROUND, mUid, in testGetProcessTimeMs_typeBackground_timeCorrect() 202 doReturn(TIME_STATE_FOREGROUND + 500).when(mBatteryUtils) in testGetProcessTimeMs_typeAll_timeCorrect() 205 final long time = mBatteryUtils.getProcessTimeMs(BatteryUtils.StatusType.ALL, mUid, in testGetProcessTimeMs_typeAll_timeCorrect() 213 final long time = mBatteryUtils.getProcessTimeMs(BatteryUtils.StatusType.ALL, null, in testGetProcessTimeMs_uidNull_returnZero() [all …]
|
D | HighPowerDetailTest.java | 57 private BatteryUtils mBatteryUtils; field in HighPowerDetailTest 67 mFragment.mBatteryUtils = mBatteryUtils; in setUp() 90 verify(mBatteryUtils).setForceAppStandby(TEST_UID, TEST_PACKAGE, in onClick_appAddedToDozeAllowlist_getsUnrestricted()
|
D | BackgroundActivityPreferenceControllerTest.java | 86 private BatteryUtils mBatteryUtils; field in BackgroundActivityPreferenceControllerTest 110 mBatteryUtils = spy(new BatteryUtils(mShadowContext)); in setUp() 111 doNothing().when(mBatteryUtils).setForceAppStandby(anyInt(), anyString(), anyInt()); in setUp() 118 mController.mBatteryUtils = mBatteryUtils; in setUp()
|
D | BatteryAppListPreferenceControllerTest.java | 59 private BatteryUtils mBatteryUtils; field in BatteryAppListPreferenceControllerTest 90 mPreferenceController.mBatteryUtils = mBatteryUtils; in setUp()
|
D | RestrictedAppDetailsTest.java | 114 mRestrictedAppDetails.mBatteryUtils = spy(new BatteryUtils(mContext)); in setUp() 128 doReturn(true).when(mRestrictedAppDetails.mBatteryUtils).isForceAppStandbyEnabled(UID, in refreshUi_displayPreference()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/specialaccess/deviceadmin/ |
D | DeviceAdminAddTest.java | 53 private BatteryUtils mBatteryUtils; field in DeviceAdminAddTest 61 mBatteryUtils = spy(BatteryUtils.getInstance(RuntimeEnvironment.application)); in setUp() 62 doNothing().when(mBatteryUtils).setForceAppStandby(anyInt(), anyString(), anyInt()); in setUp() 66 doReturn(UID).when(mBatteryUtils).getPackageUid(PACKAGE_NAME); in setUp() 92 doReturn(true).when(mBatteryUtils).isForceAppStandbyEnabled(UID, PACKAGE_NAME); in unrestrictAppIfPossible_appRestricted_unrestrictApp() 94 mDeviceAdminAdd.unrestrictAppIfPossible(mBatteryUtils); in unrestrictAppIfPossible_appRestricted_unrestrictApp() 96 verify(mBatteryUtils).setForceAppStandby(UID, PACKAGE_NAME, AppOpsManager.MODE_ALLOWED); in unrestrictAppIfPossible_appRestricted_unrestrictApp() 101 doReturn(false).when(mBatteryUtils).isForceAppStandbyEnabled(UID, PACKAGE_NAME); in unrestrictAppIfPossible_appUnrestricted_doNothing() 103 mDeviceAdminAdd.unrestrictAppIfPossible(mBatteryUtils); in unrestrictAppIfPossible_appUnrestricted_doNothing() 105 verify(mBatteryUtils, never()).setForceAppStandby(UID, PACKAGE_NAME, in unrestrictAppIfPossible_appUnrestricted_doNothing()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batterytip/ |
D | AnomalyDetectionJobServiceTest.java | 94 private BatteryUtils mBatteryUtils; field in AnomalyDetectionJobServiceTest 123 when(mBatteryUtils.getAppLongVersionCode(any())).thenReturn(VERSION_CODE); in setUp() 151 mUserManager, mBatteryDatabaseManager, mBatteryUtils, mPolicy, in saveAnomalyToDatabase_systemAllowlisted_doNotSave() 165 doReturn(SYSTEM_PACKAGE).when(mBatteryUtils).getPackageName(anyInt()); in saveAnomalyToDatabase_systemApp_doNotSaveButLog() 169 doReturn(true).when(mBatteryUtils).shouldHideAnomaly(any(), anyInt(), any()); in saveAnomalyToDatabase_systemApp_doNotSaveButLog() 172 mUserManager, mBatteryDatabaseManager, mBatteryUtils, mPolicy, in saveAnomalyToDatabase_systemApp_doNotSaveButLog() 192 mUserManager, mBatteryDatabaseManager, mBatteryUtils, mPolicy, in saveAnomalyToDatabase_systemUid_doNotSave() 207 mUserManager, mBatteryDatabaseManager, mBatteryUtils, mPolicy, in saveAnomalyToDatabase_uidNull_doNotSave() 221 doReturn(SYSTEM_PACKAGE).when(mBatteryUtils).getPackageName(anyInt()); in saveAnomalyToDatabase_normalAppWithAutoRestriction_save() 227 mUserManager, mBatteryDatabaseManager, mBatteryUtils, mPolicy, in saveAnomalyToDatabase_normalAppWithAutoRestriction_save() [all …]
|
D | BatteryTipLoaderTest.java | 65 private BatteryUtils mBatteryUtils; field in BatteryTipLoaderTest 79 doReturn(mBatteryInfo).when(mBatteryUtils).getBatteryInfo(any()); in setUp() 81 mBatteryTipLoader.mBatteryUtils = mBatteryUtils; in setUp()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/ |
D | BatteryOptimizeUtils.java | 33 @VisibleForTesting BatteryUtils mBatteryUtils; field in BatteryOptimizeUtils 55 mBatteryUtils = BatteryUtils.getInstance(context); in BatteryOptimizeUtils() 79 mBatteryUtils.setForceAppStandby(mUid, mPackageName, AppOpsManager.MODE_IGNORED); in setAppUsageState() 83 mBatteryUtils.setForceAppStandby(mUid, mPackageName, AppOpsManager.MODE_ALLOWED); in setAppUsageState() 87 mBatteryUtils.setForceAppStandby(mUid, mPackageName, AppOpsManager.MODE_ALLOWED); in setAppUsageState() 99 return mBatteryUtils.getPackageUid(mPackageName) != BatteryUtils.UID_NULL; in isValidPackageName()
|
D | BatteryInfoLoader.java | 33 BatteryUtils mBatteryUtils; field in BatteryInfoLoader 37 mBatteryUtils = BatteryUtils.getInstance(context); in BatteryInfoLoader() 47 return mBatteryUtils.getBatteryInfo(LOG_TAG); in loadInBackground()
|
D | BatteryAppListPreferenceController.java | 78 BatteryUtils mBatteryUtils; field in BatteryAppListPreferenceController 147 mBatteryUtils = BatteryUtils.getInstance(context); in BatteryAppListPreferenceController() 222 final double percentOfTotal = mBatteryUtils.calculateBatteryPercent( in refreshAppListGroup() 279 final double percentOfTotal = mBatteryUtils.calculateBatteryPercent( in getBatteryEntryList() 319 if (mBatteryUtils.shouldHideUidBatteryConsumerUnconditionally(consumer, packages)) { in getCoalescedUsageList() 323 final boolean isHidden = mBatteryUtils.shouldHideUidBatteryConsumer(consumer, packages); in getCoalescedUsageList() 348 && mBatteryUtils.shouldHideDevicePowerComponent(deviceConsumer, componentId)) { in getCoalescedUsageList()
|
D | HighPowerDetail.java | 51 BatteryUtils mBatteryUtils; field in HighPowerDetail 72 mBatteryUtils = BatteryUtils.getInstance(context); in onCreate() 144 mBatteryUtils.setForceAppStandby(mPackageUid, mPackageName, in onClick()
|
D | RestrictedAppDetails.java | 75 BatteryUtils mBatteryUtils; field in RestrictedAppDetails 105 mBatteryUtils = BatteryUtils.getInstance(context); in onCreate() 158 mBatteryUtils.isForceAppStandbyEnabled(appInfo.uid, appInfo.packageName)); in refreshUi()
|
D | BackgroundActivityPreferenceController.java | 54 BatteryUtils mBatteryUtils; field in BackgroundActivityPreferenceController 75 mBatteryUtils = BatteryUtils.getInstance(context); in BackgroundActivityPreferenceController()
|
D | PowerUsageSummary.java | 70 BatteryUtils mBatteryUtils; field in PowerUsageSummary 164 mBatteryUtils = BatteryUtils.getInstance(getContext()); in onCreate()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/detectors/ |
D | HighUsageDetector.java | 51 BatteryUtils mBatteryUtils; field in HighUsageDetector 61 mBatteryUtils = BatteryUtils.getInstance(context); in HighUsageDetector() 69 final long lastFullChargeTimeMs = mBatteryUtils.calculateLastFullChargeTime( in detect() 83 final double percent = mBatteryUtils.calculateBatteryPercent( in detect() 86 || mBatteryUtils.shouldHideUidBatteryConsumer(consumer)) { in detect() 94 mBatteryUtils.getPackageName(consumer.getUid())) in detect()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/ |
D | HighUsageDetectorTest.java | 81 private BatteryUtils mBatteryUtils; field in HighUsageDetectorTest 90 mBatteryUtils = spy(new BatteryUtils(mContext)); in setUp() 101 mBatteryUtils.getBatteryInfo(TAG))); in setUp() 102 mHighUsageDetector.mBatteryUtils = mBatteryUtils; in setUp() 109 doReturn(false).when(mBatteryUtils).shouldHideUidBatteryConsumer(mHighBatteryConsumer); in setUp() 110 doReturn(false).when(mBatteryUtils).shouldHideUidBatteryConsumer(mLowBatteryConsumer); in setUp()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batterytip/actions/ |
D | RestrictAppActionTest.java | 55 private BatteryUtils mBatteryUtils; field in RestrictAppActionTest 78 mRestrictAppAction.mBatteryUtils = mBatteryUtils; in setUp() 90 verify(mBatteryUtils) in testHandlePositiveAction() 92 verify(mBatteryUtils) in testHandlePositiveAction()
|
D | UnrestrictAppActionTest.java | 48 private BatteryUtils mBatteryUtils; field in UnrestrictAppActionTest 64 mUnrestrictAppAction.mBatteryUtils = mBatteryUtils; in setUp() 76 verify(mBatteryUtils) in testHandlePositiveAction()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/actions/ |
D | UnrestrictAppAction.java | 35 BatteryUtils mBatteryUtils; field in UnrestrictAppAction 40 mBatteryUtils = BatteryUtils.getInstance(context); in UnrestrictAppAction() 50 mBatteryUtils.setForceAppStandby(appInfo.uid, appInfo.packageName, in handlePositiveAction()
|
D | RestrictAppAction.java | 42 BatteryUtils mBatteryUtils; field in RestrictAppAction 47 mBatteryUtils = BatteryUtils.getInstance(context); in RestrictAppAction() 62 mBatteryUtils.setForceAppStandby(appInfo.uid, packageName, in handlePositiveAction()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/appinfo/ |
D | AppBatteryPreferenceControllerTest.java | 67 private BatteryUtils mBatteryUtils; field in AppBatteryPreferenceControllerTest 107 mController.mBatteryUtils = mBatteryUtils; in setUp() 147 doReturn(BATTERY_LEVEL).when(mBatteryUtils).calculateBatteryPercent(anyDouble(), in updateBattery_hasBatteryStats_summaryPercent()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/ |
D | BatteryTipLoader.java | 52 BatteryUtils mBatteryUtils; field in BatteryTipLoader 57 mBatteryUtils = BatteryUtils.getInstance(context); in BatteryTipLoader() 67 final BatteryInfo batteryInfo = mBatteryUtils.getBatteryInfo(TAG); in loadInBackground()
|
/packages/apps/Settings/src/com/android/settings/applications/appinfo/ |
D | AppBatteryPreferenceController.java | 66 BatteryUtils mBatteryUtils; field in AppBatteryPreferenceController 89 mBatteryUtils = BatteryUtils.getInstance(mContext); in AppBatteryPreferenceController() 274 final int percentOfMax = (int) mBatteryUtils.calculateBatteryPercent(
|
/packages/apps/Settings/src/com/android/settings/applications/defaultapps/ |
D | DefaultAppPickerFragment.java | 46 protected BatteryUtils mBatteryUtils; field in DefaultAppPickerFragment 52 mBatteryUtils = BatteryUtils.getInstance(context); in onAttach()
|