Recheck for shortcut host permission when launching app shortcuts
@@ -507,10 +507,12 @@ public class U {
private static void launchShortcut(Context context, ShortcutInfo shortcut, Bundle bundle) {
LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE);
+ if(launcherApps.hasShortcutHostPermission()) {
try {
launcherApps.startShortcut(shortcut, null, bundle);
} catch (ActivityNotFoundException | NullPointerException e) { /* Gracefully fail */ }
}
+ }
public static void launchAppMaximized(Context context, Intent intent) {
UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
