From 7955e8ec4765d77ce893ede73d4d326b8dfd6e89 Mon Sep 17 00:00:00 2001 From: Patrick Baumann Date: Tue, 19 Nov 2019 10:11:22 -0800 Subject: [PATCH] Enables the App Enumeration Feature This change enables the app enumeration feature by default. This change is very likely to break some tests that manually install APKs. The fix for them is generally easy: add the --force-queryable flag to the shell command. This change will also make some apps targetting R unable to see other apps that are installed or sideloaded on the device. go/app-visibility-playbook outlines the steps needed to re-gain that visibility. Fixes: 136675067 Test: atest AppEnumerationTests AppsFilterTest Test: atest CtsCalendarProviderTestCases Test: atest CtsAccountManagerTestCases Test: atest CtsContentTestCases Test: atest CtsPermission2TestCases Test: atest CtsAppSecurityTests Test: atest CtsAppTestCases Change-Id: I9db3c0768416dd7ba24108b2a142a24672dab561 --- core/java/android/content/pm/PackageManager.java | 4 ++-- services/core/java/com/android/server/pm/AppsFilter.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index c78d30dd91332..6bee2dd65d760 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -38,7 +38,7 @@ import android.app.PackageInstallObserver; import android.app.admin.DevicePolicyManager; import android.app.usage.StorageStatsManager; import android.compat.annotation.ChangeId; -import android.compat.annotation.Disabled; +import android.compat.annotation.EnabledAfter; import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; @@ -3581,7 +3581,7 @@ public abstract class PackageManager { * @hide */ @ChangeId - @Disabled + @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.Q) public static final long FILTER_APPLICATION_QUERY = 135549675L; /** {@hide} */ diff --git a/services/core/java/com/android/server/pm/AppsFilter.java b/services/core/java/com/android/server/pm/AppsFilter.java index d629b547992bd..0fb889c8da220 100644 --- a/services/core/java/com/android/server/pm/AppsFilter.java +++ b/services/core/java/com/android/server/pm/AppsFilter.java @@ -69,7 +69,7 @@ public class AppsFilter { // Logs all filtering instead of enforcing private static final boolean DEBUG_ALLOW_ALL = false; private static final boolean DEBUG_LOGGING = false; - private static final boolean FEATURE_ENABLED_BY_DEFAULT = false; + private static final boolean FEATURE_ENABLED_BY_DEFAULT = true; /** * This contains a list of app UIDs that are implicitly queryable because another app explicitly