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

Commit 2eb0812f authored by Anna Bauza's avatar Anna Bauza
Browse files

Revert^2 "Add condition to bypass caching when process uid differs from caller uid."

This reverts commit 4e53a549.

Reason for revert: This is not fixing the bug just covering up possible issue in Android OS. Please fix the tests, or actual issue.

Change-Id: I3db74d1aadfc7652f068483478589a343e60d89b
parent 42cdae92
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -21,11 +21,13 @@ import static android.text.TextUtils.formatSimple;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.annotation.TestApi;
import android.annotation.TestApi;
import android.os.Binder;
import android.os.Build;
import android.os.Build;
import android.os.Handler;
import android.os.Handler;
import android.os.Looper;
import android.os.Looper;
import android.os.Message;
import android.os.Message;
import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.SystemClock;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.SystemProperties;
import android.text.TextUtils;
import android.text.TextUtils;
@@ -78,10 +80,15 @@ public class PropertyInvalidatedCache<Query, Result> {
        public abstract @Nullable R apply(@NonNull Q query);
        public abstract @Nullable R apply(@NonNull Q query);


        /**
        /**
         * Return true if a query should not use the cache.  The default implementation
         * Return true if a query should not use the cache. The default implementation returns true
         * always uses the cache.
         * if the process UID differs from the calling UID. This is to prevent a binder caller from
         * reading a cached value created due to a different binder caller, when processes are
         * caching on behalf of other processes.
         */
         */
        public boolean shouldBypassCache(@NonNull Q query) {
        public boolean shouldBypassCache(@NonNull Q query) {
            if(android.multiuser.Flags.propertyInvalidatedCacheBypassMismatchedUids()) {
                return Binder.getCallingUid() != Process.myUid();
            }
            return false;
            return false;
        }
        }
    };
    };