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

Commit 5784a506 authored by Nate Myren's avatar Nate Myren Committed by Automerger Merge Worker
Browse files

Fix potential deadlock in shutdown in HistoricalRegistry am: 4a2d4ddf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13082067

Change-Id: Iedd8d3224a84f0ba0677709091982abcba54ec9e
parents 369dfd2a 4a2d4ddf
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -669,10 +669,12 @@ final class HistoricalRegistry {

    void shutdown() {
        synchronized (mInMemoryLock) {
            if (mMode != AppOpsManager.HISTORICAL_MODE_DISABLED) {
                persistPendingHistory();
            if (mMode == AppOpsManager.HISTORICAL_MODE_DISABLED) {
                return;
            }
        }
        // Do not call persistPendingHistory inside the memory lock, due to possible deadlock
        persistPendingHistory();
    }

    void persistPendingHistory() {