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

Commit 704e6986 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Setting package to null on launching shortcut if it contains statusflag...

Merge "Setting package to null on launching shortcut if it contains statusflag to support webui." into ub-launcher3-master
parents 4c021ee1 8d01cb42
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1848,6 +1848,18 @@ public class Launcher extends BaseActivity
        if (intent == null) {
            throw new IllegalArgumentException("Input must have a valid intent");
        }
        if (item instanceof ShortcutInfo) {
            ShortcutInfo si = (ShortcutInfo) item;
            if (si.hasStatusFlag(ShortcutInfo.FLAG_SUPPORTS_WEB_UI)
                    && intent.getAction() == Intent.ACTION_VIEW) {
                // make a copy of the intent that has the package set to null
                // we do this because the platform sometimes disables instant
                // apps temporarily (triggered by the user) and fallbacks to the
                // web ui. This only works though if the package isn't set
                intent = new Intent(intent);
                intent.setPackage(null);
            }
        }
        startActivitySafely(v, intent, item);
    }