summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Varun Shah <varunshah@google.com> 2024-08-12 21:10:19 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2024-08-12 21:10:19 +0000
commit30b5279e8918a40f5b68e92b9cff1c810405d8c9 (patch)
tree4abfb723ddf66c1adab8d4042d1aa398ad9b20b6
parent2a3ae1df4661d44210c29c03fff83befdfc93f1f (diff)
parent6d444f1a0a5ecd0651ecae1aa3504b16f7b1a13f (diff)
Merge "am:fix the dead lock." into main am: 6d444f1a0a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3214636 Change-Id: I6ebd4bea35886dd7fc9cf6a6566299e95955c1de Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--services/core/java/com/android/server/am/AppRestrictionController.java8
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 4a31fd1f46e4..4c87e1ce357c 100644
--- a/services/core/java/com/android/server/am/AppRestrictionController.java
+++ b/services/core/java/com/android/server/am/AppRestrictionController.java
@@ -308,7 +308,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<>();
/**
@@ -1603,7 +1603,7 @@ public final class AppRestrictionController {
if (moduleInfos == null) {
return;
}
- synchronized (mLock) {
+ synchronized (mSystemModulesCache) {
for (ModuleInfo info : moduleInfos) {
mSystemModulesCache.put(info.getPackageName(), Boolean.TRUE);
}
@@ -1611,7 +1611,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();
@@ -1639,7 +1639,7 @@ public final class AppRestrictionController {
}
}
// Update the cache.
- synchronized (mLock) {
+ synchronized (mSystemModulesCache) {
mSystemModulesCache.put(packageName, isSystemModule);
}
return isSystemModule;