Hide bluetooth and media in battery settings page.

Media is a bundled process which contains the following packages:

com.android.providers.downloads
com.android.mtp
com.android.providers.media
com.android.providers.downloads.ui

This cl moves them to advanced battery page.
1. Bluetooth lives in category bluetooth
2. Media lives in category system

Bug: 35811926
Test: RunSettingsRoboTests
Change-Id: Ie229fa15e2e62b67d571988f7f4e7788a665bcdd
This commit is contained in:
jackqdyulei
2017-02-28 13:51:24 -08:00
parent 238c1c000b
commit 44e8968662
4 changed files with 30 additions and 4 deletions

View File

@@ -26,6 +26,9 @@ import com.android.internal.util.ArrayUtils;
public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider {
private static final String PACKAGE_CALENDAR_PROVIDER = "com.android.providers.calendar";
private static final String PACKAGE_MEDIA_PROVIDER = "com.android.providers.media";
private static final String[] PACKAGES_SYSTEM = {PACKAGE_MEDIA_PROVIDER,
PACKAGE_CALENDAR_PROVIDER};
protected PackageManager mPackageManager;
@@ -45,9 +48,15 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
// 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 {
return ArrayUtils.contains(sipper.mPackages, PACKAGE_CALENDAR_PROVIDER);
} else if (sipper.mPackages != null) {
for (final String packageName : sipper.mPackages) {
if (ArrayUtils.contains(PACKAGES_SYSTEM, packageName)) {
return true;
}
}
}
return false;
}
@Override