Put Android Core Apps under System apps

Bug: 269188405
Fix: 269188405
Test: manual
Change-Id: Ie79cdb71c48661b6b1e90b8d0e7836269cf665e7
This commit is contained in:
Zaiyue Xue
2023-03-13 17:44:14 +08:00
parent f57ae783f3
commit 702921c9ff
6 changed files with 88 additions and 59 deletions

View File

@@ -88,7 +88,7 @@ public final class BatteryChartPreferenceControllerTest {
Locale.setDefault(new Locale("en_US"));
org.robolectric.shadows.ShadowSettings.set24HourTimeFormat(false);
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
DataProcessor.sTestSystemAppsSet = Set.of();
DataProcessor.sTestSystemAppsPackageNames = Set.of();
mFeatureFactory = FakeFeatureFactory.setupForTest();
mContext = spy(RuntimeEnvironment.application);
doReturn(mContext).when(mContext).getApplicationContext();

View File

@@ -63,7 +63,7 @@ public class BatteryDiffDataTest {
createBatteryDiffEntry(mContext, /*consumePower=*/ 0, /*isHidden=*/ true);
final boolean needsCombineInSystemApp = BatteryDiffData.needsCombineInSystemApp(
hiddenDiffEntry, List.of(), Set.of());
hiddenDiffEntry, List.of(), Set.of(), Set.of());
assertThat(needsCombineInSystemApp).isTrue();
}
@@ -77,7 +77,7 @@ public class BatteryDiffDataTest {
mApplicationInfo.flags = ApplicationInfo.FLAG_SYSTEM;
final boolean needsCombineInSystemApp = BatteryDiffData.needsCombineInSystemApp(
batteryDiffEntry, List.of(), Set.of(ConvertUtils.FAKE_PACKAGE_NAME));
batteryDiffEntry, List.of(), Set.of(ConvertUtils.FAKE_PACKAGE_NAME), Set.of());
assertThat(needsCombineInSystemApp).isTrue();
}
@@ -91,7 +91,7 @@ public class BatteryDiffDataTest {
mApplicationInfo.flags = 0;
final boolean needsCombineInSystemApp = BatteryDiffData.needsCombineInSystemApp(
batteryDiffEntry, List.of(), Set.of());
batteryDiffEntry, List.of(), Set.of(), Set.of());
assertThat(needsCombineInSystemApp).isFalse();
}

View File

@@ -107,7 +107,7 @@ public final class BatteryUsageBreakdownControllerTest {
mBatteryDiffEntry = spy(mBatteryDiffEntry);
mBatteryUsageBreakdownController.mBatteryDiffData =
new BatteryDiffData(mContext, Arrays.asList(mBatteryDiffEntry), Arrays.asList(),
Set.of(), /* isAccumulated= */ false);
Set.of(), Set.of(), /* isAccumulated= */ false);
// Adds fake testing data.
BatteryDiffEntry.sResourceCache.put(
"fakeBatteryDiffEntryKey",

View File

@@ -93,7 +93,7 @@ public final class DataProcessorTest {
mFeatureFactory = FakeFeatureFactory.setupForTest();
mPowerUsageFeatureProvider = mFeatureFactory.powerUsageFeatureProvider;
DataProcessor.sTestSystemAppsSet = Set.of();
DataProcessor.sTestSystemAppsPackageNames = Set.of();
DataProcessor.sUsageStatsManager = mUsageStatsManager;
doReturn(mIntent).when(mContext).registerReceiver(
isA(BroadcastReceiver.class), isA(IntentFilter.class));