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

Commit 4d7c8e04 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Maybe fix needing wifi permission to dump battery stats."

parents 871af483 13a6a9b3
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -982,9 +982,18 @@ public final class BatteryStatsService extends IBatteryStats.Stub
        if (noOutput) {
            return;
        }

        long ident = Binder.clearCallingIdentity();
        try {
            if (BatteryStatsHelper.checkWifiOnly(mContext)) {
                flags |= BatteryStats.DUMP_DEVICE_WIFI_ONLY;
            }
            // Fetch data from external sources and update the BatteryStatsImpl object with them.
            updateExternalStats("dump");
        } finally {
            Binder.restoreCallingIdentity(ident);
        }

        if (reqUid >= 0) {
            // By default, if the caller is only interested in a specific package, then
            // we only dump the aggregated data since charged.
@@ -995,9 +1004,6 @@ public final class BatteryStatsService extends IBatteryStats.Stub
            }
        }

        // Fetch data from external sources and update the BatteryStatsImpl object with them.
        updateExternalStats("dump");

        if (useCheckinFormat) {
            List<ApplicationInfo> apps = mContext.getPackageManager().getInstalledApplications(0);
            if (isRealCheckin) {