Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a307685 authored by Zaiyue Xue's avatar Zaiyue Xue
Browse files

Clean up BatteryAppListPreferenceController

Bug: 256123455
Bug: 258576047
Fix: 258576047
Test: presubmit
Change-Id: I8c3d05f76e7a6995fccc34b2cc60ee126bb3d350
parent df25b720
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ public class AppBatteryPreferenceController extends BasePreferenceController
        if (isBatteryStatsAvailable()) {
            final UserManager userManager =
                    (UserManager) mContext.getSystemService(Context.USER_SERVICE);
            final BatteryEntry entry = new BatteryEntry(mContext, /* handler */null, userManager,
            final BatteryEntry entry = new BatteryEntry(mContext, userManager,
                    mUidBatteryConsumer, /* isHidden */ false,
                    mUidBatteryConsumer.getUid(), /* packages */ null, mPackageName);
            Log.i(TAG, "Battery consumer available, launch : "
+0 −19
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.BatteryConsumer;
import android.os.BatteryStats;
import android.os.BatteryStatsManager;
import android.os.BatteryUsageStats;
@@ -200,24 +199,6 @@ public class BatteryUtils {
                : uid < 0 || isHiddenSystemModule(packages);
    }

    /**
     * Returns true if the specified device power component should be excluded from the summary
     * battery consumption list.
     */
    public boolean shouldHideDevicePowerComponent(BatteryConsumer consumer,
            @BatteryConsumer.PowerComponent int powerComponentId) {
        switch (powerComponentId) {
            case BatteryConsumer.POWER_COMPONENT_IDLE:
            case BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO:
            case BatteryConsumer.POWER_COMPONENT_SCREEN:
            case BatteryConsumer.POWER_COMPONENT_BLUETOOTH:
            case BatteryConsumer.POWER_COMPONENT_WIFI:
                return true;
            default:
                return false;
        }
    }

    /**
     * Returns true if one the specified packages belongs to a hidden system module.
     */
+0 −549

File deleted.

Preview size limit exceeded, changes collapsed.

+2 −4

File changed.

Preview size limit exceeded, changes collapsed.

+6 −89

File changed.

Preview size limit exceeded, changes collapsed.

Loading