Merge "Fix potential deadlock in shutdown in HistoricalRegistry"

This commit is contained in:
TreeHugger Robot
2020-11-14 05:28:09 +00:00
committed by Android (Google) Code Review

View File

@@ -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() {