diff options
author | 2024-08-12 20:48:12 +0000 | |
---|---|---|
committer | 2024-08-12 20:48:12 +0000 | |
commit | 6d444f1a0a5ecd0651ecae1aa3504b16f7b1a13f (patch) | |
tree | 2ea2e4f9b4b6ee13259be8adbce8b7f1324f557b | |
parent | 32662e92fad9f87385e195df865a430892b27b5a (diff) | |
parent | 7a6d4a22c55ef5882d1f5da329656c77ed83ad58 (diff) |
Merge "am:fix the dead lock." into main
-rw-r--r-- | services/core/java/com/android/server/am/AppRestrictionController.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/am/AppRestrictionController.java b/services/core/java/com/android/server/am/AppRestrictionController.java index 88f6bc91d1ff..5827c7fef6ee 100644 --- a/services/core/java/com/android/server/am/AppRestrictionController.java +++ b/services/core/java/com/android/server/am/AppRestrictionController.java @@ -297,7 +297,7 @@ public final class AppRestrictionController { /** * Cache the package name and information about if it's a system module. */ - @GuardedBy("mLock") + @GuardedBy("mSystemModulesCache") private final HashMap<String, Boolean> mSystemModulesCache = new HashMap<>(); /** @@ -1588,7 +1588,7 @@ public final class AppRestrictionController { if (moduleInfos == null) { return; } - synchronized (mLock) { + synchronized (mSystemModulesCache) { for (ModuleInfo info : moduleInfos) { mSystemModulesCache.put(info.getPackageName(), Boolean.TRUE); } @@ -1596,7 +1596,7 @@ public final class AppRestrictionController { } private boolean isSystemModule(String packageName) { - synchronized (mLock) { + synchronized (mSystemModulesCache) { final Boolean val = mSystemModulesCache.get(packageName); if (val != null) { return val.booleanValue(); @@ -1624,7 +1624,7 @@ public final class AppRestrictionController { } } // Update the cache. - synchronized (mLock) { + synchronized (mSystemModulesCache) { mSystemModulesCache.put(packageName, isSystemModule); } return isSystemModule; |