Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac6c4cbb authored by Amith Yamasani's avatar Amith Yamasani Committed by Android Git Automerger
Browse files

am 0cf4c3d4: am 3364b2ff: Merge "Fix launching home when there are multiple...

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

* commit '0cf4c3d4':
  Fix launching home when there are multiple launchers installed
parents 1723bc81 0cf4c3d4
Loading
Loading
Loading
Loading
+6 −8
Original line number Original line Diff line number Diff line
@@ -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