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

Commit 6d444f1a authored by Varun Shah's avatar Varun Shah Committed by Gerrit Code Review
Browse files

Merge "am:fix the dead lock." into main

parents 32662e92 7a6d4a22
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;