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

Commit 720edd3a authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Synchronise dumpTempWhitelistSchedule in DeviceIdleController.java" into main am: 394aaeef

parents e84cbcfe 394aaeef
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line 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
     * 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.
     * the network and acquire wakelocks. Times are in milliseconds.
     */
     */
    @GuardedBy("this")
    private final SparseArray<Pair<MutableLong, String>> mTempWhitelistAppIdEndTimes
    private final SparseArray<Pair<MutableLong, String>> mTempWhitelistAppIdEndTimes
            = new SparseArray<>();
            = new SparseArray<>();


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


            size = mTempWhitelistAppIdArray != null ? mTempWhitelistAppIdArray.length : 0;
            size = mTempWhitelistAppIdArray != null ? mTempWhitelistAppIdArray.length : 0;
            if (size > 0) {
            if (size > 0) {
@@ -5421,7 +5424,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();
        final int size = mTempWhitelistAppIdEndTimes.size();
        if (size > 0) {
        if (size > 0) {
            String prefix = "";
            String prefix = "";