Search in sources :

Example 16 with ShortcutQuery

use of android.content.pm.LauncherApps.ShortcutQuery in project platform_frameworks_base by android.

the class BaseShortcutManagerTest method getLauncherShortcuts.

protected List<ShortcutInfo> getLauncherShortcuts(String launcher, int userId, int queryFlags) {
    final List<ShortcutInfo>[] ret = new List[1];
    runWithCaller(launcher, userId, () -> {
        final ShortcutQuery q = new ShortcutQuery();
        q.setQueryFlags(queryFlags);
        ret[0] = mLauncherApps.getShortcuts(q, UserHandle.of(userId));
    });
    return ret[0];
}
Also used : ShortcutQuery(android.content.pm.LauncherApps.ShortcutQuery) List(java.util.List) ArrayList(java.util.ArrayList) ShortcutManagerTestUtils.cloneShortcutList(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.cloneShortcutList)

Example 17 with ShortcutQuery

use of android.content.pm.LauncherApps.ShortcutQuery in project android_frameworks_base by DirtyUnicorns.

the class BaseShortcutManagerTest method buildPinnedQuery.

protected static ShortcutQuery buildPinnedQuery(String packageName) {
    final ShortcutQuery q = new ShortcutQuery();
    q.setPackage(packageName);
    q.setQueryFlags(ShortcutQuery.FLAG_GET_PINNED);
    return q;
}
Also used : ShortcutQuery(android.content.pm.LauncherApps.ShortcutQuery)

Example 18 with ShortcutQuery

use of android.content.pm.LauncherApps.ShortcutQuery in project android_frameworks_base by DirtyUnicorns.

the class BaseShortcutManagerTest method buildQuery.

protected static ShortcutQuery buildQuery(long changedSince, String packageName, List<String> shortcutIds, ComponentName componentName, /* @ShortcutQuery.QueryFlags */
int flags) {
    final ShortcutQuery q = new ShortcutQuery();
    q.setChangedSince(changedSince);
    q.setPackage(packageName);
    q.setShortcutIds(shortcutIds);
    q.setActivity(componentName);
    q.setQueryFlags(flags);
    return q;
}
Also used : ShortcutQuery(android.content.pm.LauncherApps.ShortcutQuery)

Example 19 with ShortcutQuery

use of android.content.pm.LauncherApps.ShortcutQuery in project android_frameworks_base by ResurrectionRemix.

the class BaseShortcutManagerTest method buildQueryWithFlags.

protected static ShortcutQuery buildQueryWithFlags(int queryFlags) {
    final ShortcutQuery q = new ShortcutQuery();
    q.setQueryFlags(queryFlags);
    return q;
}
Also used : ShortcutQuery(android.content.pm.LauncherApps.ShortcutQuery)

Example 20 with ShortcutQuery

use of android.content.pm.LauncherApps.ShortcutQuery in project android_frameworks_base by ResurrectionRemix.

the class BaseShortcutManagerTest method getLauncherShortcuts.

protected List<ShortcutInfo> getLauncherShortcuts(String launcher, int userId, int queryFlags) {
    final List<ShortcutInfo>[] ret = new List[1];
    runWithCaller(launcher, userId, () -> {
        final ShortcutQuery q = new ShortcutQuery();
        q.setQueryFlags(queryFlags);
        ret[0] = mLauncherApps.getShortcuts(q, UserHandle.of(userId));
    });
    return ret[0];
}
Also used : ShortcutQuery(android.content.pm.LauncherApps.ShortcutQuery) List(java.util.List) ArrayList(java.util.ArrayList) ShortcutManagerTestUtils.cloneShortcutList(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.cloneShortcutList)

Aggregations

ShortcutQuery (android.content.pm.LauncherApps.ShortcutQuery)24 ComponentName (android.content.ComponentName)4 ShortcutInfo (android.content.pm.ShortcutInfo)4 ShortcutManagerTestUtils.cloneShortcutList (com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.cloneShortcutList)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4