Merge "Should not show internal package entry in the usage list" into sc-dev am: 0d00ace0d2

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14511219

Change-Id: I391e5b838a70c431ecf31b51f032d6eb274602a6
This commit is contained in:
YUKAI HUNG
2021-05-12 06:31:57 +00:00
committed by Automerger Merge Worker
3 changed files with 65 additions and 12 deletions

View File

@@ -581,6 +581,33 @@ public final class BatteryChartPreferenceControllerTest {
assertThat(mBatteryChartPreferenceController.mIsExpanded).isTrue();
}
@Test
public void testIsValidToShowSummary_returnExpectedResult() {
assertThat(mBatteryChartPreferenceController
.isValidToShowSummary("com.google.android.apps.scone"))
.isTrue();
// Verifies the item which is defined in the array list.
assertThat(mBatteryChartPreferenceController
.isValidToShowSummary("com.google.android.googlequicksearchbox"))
.isFalse();
}
@Test
public void testIsValidToShowEntry_returnExpectedResult() {
assertThat(mBatteryChartPreferenceController
.isValidToShowEntry("com.google.android.apps.scone"))
.isTrue();
// Verifies the items which are defined in the array list.
assertThat(mBatteryChartPreferenceController
.isValidToShowEntry("com.google.android.gms.persistent"))
.isFalse();
assertThat(mBatteryChartPreferenceController
.isValidToShowEntry("dex2oat64"))
.isFalse();
}
private static Map<Long, Map<String, BatteryHistEntry>> createBatteryHistoryMap() {
final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap = new HashMap<>();
for (int index = 0; index < DESIRED_HISTORY_SIZE; index++) {