Update flags before querying activities when parsing default apps.
Change-Id: I0120f32bfa2a7dd93714e8592496df4a0d74d07e
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index c1cba97..242ce2d 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -3213,7 +3213,7 @@
/**
* Update given flags when being used to request {@link ResolveInfo}.
*/
- private int updateFlagsForResolve(int flags, int userId, Object cookie) {
+ int updateFlagsForResolve(int flags, int userId, Object cookie) {
return updateFlagsForComponent(flags, userId, cookie);
}
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index 9fef515..627a0ee 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -2962,6 +2962,7 @@
private void applyDefaultPreferredActivityLPw(PackageManagerService service,
Intent intent, int flags, ComponentName cn, String scheme, PatternMatcher ssp,
IntentFilter.AuthorityEntry auth, PatternMatcher path, int userId) {
+ flags = service.updateFlagsForResolve(flags, userId, intent);
List<ResolveInfo> ri = service.mActivities.queryIntent(intent,
intent.getType(), flags, 0);
if (PackageManagerService.DEBUG_PREFERRED) Log.d(TAG, "Queried " + intent