Transition BatteryAppListPreferences to BatteryUsageStats API

Bug: 173745486
Test: make RunSettingsRoboTests
Test: male RunSettingsGoogleRoboTests

Change-Id: I7af8cbcd27433b89cb2184750c6854aa74761d0d
This commit is contained in:
Dmitri Plotnikov
2021-03-08 20:11:54 -08:00
parent dba51aa233
commit 036dc189b6
13 changed files with 574 additions and 675 deletions

View File

@@ -65,6 +65,21 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
return false;
}
@Override
public boolean isTypeSystem(int uid, String[] packages) {
// Classify all the sippers to type system if the range of uid is 0...FIRST_APPLICATION_UID
if (uid >= Process.ROOT_UID && uid < Process.FIRST_APPLICATION_UID) {
return true;
} else if (packages != null) {
for (final String packageName : packages) {
if (ArrayUtils.contains(PACKAGES_SYSTEM, packageName)) {
return true;
}
}
}
return false;
}
@Override
public boolean isLocationSettingEnabled(String[] packages) {
return false;