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

Commit 88a27c68 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix potential deadlock in shutdown in HistoricalRegistry"

parents cf8127cb 42387cea
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() {