diff options
| author | 2020-07-07 11:43:38 -0700 | |
|---|---|---|
| committer | 2020-07-07 13:04:47 -0700 | |
| commit | 76aa2deba7ae062787ba371a5005ea6118efcecd (patch) | |
| tree | eea7253864faba528b2e655bb73a25427ed06b3e | |
| parent | 2d695313c903179baa1b34a45003bc09a1352ea1 (diff) | |
Fixes component-based visibility recompute
This change fixes a bug that was resulting in any forceQueryable
package's queries->intent tags to be ignored. The logic in the
recomputeComponentVisibility was skipping if the source was force
queryable instead of the target. This change fixes that and adds the
correct check for the source (has QUERY_ALL_PACKAGES)
Test: atest AppEnumerationTests AppsFilterTest
Fixes: 159626154
Change-Id: Iaba1c52e6d645db43715642e7db9eaacdfeefb7d
| -rw-r--r-- | services/core/java/com/android/server/pm/AppsFilter.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/pm/AppsFilter.java b/services/core/java/com/android/server/pm/AppsFilter.java index 3a203d52edbe..c3c2e5e65103 100644 --- a/services/core/java/com/android/server/pm/AppsFilter.java +++ b/services/core/java/com/android/server/pm/AppsFilter.java @@ -708,12 +708,15 @@ public class AppsFilter { return ret; } + /** + * This method recomputes all component / intent-based visibility and is intended to match the + * relevant logic of {@link #addPackageInternal(PackageSetting, ArrayMap)} + */ private void recomputeComponentVisibility(ArrayMap<String, PackageSetting> existingSettings) { mQueriesViaComponent.clear(); for (int i = existingSettings.size() - 1; i >= 0; i--) { PackageSetting setting = existingSettings.valueAt(i); - if (setting.pkg == null - || mForceQueryable.contains(setting.appId)) { + if (setting.pkg == null || requestsQueryAllPackages(setting.pkg)) { continue; } for (int j = existingSettings.size() - 1; j >= 0; j--) { @@ -721,7 +724,7 @@ public class AppsFilter { continue; } final PackageSetting otherSetting = existingSettings.valueAt(j); - if (otherSetting.pkg == null) { + if (otherSetting.pkg == null || mForceQueryable.contains(otherSetting.appId)) { continue; } if (canQueryViaComponents(setting.pkg, otherSetting.pkg, mProtectedBroadcasts)) { |