am 0cf4c3d4: am 3364b2ff: Merge "Fix launching home when there are multiple launchers installed" into jb-mr1-dev

* commit '0cf4c3d4a05f68b27895a527af158c976cfc9975':
  Fix launching home when there are multiple launchers installed
This commit is contained in:
Amith Yamasani
2012-10-04 11:59:55 -07:00
committed by Android Git Automerger

View File

@@ -150,8 +150,7 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte
resizeGrid(); resizeGrid();
} else if (count == 1) { } else if (count == 1) {
startActivityAsUser(mAdapter.intentForPosition(0), startActivity(mAdapter.intentForPosition(0));
new UserHandle(UserHandle.getUserId(mLaunchedFromUid)));
mPackageMonitor.unregister(); mPackageMonitor.unregister();
mRegistered = false; mRegistered = false;
finish(); finish();
@@ -364,12 +363,12 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte
if (r.match > bestMatch) bestMatch = r.match; if (r.match > bestMatch) bestMatch = r.match;
} }
getPackageManager().addPreferredActivity(filter, bestMatch, set, getPackageManager().addPreferredActivity(filter, bestMatch, set,
intent.getComponent(), UserHandle.getUserId(mLaunchedFromUid)); intent.getComponent());
} }
} }
if (intent != null) { if (intent != null) {
startActivityAsUser(intent, new UserHandle(UserHandle.getUserId(mLaunchedFromUid))); startActivity(intent);
} }
} }
@@ -377,7 +376,7 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte
Intent in = new Intent().setAction("android.settings.APPLICATION_DETAILS_SETTINGS") Intent in = new Intent().setAction("android.settings.APPLICATION_DETAILS_SETTINGS")
.setData(Uri.fromParts("package", ri.activityInfo.packageName, null)) .setData(Uri.fromParts("package", ri.activityInfo.packageName, null))
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); .addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivityAsUser(in, new UserHandle(UserHandle.getUserId(mLaunchedFromUid))); startActivity(in);
} }
private final class DisplayResolveInfo { private final class DisplayResolveInfo {
@@ -436,10 +435,9 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte
if (mBaseResolveList != null) { if (mBaseResolveList != null) {
mCurrentResolveList = mBaseResolveList; mCurrentResolveList = mBaseResolveList;
} else { } else {
mCurrentResolveList = mPm.queryIntentActivitiesAsUser( mCurrentResolveList = mPm.queryIntentActivities(
mIntent, PackageManager.MATCH_DEFAULT_ONLY mIntent, PackageManager.MATCH_DEFAULT_ONLY
| (mAlwaysUseOption ? PackageManager.GET_RESOLVED_FILTER : 0), | (mAlwaysUseOption ? PackageManager.GET_RESOLVED_FILTER : 0));
UserHandle.getUserId(mLaunchedFromUid));
// Filter out any activities that the launched uid does not // Filter out any activities that the launched uid does not
// have permission for. We don't do this when we have an explicit // have permission for. We don't do this when we have an explicit
// list of resolved activities, because that only happens when // list of resolved activities, because that only happens when