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

Commit c5f96567 authored by Rhed Jao's avatar Rhed Jao Committed by Android (Google) Code Review
Browse files

Merge "Enforce dump permission to the idledevice whitelist command"

parents b3fca68e dce1a07b
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -4821,6 +4821,9 @@ public class DeviceIdleController extends SystemService
                    Binder.restoreCallingIdentity(token);
                    Binder.restoreCallingIdentity(token);
                }
                }
            } else {
            } else {
                if (!DumpUtils.checkDumpPermission(getContext(), TAG, pw)) {
                    return -1;
                }
                synchronized (this) {
                synchronized (this) {
                    for (int j=0; j<mPowerSaveWhitelistAppsExceptIdle.size(); j++) {
                    for (int j=0; j<mPowerSaveWhitelistAppsExceptIdle.size(); j++) {
                        pw.print("system-excidle,");
                        pw.print("system-excidle,");
@@ -4882,6 +4885,9 @@ public class DeviceIdleController extends SystemService
                pw.println("[-r] requires a package name");
                pw.println("[-r] requires a package name");
                return -1;
                return -1;
            } else {
            } else {
                if (!DumpUtils.checkDumpPermission(getContext(), TAG, pw)) {
                    return -1;
                }
                dumpTempWhitelistSchedule(pw, false);
                dumpTempWhitelistSchedule(pw, false);
            }
            }
        } else if ("except-idle-whitelist".equals(cmd)) {
        } else if ("except-idle-whitelist".equals(cmd)) {
@@ -4957,6 +4963,9 @@ public class DeviceIdleController extends SystemService
                    Binder.restoreCallingIdentity(token);
                    Binder.restoreCallingIdentity(token);
                }
                }
            } else {
            } else {
                if (!DumpUtils.checkDumpPermission(getContext(), TAG, pw)) {
                    return -1;
                }
                synchronized (this) {
                synchronized (this) {
                    for (int j = 0; j < mPowerSaveWhitelistApps.size(); j++) {
                    for (int j = 0; j < mPowerSaveWhitelistApps.size(); j++) {
                        pw.print(mPowerSaveWhitelistApps.keyAt(j));
                        pw.print(mPowerSaveWhitelistApps.keyAt(j));