Not using resource ids for EXTRA_INITIAL_INTENTS inside a managed profile.

Inside ResolverActivity: when getting the ResolveInfo for EXTRA_INITIAL_INTENTS:
The ResolveInfo is created directly inside ResolverActivity, not by PackageManagerService.
So, noResourceId had not been set to true for this ResolveInfo.
So setting it inside ResolverActivity.

This is needed since inside a managed profile, the icons are not associated with resource ids.

BUG:17577733
Change-Id: Ic4f0439128f95482167103b783344e2baa0aed52
This commit is contained in:
Nicolas Prevot
2014-10-10 16:22:38 +01:00
parent e78aa53123
commit 1a81592169

View File

@@ -819,6 +819,11 @@ public class ResolverActivity extends Activity implements AdapterView.OnItemClic
}
ResolveInfo ri = new ResolveInfo();
ri.activityInfo = ai;
UserManager userManager =
(UserManager) getSystemService(Context.USER_SERVICE);
if (userManager.isManagedProfile()) {
ri.noResourceId = true;
}
if (ii instanceof LabeledIntent) {
LabeledIntent li = (LabeledIntent)ii;
ri.resolvePackageName = li.getSourcePackage();