diff options
author | Mario Bertschler <bmario@google.com> | 2018-02-13 14:47:02 -0800 |
---|---|---|
committer | Mario Bertschler <bmario@google.com> | 2018-02-13 14:47:02 -0800 |
commit | 8d01cb422d02cec11a9a7a54f54620a8939e69a0 (patch) | |
tree | b4fa51de57e6516576b1aff3464a6be4285d5abf | |
parent | d766aadae747d873b77dfcb436271eda5aa82f68 (diff) | |
download | android_packages_apps_Trebuchet-8d01cb422d02cec11a9a7a54f54620a8939e69a0.tar.gz android_packages_apps_Trebuchet-8d01cb422d02cec11a9a7a54f54620a8939e69a0.tar.bz2 android_packages_apps_Trebuchet-8d01cb422d02cec11a9a7a54f54620a8939e69a0.zip |
Setting package to null on launching shortcut if it contains
statusflag to support webui.
Bug: 66009310
Change-Id: I37bf15c3779c88489a16f63ed772d460a0bd531c
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 4d820bc0b..d262db69c 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1852,6 +1852,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); } |