Clears previously added cross-profile-intents
Clears the old cross-profile intent filters added by the Settings app. This makes sure we do not have duplicates and also that there are no outdated intents being forwarded (intents that do not exist any more). Bug: 16647771 Change-Id: Ief4f7341e3f984b9435a9757bf469e53227ce2bf
This commit is contained in:
@@ -47,12 +47,15 @@ public class ManagedProfileSetup extends BroadcastReceiver {
|
||||
return;
|
||||
}
|
||||
|
||||
final PackageManager pm = context.getPackageManager();
|
||||
// Clear any previous intent forwarding we set up
|
||||
pm.clearCrossProfileIntentFilters(UserHandle.myUserId());
|
||||
|
||||
// Set up intent forwarding for implicit intents
|
||||
Intent intent = new Intent();
|
||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
intent.setPackage(context.getPackageName());
|
||||
|
||||
final PackageManager pm = context.getPackageManager();
|
||||
// Resolves activities for the managed profile (which we're running as)
|
||||
List<ResolveInfo> resolvedIntents = pm.queryIntentActivities(intent,
|
||||
GET_ACTIVITIES | GET_META_DATA | GET_RESOLVED_FILTER);
|
||||
|
Reference in New Issue
Block a user