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

Commit 13a6a9b3 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Maybe fix needing wifi permission to dump battery stats.

Change-Id: I39f265bbdf1855e6e31d1b43e0e919199708aebd
parent a1f6211e
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) {