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

Commit d239dc82 authored by Lee Shombert's avatar Lee Shombert
Browse files

Revert^2 "Update PIC Ravenwood dependencies"

This reverts commit 18af107e.

Reason for revert: The test failure has been fixed in a separate CL.  This change is now safe.

Change-Id: Ia09abbec51df4bdb91420e27298aea0663fe1a9b
parent 7eb97fee
Loading
Loading
Loading
Loading
+19 −15
Original line number Diff line number Diff line
@@ -1212,22 +1212,15 @@ public class PropertyInvalidatedCache<Query, Result> {
    private static final ConcurrentHashMap<CacheKey, NonceHandler> sHandlers =
            new ConcurrentHashMap<>();

    // True if shared memory is flag-enabled, false otherwise.  Read the flags exactly once.
    private static final boolean sSharedMemoryAvailable = isSharedMemoryAvailable();

    // True if nonces are visible to processes outside this one.
    @android.ravenwood.annotation.RavenwoodReplace
    private static boolean isSharedMemoryAvailable() {
    private static boolean isMultiProcess() {
        return true;
    }

    private static boolean isSharedMemoryAvailable$ravenwood() {
        return false; // Always disable shared memory on Ravenwood. (for now)
    }

    // Return true if this cache can use shared memory for its nonce.  Shared memory may be used
    // if the module is the system.
    private static boolean sharedMemoryOkay(@NonNull CacheKey id) {
        return sSharedMemoryAvailable && sNamespaceSystem.equals(id.namespace);
    // Ravenwood processes are always stand-alone.
    private static boolean isMultiProcess$ravenwood() {
        return false;
    }

    /**
@@ -1241,7 +1234,9 @@ public class PropertyInvalidatedCache<Query, Result> {
            synchronized (sGlobalLock) {
                h = sHandlers.get(id);
                if (h == null) {
                    if (sharedMemoryOkay(id)) {
                    if (!isMultiProcess()) {
                        h = new NonceLocal(id);
                    } else if (sNamespaceSystem.equals(id.namespace)) {
                        h = new NonceSharedMem(id);
                    } else if (sNamespaceTest.equals(id.namespace)) {
                        h = new NonceLocal(id);
@@ -2090,9 +2085,10 @@ public class PropertyInvalidatedCache<Query, Result> {
        // See if brief output is requested.
        final boolean brief = briefRequested(args);

        if (sSharedMemoryAvailable) {
        NonceStore store = NonceStore.maybeGetInstance();
        if (store != null) {
            pw.println("  SharedMemory: enabled");
            NonceStore.getInstance().dump(pw, "    ", detail);
            store.dump(pw, "    ", detail);
        } else {
            pw.println("  SharedMemory: disabled");
         }
@@ -2235,6 +2231,14 @@ public class PropertyInvalidatedCache<Query, Result> {
            }
        }

        // Return the instance but only if it has been created already.  This is used for dump and
        // debug.
        static NonceStore maybeGetInstance() {
            synchronized (sLock) {
                return sInstance;
            }
        }

        // The index value of an unmapped name.
        public static final int INVALID_NONCE_INDEX = -1;