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

Commit 394aaeef authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Synchronise dumpTempWhitelistSchedule in DeviceIdleController.java" into main

parents aae315ef d0dcb84d
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -618,6 +618,7 @@ public class DeviceIdleController extends SystemService
     * List of end times for app-IDs that are temporarily marked as being allowed to access
     * the network and acquire wakelocks. Times are in milliseconds.
     */
    @GuardedBy("this")
    private final SparseArray<Pair<MutableLong, String>> mTempWhitelistAppIdEndTimes
            = new SparseArray<>();

@@ -4999,7 +5000,9 @@ public class DeviceIdleController extends SystemService
                if (!DumpUtils.checkDumpPermission(getContext(), TAG, pw)) {
                    return -1;
                }
                dumpTempWhitelistSchedule(pw, false);
                synchronized (this) {
                    dumpTempWhitelistScheduleLocked(pw, false);
                }
            }
        } else if ("except-idle-whitelist".equals(cmd)) {
            getContext().enforceCallingOrSelfPermission(
@@ -5283,7 +5286,7 @@ public class DeviceIdleController extends SystemService
                    pw.println();
                }
            }
            dumpTempWhitelistSchedule(pw, true);
            dumpTempWhitelistScheduleLocked(pw, true);

            size = mTempWhitelistAppIdArray != null ? mTempWhitelistAppIdArray.length : 0;
            if (size > 0) {
@@ -5411,7 +5414,8 @@ public class DeviceIdleController extends SystemService
        }
    }

    void dumpTempWhitelistSchedule(PrintWriter pw, boolean printTitle) {
    @GuardedBy("this")
    void dumpTempWhitelistScheduleLocked(PrintWriter pw, boolean printTitle) {
        final int size = mTempWhitelistAppIdEndTimes.size();
        if (size > 0) {
            String prefix = "";