Extract method getBatteryInfo() from loader
In battery tips, we need synchronized method to get batteryInfo. This cl move the logic to BatteryUtils, then in battery tips we could use this method directly. Bug: 70570352 Test: robotest still pass Change-Id: Id69349a25395ae472a9b3152c6f04127ee32c4e1
This commit is contained in:
@@ -198,7 +198,7 @@ public class AdvancedPowerUsageDetailTest {
|
||||
doReturn(mPackageManager).when(mTestActivity).getPackageManager();
|
||||
doReturn(mAppOpsManager).when(mTestActivity).getSystemService(Context.APP_OPS_SERVICE);
|
||||
|
||||
mBatteryUtils = spy(BatteryUtils.getInstance(mTestActivity));
|
||||
mBatteryUtils = spy(new BatteryUtils(mContext));
|
||||
doReturn(FOREGROUND_SERVICE_TIME_US).when(mBatteryUtils).getForegroundServiceTotalTimeUs(
|
||||
any(BatteryStats.Uid.class), anyLong());
|
||||
|
||||
|
Reference in New Issue
Block a user