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

Commit 38919b48 authored by Jing Ji's avatar Jing Ji Committed by Automerger Merge Worker
Browse files

Add proper lock to the dropbox throttling map am: 3862660d am: 6ac43358...

Add proper lock to the dropbox throttling map am: 3862660d am: 6ac43358 am: da12c6a1 am: 6c6c34b4

Change-Id: Ib1946c984c7b996a09f9174b481f92f24f621455
parents f591cbfe 6c6c34b4
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -10203,7 +10203,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        }
    }
    private volatile ArrayMap<String, long[]> mErrorClusterRecords = new ArrayMap<>();
    private final ArrayMap<String, long[]> mErrorClusterRecords = new ArrayMap<>();
    /**
     * Write a description of an error (crash, WTF, ANR) to the drop box.
@@ -10236,6 +10236,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        // Rate-limit how often we're willing to do the heavy lifting below to
        // collect and record logs; currently 5 logs per 10 second period per eventType.
        final long now = SystemClock.elapsedRealtime();
        synchronized (mErrorClusterRecords) {
            long[] errRecord = mErrorClusterRecords.get(eventType);
            if (errRecord == null) {
                errRecord = new long[2]; // [0]: startTime, [1]: count
@@ -10247,6 +10248,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            } else {
                if (errRecord[1]++ >= 5) return;
            }
        }
        final StringBuilder sb = new StringBuilder(1024);
        appendDropBoxProcessHeaders(process, processName, sb);