Fix issues in battery usage accounting
1. In High usage dialog, show top apps based on battery usage, not app time. 2. Refactor the check for hidden system modules into ShouldHideSipper, however don't smear it, this is also the current logic before this CL. Bug: 133445008 Test: RunSettingsRoboTests Change-Id: I851a1c9ef9b79a934ba0501cd96001f2e450bda4
This commit is contained in:
@@ -352,15 +352,10 @@ public class BatteryAppListPreferenceController extends AbstractPreferenceContro
|
||||
|
||||
@VisibleForTesting
|
||||
boolean shouldHideSipper(BatterySipper sipper) {
|
||||
// Don't show hidden system module
|
||||
final String packageName = mBatteryUtils.getPackageName(sipper.getUid());
|
||||
if (!TextUtils.isEmpty(packageName)
|
||||
&& AppUtils.isHiddenSystemModule(mContext, packageName)) {
|
||||
return true;
|
||||
}
|
||||
// Don't show over-counted and unaccounted in any condition
|
||||
// Don't show over-counted, unaccounted and hidden system module in any condition
|
||||
return sipper.drainType == BatterySipper.DrainType.OVERCOUNTED
|
||||
|| sipper.drainType == BatterySipper.DrainType.UNACCOUNTED;
|
||||
|| sipper.drainType == BatterySipper.DrainType.UNACCOUNTED
|
||||
|| mBatteryUtils.isHiddenSystemModule(sipper);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
Reference in New Issue
Block a user