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

Commit 84e71bf9 authored by Jon Miranda's avatar Jon Miranda
Browse files

Enable new opening app transitions for shortcuts.

Platform change: I9a854d43c65c8fa69bf16ccfbed86e8e681a095b

Bug: 70220260
Change-Id: Ic94b6d69c83116c1c21f99a4b2fba94ff62b61b0
parent d766aada
Loading
Loading
Loading
Loading
+6 −7
Original line number Original line Diff line number Diff line
@@ -1975,18 +1975,12 @@ public class Launcher extends BaseActivity
            return mAppLaunchSuccess;
            return mAppLaunchSuccess;
        }
        }


        boolean isShortcut = Utilities.ATLEAST_MARSHMALLOW
                && (item instanceof ShortcutInfo)
                && (item.itemType == Favorites.ITEM_TYPE_SHORTCUT
                || item.itemType == Favorites.ITEM_TYPE_DEEP_SHORTCUT)
                && !((ShortcutInfo) item).isPromise();

        // Only launch using the new animation if the shortcut has not opted out (this is a
        // Only launch using the new animation if the shortcut has not opted out (this is a
        // private contract between launcher and may be ignored in the future).
        // private contract between launcher and may be ignored in the future).
        boolean useLaunchAnimation = (v != null) &&
        boolean useLaunchAnimation = (v != null) &&
                !intent.hasExtra(INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION);
                !intent.hasExtra(INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION);
        Bundle optsBundle = useLaunchAnimation
        Bundle optsBundle = useLaunchAnimation
                ? getActivityLaunchOptions(v, isShortcut || isInMultiWindowModeCompat())
                ? getActivityLaunchOptions(v, isInMultiWindowModeCompat())
                : null;
                : null;


        UserHandle user = item == null ? null : item.user;
        UserHandle user = item == null ? null : item.user;
@@ -1997,6 +1991,11 @@ public class Launcher extends BaseActivity
            intent.setSourceBounds(getViewBounds(v));
            intent.setSourceBounds(getViewBounds(v));
        }
        }
        try {
        try {
            boolean isShortcut = Utilities.ATLEAST_MARSHMALLOW
                    && (item instanceof ShortcutInfo)
                    && (item.itemType == Favorites.ITEM_TYPE_SHORTCUT
                    || item.itemType == Favorites.ITEM_TYPE_DEEP_SHORTCUT)
                    && !((ShortcutInfo) item).isPromise();
            if (isShortcut) {
            if (isShortcut) {
                // Shortcuts need some special checks due to legacy reasons.
                // Shortcuts need some special checks due to legacy reasons.
                startShortcutIntentSafely(intent, optsBundle, item);
                startShortcutIntentSafely(intent, optsBundle, item);