Home
last modified time | relevance | path

Searched refs:mBatteryUtils (Results 1 – 25 of 43) sorted by relevance

12

/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/
DBatteryUtilsTest.java166 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 …]
DAdvancedPowerUsageDetailTest.java131 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 …]
DBatteryStatsHelperLoaderTest.java39 private BatteryUtils mBatteryUtils; field in BatteryStatsHelperLoaderTest
54 mBatteryStatsHelperLoader.mBatteryUtils = mBatteryUtils; in setUp()
62 verify(mBatteryUtils).initBatteryStatsHelper(any(), eq(null), any()); in testLoadInBackground_loadWithoutBundle()
DHighPowerDetailTest.java57 private BatteryUtils mBatteryUtils; field in HighPowerDetailTest
67 mFragment.mBatteryUtils = mBatteryUtils; in setUp()
90 verify(mBatteryUtils).setForceAppStandby(TEST_UID, TEST_PACKAGE, in onClick_appAddedToDozeWhitelist_getsUnrestricted()
DBatteryAppListPreferenceControllerTest.java73 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()
DBackgroundActivityPreferenceControllerTest.java86 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/
DDeviceAdminAddTest.java53 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/
DAnomalyDetectionJobServiceTest.java93 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 …]
DBatteryTipLoaderTest.java67 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/
DHighUsageDetectorTest.java75 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/
DHighUsageDetector.java53 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/
DHighUsageDetector.java52 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/
DBatteryAppListPreferenceController.java77 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()
DBatteryStatsHelperLoader.java34 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/
DBatteryAppListPreferenceController.java77 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()
DBatteryStatsHelperLoader.java34 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/
DRestrictAppActionTest.java55 private BatteryUtils mBatteryUtils; field in RestrictAppActionTest
78 mRestrictAppAction.mBatteryUtils = mBatteryUtils; in setUp()
90 verify(mBatteryUtils) in testHandlePositiveAction()
92 verify(mBatteryUtils) in testHandlePositiveAction()
DUnrestrictAppActionTest.java48 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/
DUnrestrictAppAction.java35 BatteryUtils mBatteryUtils; field in UnrestrictAppAction
40 mBatteryUtils = BatteryUtils.getInstance(context); in UnrestrictAppAction()
50 mBatteryUtils.setForceAppStandby(appInfo.uid, appInfo.packageName, in handlePositiveAction()
DRestrictAppAction.java42 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/
DUnrestrictAppAction.java35 BatteryUtils mBatteryUtils; field in UnrestrictAppAction
40 mBatteryUtils = BatteryUtils.getInstance(context); in UnrestrictAppAction()
50 mBatteryUtils.setForceAppStandby(appInfo.uid, appInfo.packageName, in handlePositiveAction()
DRestrictAppAction.java42 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/
DAppBatteryPreferenceController.java59 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/
DAppBatteryPreferenceController.java59 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/
DAppBatteryPreferenceControllerTest.java68 private BatteryUtils mBatteryUtils; field in AppBatteryPreferenceControllerTest
106 mController.mBatteryUtils = mBatteryUtils; in setUp()
146 doReturn(BATTERY_LEVEL).when(mBatteryUtils).calculateBatteryPercent(anyDouble(), in updateBattery_hasBatteryStats_summaryPercent()

12