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

Commit 761c9334 authored by Danning Chen's avatar Danning Chen Committed by Android (Google) Code Review
Browse files

Merge "Query with the flag FLAG_MATCH_PINNED_BY_ANY_LAUNCHER for...

Merge "Query with the flag FLAG_MATCH_PINNED_BY_ANY_LAUNCHER for notification's shortcuts" into rvc-dev
parents 825f99b8 338ce5db
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.server.notification;

import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_CACHED;
import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC;
import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED;
import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED_BY_ANY_LAUNCHER;

import android.annotation.NonNull;
import android.content.IntentFilter;
@@ -176,7 +176,8 @@ public class ShortcutHelper {
            LauncherApps.ShortcutQuery query = new LauncherApps.ShortcutQuery();
            query.setPackage(packageName);
            query.setShortcutIds(Arrays.asList(shortcutId));
            query.setQueryFlags(FLAG_MATCH_DYNAMIC | FLAG_MATCH_PINNED | FLAG_MATCH_CACHED);
            query.setQueryFlags(
                    FLAG_MATCH_DYNAMIC | FLAG_MATCH_PINNED_BY_ANY_LAUNCHER | FLAG_MATCH_CACHED);
            List<ShortcutInfo> shortcuts = mLauncherAppsService.getShortcuts(query, user);
            ShortcutInfo info = shortcuts != null && shortcuts.size() > 0
                    ? shortcuts.get(0)