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

Commit 7db48439 authored by Jon Miranda's avatar Jon Miranda Committed by Android (Google) Code Review
Browse files

Merge "Never look for matching view in All Apps when swiping up to go home." into tm-dev

parents ba02df38 b42e124f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1301,8 +1301,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
            }
        }

        return mLauncher.getFirstMatchForAppClose(launchCookieItemId,
                packageName, UserHandle.of(runningTaskTarget.taskInfo.userId));
        return mLauncher.getFirstMatchForAppClose(launchCookieItemId, packageName,
                UserHandle.of(runningTaskTarget.taskInfo.userId), true /* supportsAllAppsState */);
    }

    private @NonNull RectF getDefaultWindowTargetRect() {
+2 −1
Original line number Diff line number Diff line
@@ -233,7 +233,8 @@ public class LauncherSwipeHandlerV2 extends

        return mActivity.getFirstMatchForAppClose(launchCookieItemId,
                runningTaskView.getTask().key.getComponent().getPackageName(),
                UserHandle.of(runningTaskView.getTask().key.userId));
                UserHandle.of(runningTaskView.getTask().key.userId),
                false /* supportsAllAppsState */);
    }

    @Override
+5 −2
Original line number Diff line number Diff line
@@ -2747,8 +2747,11 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
     * @param preferredItemId The id of the preferred item to match to if it exists.
     * @param packageName The package name of the app to match.
     * @param user The user of the app to match.
     * @param supportsAllAppsState If true and we are in All Apps state, looks for view in All Apps.
     *                             Else we only looks on the workspace.
     */
    public View getFirstMatchForAppClose(int preferredItemId, String packageName, UserHandle user) {
    public View getFirstMatchForAppClose(int preferredItemId, String packageName, UserHandle user,
            boolean supportsAllAppsState) {
        final ItemInfoMatcher preferredItem = (info, cn) ->
                info != null && info.id == preferredItemId;
        final ItemInfoMatcher packageAndUserAndApp = (info, cn) ->
@@ -2759,7 +2762,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
                        && TextUtils.equals(info.getTargetComponent().getPackageName(),
                        packageName);

        if (isInState(LauncherState.ALL_APPS)) {
        if (supportsAllAppsState && isInState(LauncherState.ALL_APPS)) {
            return getFirstMatch(Collections.singletonList(mAppsView.getActiveRecyclerView()),
                    preferredItem, packageAndUserAndApp);
        } else {
+2 −1
Original line number Diff line number Diff line
@@ -159,7 +159,8 @@ public class FloatingSurfaceView extends AbstractFloatingView implements
            return;
        }
        View icon = mLauncher.getFirstMatchForAppClose(-1,
                mContract.componentName.getPackageName(), mContract.user);
                mContract.componentName.getPackageName(), mContract.user,
                false /* supportsAllAppsState */);

        boolean iconChanged = mIcon != icon;
        if (iconChanged) {