Loading services/core/java/com/android/server/pm/AppsFilterBase.java +2 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import android.content.pm.SigningDetails; import android.os.Binder; import android.os.Handler; import android.os.Process; import android.os.SystemProperties; import android.os.Trace; import android.os.UserHandle; import android.text.TextUtils; Loading Loading @@ -199,6 +198,7 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot { protected SnapshotCache<WatchedSparseBooleanMatrix> mShouldFilterCacheSnapshot; protected volatile boolean mCacheReady = false; protected volatile boolean mCacheEnabled = true; protected static final boolean CACHE_VALID = true; protected static final boolean CACHE_INVALID = false; Loading Loading @@ -342,8 +342,7 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot { && !isImplicitlyQueryable(callingAppId, targetPkgSetting.getAppId()); } // use cache if (mCacheReady && SystemProperties.getBoolean("debug.pm.use_app_filter_cache", true)) { if (mCacheReady && mCacheEnabled) { if (!shouldFilterApplicationUsingCache(callingUid, targetPkgSetting.getAppId(), userId)) { Loading services/core/java/com/android/server/pm/AppsFilterImpl.java +7 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.content.pm.PackageManagerInternal; import android.content.pm.SigningDetails; import android.content.pm.UserInfo; import android.os.Handler; import android.os.SystemProperties; import android.os.Trace; import android.os.UserHandle; import android.provider.DeviceConfig; Loading Loading @@ -223,6 +224,12 @@ public final class AppsFilterImpl extends AppsFilterLocked implements Watchable, return new AppsFilterSnapshotImpl(AppsFilterImpl.this); } }; readCacheEnabledSysProp(); SystemProperties.addChangeCallback(this::readCacheEnabledSysProp); } private void readCacheEnabledSysProp() { mCacheEnabled = SystemProperties.getBoolean("debug.pm.use_app_filter_cache", true); } /** Loading services/core/java/com/android/server/pm/AppsFilterSnapshotImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ public final class AppsFilterSnapshotImpl extends AppsFilterBase { // cache is not ready, use an empty cache for the snapshot mShouldFilterCache = new WatchedSparseBooleanMatrix(); } mCacheEnabled = orig.mCacheEnabled; mShouldFilterCacheSnapshot = new SnapshotCache.Sealed<>(); mBackgroundHandler = null; Loading Loading
services/core/java/com/android/server/pm/AppsFilterBase.java +2 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import android.content.pm.SigningDetails; import android.os.Binder; import android.os.Handler; import android.os.Process; import android.os.SystemProperties; import android.os.Trace; import android.os.UserHandle; import android.text.TextUtils; Loading Loading @@ -199,6 +198,7 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot { protected SnapshotCache<WatchedSparseBooleanMatrix> mShouldFilterCacheSnapshot; protected volatile boolean mCacheReady = false; protected volatile boolean mCacheEnabled = true; protected static final boolean CACHE_VALID = true; protected static final boolean CACHE_INVALID = false; Loading Loading @@ -342,8 +342,7 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot { && !isImplicitlyQueryable(callingAppId, targetPkgSetting.getAppId()); } // use cache if (mCacheReady && SystemProperties.getBoolean("debug.pm.use_app_filter_cache", true)) { if (mCacheReady && mCacheEnabled) { if (!shouldFilterApplicationUsingCache(callingUid, targetPkgSetting.getAppId(), userId)) { Loading
services/core/java/com/android/server/pm/AppsFilterImpl.java +7 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.content.pm.PackageManagerInternal; import android.content.pm.SigningDetails; import android.content.pm.UserInfo; import android.os.Handler; import android.os.SystemProperties; import android.os.Trace; import android.os.UserHandle; import android.provider.DeviceConfig; Loading Loading @@ -223,6 +224,12 @@ public final class AppsFilterImpl extends AppsFilterLocked implements Watchable, return new AppsFilterSnapshotImpl(AppsFilterImpl.this); } }; readCacheEnabledSysProp(); SystemProperties.addChangeCallback(this::readCacheEnabledSysProp); } private void readCacheEnabledSysProp() { mCacheEnabled = SystemProperties.getBoolean("debug.pm.use_app_filter_cache", true); } /** Loading
services/core/java/com/android/server/pm/AppsFilterSnapshotImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ public final class AppsFilterSnapshotImpl extends AppsFilterBase { // cache is not ready, use an empty cache for the snapshot mShouldFilterCache = new WatchedSparseBooleanMatrix(); } mCacheEnabled = orig.mCacheEnabled; mShouldFilterCacheSnapshot = new SnapshotCache.Sealed<>(); mBackgroundHandler = null; Loading