/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/ |
D | BatteryUtilsTest.java | 166 private BatteryUtils mBatteryUtils; field in BatteryUtilsTest 228 mBatteryUtils = spy(new BatteryUtils(mContext)); in setUp() 229 mBatteryUtils.mPowerUsageFeatureProvider = mProvider; in setUp() 230 doReturn(0L).when(mBatteryUtils) in setUp() 249 doReturn(TIME_STATE_FOREGROUND + 500).when(mBatteryUtils) in testGetProcessTimeMs_typeForeground_timeCorrect() 252 final long time = mBatteryUtils.getProcessTimeMs(BatteryUtils.StatusType.FOREGROUND, mUid, in testGetProcessTimeMs_typeForeground_timeCorrect() 260 final long time = mBatteryUtils.getProcessTimeMs(BatteryUtils.StatusType.BACKGROUND, mUid, in testGetProcessTimeMs_typeBackground_timeCorrect() 268 doReturn(TIME_STATE_FOREGROUND + 500).when(mBatteryUtils) in testGetProcessTimeMs_typeAll_timeCorrect() 271 final long time = mBatteryUtils.getProcessTimeMs(BatteryUtils.StatusType.ALL, mUid, in testGetProcessTimeMs_typeAll_timeCorrect() 279 final long time = mBatteryUtils.getProcessTimeMs(BatteryUtils.StatusType.ALL, null, in testGetProcessTimeMs_uidNull_returnZero() [all …]
|
D | AdvancedPowerUsageDetailTest.java | 131 private BatteryUtils mBatteryUtils; field in AdvancedPowerUsageDetailTest 187 mFragment.mBatteryUtils = new BatteryUtils(RuntimeEnvironment.application); in setUp() 195 mBatteryUtils = spy(new BatteryUtils(mContext)); in setUp() 196 doReturn(FOREGROUND_SERVICE_TIME_US).when(mBatteryUtils).getForegroundServiceTotalTimeUs( in setUp() 265 AdvancedPowerUsageDetail.startBatteryDetailPage(mActivity, mBatteryUtils, mFragment, in testStartBatteryDetailPage_hasBasicData() 282 AdvancedPowerUsageDetail.startBatteryDetailPage(mActivity, mBatteryUtils, mFragment, in testStartBatteryDetailPage_typeNotApp_hasBasicData() 298 AdvancedPowerUsageDetail.startBatteryDetailPage(mActivity, mBatteryUtils, mFragment, in testStartBatteryDetailPage_NormalApp() 308 AdvancedPowerUsageDetail.startBatteryDetailPage(mActivity, mBatteryUtils, mFragment, in testStartBatteryDetailPage_SystemApp() 321 AdvancedPowerUsageDetail.startBatteryDetailPage(mActivity, mBatteryUtils, mFragment, in testStartBatteryDetailPage_WorkApp() 334 AdvancedPowerUsageDetail.startBatteryDetailPage(mActivity, mBatteryUtils, mFragment, in testStartBatteryDetailPage_typeUser_startByCurrentUser() [all …]
|
D | BatteryStatsHelperLoaderTest.java | 39 private BatteryUtils mBatteryUtils; field in BatteryStatsHelperLoaderTest 54 mBatteryStatsHelperLoader.mBatteryUtils = mBatteryUtils; in setUp() 62 verify(mBatteryUtils).initBatteryStatsHelper(any(), eq(null), any()); in testLoadInBackground_loadWithoutBundle()
|
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_appAddedToDozeWhitelist_getsUnrestricted()
|
D | BatteryAppListPreferenceControllerTest.java | 73 private BatteryUtils mBatteryUtils; field in BatteryAppListPreferenceControllerTest 103 mPreferenceController.mBatteryUtils = mBatteryUtils; in setUp() 167 doReturn(true).when(mBatteryUtils).shouldHideSipper(mNormalBatterySipper); in testSetUsageSummary_timeMoreThanOneMinute_hiddenApp_setUsedSummary() 209 when(mBatteryUtils.isHiddenSystemModule(mNormalBatterySipper)).thenReturn(true); in testShouldHideSipper_hiddenSystemModule_returnTrue()
|
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()
|
/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 | 93 private BatteryUtils mBatteryUtils; field in AnomalyDetectionJobServiceTest 118 when(mBatteryUtils.getAppLongVersionCode(any())).thenReturn(VERSION_CODE); in setUp() 146 mUserManager, mBatteryDatabaseManager, mBatteryUtils, mPolicy, in saveAnomalyToDatabase_systemWhitelisted_doNotSave() 160 doReturn(SYSTEM_PACKAGE).when(mBatteryUtils).getPackageName(anyInt()); in saveAnomalyToDatabase_systemApp_doNotSaveButLog() 164 doReturn(true).when(mBatteryUtils).shouldHideAnomaly(any(), anyInt(), any()); in saveAnomalyToDatabase_systemApp_doNotSaveButLog() 167 mUserManager, mBatteryDatabaseManager, mBatteryUtils, mPolicy, in saveAnomalyToDatabase_systemApp_doNotSaveButLog() 187 mUserManager, mBatteryDatabaseManager, mBatteryUtils, mPolicy, in saveAnomalyToDatabase_systemUid_doNotSave() 202 mUserManager, mBatteryDatabaseManager, mBatteryUtils, mPolicy, in saveAnomalyToDatabase_uidNull_doNotSave() 216 doReturn(SYSTEM_PACKAGE).when(mBatteryUtils).getPackageName(anyInt()); in saveAnomalyToDatabase_normalAppWithAutoRestriction_save() 222 mUserManager, mBatteryDatabaseManager, mBatteryUtils, mPolicy, in saveAnomalyToDatabase_normalAppWithAutoRestriction_save() [all …]
|
D | BatteryTipLoaderTest.java | 67 private BatteryUtils mBatteryUtils; field in BatteryTipLoaderTest 81 doReturn(mBatteryInfo).when(mBatteryUtils).getBatteryInfo(any(), any()); in setUp() 83 mBatteryTipLoader.mBatteryUtils = mBatteryUtils; in setUp()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batterytip/detectors/ |
D | HighUsageDetectorTest.java | 75 private BatteryUtils mBatteryUtils; field in HighUsageDetectorTest 85 mBatteryUtils = spy(BatteryUtils.getInstance(mContext)); in setUp() 88 mHighUsageDetector.mBatteryUtils = mBatteryUtils; in setUp() 99 when(mBatteryUtils.shouldHideSipper(mSystemBatterySipper)).thenReturn(true); in setUp() 100 when(mBatteryUtils.shouldHideSipper(mHighBatterySipper)).thenReturn(false); in setUp() 101 when(mBatteryUtils.shouldHideSipper(mLowBatterySipper)).thenReturn(false); in setUp()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/fuelgauge/batterytip/detectors/ |
D | HighUsageDetector.java | 53 BatteryUtils mBatteryUtils; field in HighUsageDetector 62 mBatteryUtils = BatteryUtils.getInstance(context); in HighUsageDetector() 70 final long lastFullChargeTimeMs = mBatteryUtils.calculateLastFullChargeTime( in detect() 78 if (!mBatteryUtils.shouldHideSipper(batterySipper)) { in detect() 79 final long foregroundTimeMs = mBatteryUtils.getProcessTimeMs( in detect() 86 mBatteryUtils.getPackageName(batterySipper.getUid())) in detect()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/detectors/ |
D | HighUsageDetector.java | 52 BatteryUtils mBatteryUtils; field in HighUsageDetector 61 mBatteryUtils = BatteryUtils.getInstance(context); in HighUsageDetector() 69 final long lastFullChargeTimeMs = mBatteryUtils.calculateLastFullChargeTime( in detect() 86 final double percent = mBatteryUtils.calculateBatteryPercent( in detect() 88 if ((percent + 0.5f < 1f) || mBatteryUtils.shouldHideSipper(batterySipper)) { in detect() 95 mBatteryUtils.getPackageName(batterySipper.getUid())) in detect()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/ |
D | BatteryAppListPreferenceController.java | 77 BatteryUtils mBatteryUtils; field in BatteryAppListPreferenceController 123 mBatteryUtils = BatteryUtils.getInstance(context); in BatteryAppListPreferenceController() 164 AdvancedPowerUsageDetail.startBatteryDetailPage(mActivity, mBatteryUtils, in handlePreferenceTreeClick() 193 mBatteryUtils.removeHiddenBatterySippers(usageList); in refreshAppListGroup() 194 mBatteryUtils.sortUsageList(usageList); in refreshAppListGroup() 201 final double percentOfTotal = mBatteryUtils.calculateBatteryPercent( in refreshAppListGroup() 232 sipper.usageTimeMs = mBatteryUtils.getProcessTimeMs( in refreshAppListGroup() 334 mBatteryUtils.sortUsageList(results); in getCoalescedUsageList() 346 (sipper.drainType != DrainType.APP || mBatteryUtils.shouldHideSipper(sipper)) in setUsageSummary() 358 || mBatteryUtils.isHiddenSystemModule(sipper); in shouldHideSipper()
|
D | BatteryStatsHelperLoader.java | 34 BatteryUtils mBatteryUtils; field in BatteryStatsHelperLoader 39 mBatteryUtils = BatteryUtils.getInstance(context); in BatteryStatsHelperLoader() 47 mBatteryUtils.initBatteryStatsHelper(statsHelper, null /* bundle */, mUserManager); in loadInBackground()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/fuelgauge/ |
D | BatteryAppListPreferenceController.java | 77 BatteryUtils mBatteryUtils; field in BatteryAppListPreferenceController 123 mBatteryUtils = BatteryUtils.getInstance(context); in BatteryAppListPreferenceController() 164 AdvancedPowerUsageDetail.startBatteryDetailPage(mActivity, mBatteryUtils, in handlePreferenceTreeClick() 193 mBatteryUtils.removeHiddenBatterySippers(usageList); in refreshAppListGroup() 194 mBatteryUtils.sortUsageList(usageList); in refreshAppListGroup() 201 final double percentOfTotal = mBatteryUtils.calculateBatteryPercent( in refreshAppListGroup() 232 sipper.usageTimeMs = mBatteryUtils.getProcessTimeMs( in refreshAppListGroup() 334 mBatteryUtils.sortUsageList(results); in getCoalescedUsageList() 346 (sipper.drainType != DrainType.APP || mBatteryUtils.shouldHideSipper(sipper)) in setUsageSummary() 356 final String packageName = mBatteryUtils.getPackageName(sipper.getUid()); in shouldHideSipper()
|
D | BatteryStatsHelperLoader.java | 34 BatteryUtils mBatteryUtils; field in BatteryStatsHelperLoader 39 mBatteryUtils = BatteryUtils.getInstance(context); in BatteryStatsHelperLoader() 47 mBatteryUtils.initBatteryStatsHelper(statsHelper, null /* bundle */, mUserManager); in loadInBackground()
|
/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/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/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/src/com/android/settings/applications/appinfo/ |
D | AppBatteryPreferenceController.java | 59 BatteryUtils mBatteryUtils; field in AppBatteryPreferenceController 70 mBatteryUtils = BatteryUtils.getInstance(mContext); in AppBatteryPreferenceController() 151 final double hiddenAmount = mBatteryUtils.removeHiddenBatterySippers(usageList); in updateBattery() 152 final int percentOfMax = (int) mBatteryUtils.calculateBatteryPercent( in updateBattery()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/applications/appinfo/ |
D | AppBatteryPreferenceController.java | 59 BatteryUtils mBatteryUtils; field in AppBatteryPreferenceController 70 mBatteryUtils = BatteryUtils.getInstance(mContext); in AppBatteryPreferenceController() 151 final double hiddenAmount = mBatteryUtils.removeHiddenBatterySippers(usageList); in updateBattery() 152 final int percentOfMax = (int) mBatteryUtils.calculateBatteryPercent( in updateBattery()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/appinfo/ |
D | AppBatteryPreferenceControllerTest.java | 68 private BatteryUtils mBatteryUtils; field in AppBatteryPreferenceControllerTest 106 mController.mBatteryUtils = mBatteryUtils; in setUp() 146 doReturn(BATTERY_LEVEL).when(mBatteryUtils).calculateBatteryPercent(anyDouble(), in updateBattery_hasBatteryStats_summaryPercent()
|