Loading core/java/android/app/ActivityThread.java +2 −4 Original line number Diff line number Diff line Loading @@ -1450,10 +1450,8 @@ public final class ActivityThread extends ClientTransactionHandler ApplicationSharedMemory instance = ApplicationSharedMemory.fromFileDescriptor( applicationSharedMemoryFd, /* mutable= */ false); if (android.content.pm.Flags.cacheSdkSystemFeatures()) { SystemFeaturesCache.setInstance( new SystemFeaturesCache(instance.readSystemFeaturesCache())); } instance.closeFileDescriptor(); ApplicationSharedMemory.setInstance(instance); Loading core/java/android/app/ApplicationPackageManager.java +2 −5 Original line number Diff line number Diff line Loading @@ -2271,13 +2271,10 @@ public class ApplicationPackageManager extends PackageManager { protected ApplicationPackageManager(ContextImpl context, IPackageManager pm) { mContext = context; mPM = pm; mUseSystemFeaturesCache = isSystemFeaturesCacheEnabledAndAvailable(); mUseSystemFeaturesCache = isSystemFeaturesCacheAvailable(); } private static boolean isSystemFeaturesCacheEnabledAndAvailable() { if (!android.content.pm.Flags.cacheSdkSystemFeatures()) { return false; } private static boolean isSystemFeaturesCacheAvailable() { if (ActivityThread.isSystem() && !SystemFeaturesCache.hasInstance()) { // There are a handful of utility "system" processes that are neither system_server nor // bound as applications. For these processes, we don't have access to application Loading core/java/android/content/pm/SystemFeaturesCache.java +3 −4 Original line number Diff line number Diff line Loading @@ -49,8 +49,8 @@ public final class SystemFeaturesCache { /** * Installs the process-global cache instance. * * <p>Note: Usage should be gated on android.content.pm.Flags.cacheSdkSystemFeature(). In * practice, this should only be called from 1) SystemServer init, or 2) bindApplication. * <p>Note: In practice, this should only be called from 1) SystemServer init, * or 2) bindApplication. */ @MainThread public static void setInstance(SystemFeaturesCache instance) { Loading @@ -63,8 +63,7 @@ public final class SystemFeaturesCache { /** * Gets the process-global cache instance. * * Note: Usage should be gated on android.content.pm.Flags.cacheSdkSystemFeature(), and should * always occur after the instance has been installed early in the process lifecycle. * Note: Usage must occur after the instance has been installed early in the process lifecycle. */ public static @NonNull SystemFeaturesCache getInstance() { SystemFeaturesCache instance = sInstance; Loading core/java/android/content/pm/flags.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -126,13 +126,6 @@ flag { } } flag { name: "cache_sdk_system_features" namespace: "system_performance" description: "Feature flag to enable optimized cache for SDK-defined system feature lookups." bug: "326623529" } flag { name: "provide_info_of_apk_in_apex" is_exported: true Loading core/tests/coretests/src/android/content/pm/SystemFeaturesCacheTest.java +1 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static android.content.pm.PackageManager.FEATURE_WATCH; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; import static org.junit.Assume.assumeTrue; import android.util.ArrayMap; Loading Loading @@ -149,8 +148,7 @@ public class SystemFeaturesCacheTest { } @Test public void testSingletonAutomaticallySetWithFeatureEnabled() { assumeTrue(android.content.pm.Flags.cacheSdkSystemFeatures()); public void testSingletonAutomaticallySet() { assertThat(SystemFeaturesCache.hasInstance()).isTrue(); assertThat(SystemFeaturesCache.getInstance()).isNotNull(); } Loading Loading
core/java/android/app/ActivityThread.java +2 −4 Original line number Diff line number Diff line Loading @@ -1450,10 +1450,8 @@ public final class ActivityThread extends ClientTransactionHandler ApplicationSharedMemory instance = ApplicationSharedMemory.fromFileDescriptor( applicationSharedMemoryFd, /* mutable= */ false); if (android.content.pm.Flags.cacheSdkSystemFeatures()) { SystemFeaturesCache.setInstance( new SystemFeaturesCache(instance.readSystemFeaturesCache())); } instance.closeFileDescriptor(); ApplicationSharedMemory.setInstance(instance); Loading
core/java/android/app/ApplicationPackageManager.java +2 −5 Original line number Diff line number Diff line Loading @@ -2271,13 +2271,10 @@ public class ApplicationPackageManager extends PackageManager { protected ApplicationPackageManager(ContextImpl context, IPackageManager pm) { mContext = context; mPM = pm; mUseSystemFeaturesCache = isSystemFeaturesCacheEnabledAndAvailable(); mUseSystemFeaturesCache = isSystemFeaturesCacheAvailable(); } private static boolean isSystemFeaturesCacheEnabledAndAvailable() { if (!android.content.pm.Flags.cacheSdkSystemFeatures()) { return false; } private static boolean isSystemFeaturesCacheAvailable() { if (ActivityThread.isSystem() && !SystemFeaturesCache.hasInstance()) { // There are a handful of utility "system" processes that are neither system_server nor // bound as applications. For these processes, we don't have access to application Loading
core/java/android/content/pm/SystemFeaturesCache.java +3 −4 Original line number Diff line number Diff line Loading @@ -49,8 +49,8 @@ public final class SystemFeaturesCache { /** * Installs the process-global cache instance. * * <p>Note: Usage should be gated on android.content.pm.Flags.cacheSdkSystemFeature(). In * practice, this should only be called from 1) SystemServer init, or 2) bindApplication. * <p>Note: In practice, this should only be called from 1) SystemServer init, * or 2) bindApplication. */ @MainThread public static void setInstance(SystemFeaturesCache instance) { Loading @@ -63,8 +63,7 @@ public final class SystemFeaturesCache { /** * Gets the process-global cache instance. * * Note: Usage should be gated on android.content.pm.Flags.cacheSdkSystemFeature(), and should * always occur after the instance has been installed early in the process lifecycle. * Note: Usage must occur after the instance has been installed early in the process lifecycle. */ public static @NonNull SystemFeaturesCache getInstance() { SystemFeaturesCache instance = sInstance; Loading
core/java/android/content/pm/flags.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -126,13 +126,6 @@ flag { } } flag { name: "cache_sdk_system_features" namespace: "system_performance" description: "Feature flag to enable optimized cache for SDK-defined system feature lookups." bug: "326623529" } flag { name: "provide_info_of_apk_in_apex" is_exported: true Loading
core/tests/coretests/src/android/content/pm/SystemFeaturesCacheTest.java +1 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static android.content.pm.PackageManager.FEATURE_WATCH; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; import static org.junit.Assume.assumeTrue; import android.util.ArrayMap; Loading Loading @@ -149,8 +148,7 @@ public class SystemFeaturesCacheTest { } @Test public void testSingletonAutomaticallySetWithFeatureEnabled() { assumeTrue(android.content.pm.Flags.cacheSdkSystemFeatures()); public void testSingletonAutomaticallySet() { assertThat(SystemFeaturesCache.hasInstance()).isTrue(); assertThat(SystemFeaturesCache.getInstance()).isNotNull(); } Loading