summaryrefslogtreecommitdiff
path: root/src/com/android/launcher3/popup/PopupPopulator.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/popup/PopupPopulator.java')
-rw-r--r--src/com/android/launcher3/popup/PopupPopulator.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/com/android/launcher3/popup/PopupPopulator.java b/src/com/android/launcher3/popup/PopupPopulator.java
index 2b55405c06..dbfe9882f7 100644
--- a/src/com/android/launcher3/popup/PopupPopulator.java
+++ b/src/com/android/launcher3/popup/PopupPopulator.java
@@ -17,6 +17,7 @@
package com.android.launcher3.popup;
import android.content.ComponentName;
+import android.content.pm.ShortcutInfo;
import android.os.Handler;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
@@ -29,7 +30,6 @@ import com.android.launcher3.notification.NotificationInfo;
import com.android.launcher3.notification.NotificationKeyData;
import com.android.launcher3.shortcuts.DeepShortcutManager;
import com.android.launcher3.shortcuts.DeepShortcutView;
-import com.android.launcher3.shortcuts.ShortcutInfoCompat;
import com.android.launcher3.util.PackageUserKey;
import java.util.ArrayList;
@@ -54,10 +54,10 @@ public class PopupPopulator {
/**
* Sorts shortcuts in rank order, with manifest shortcuts coming before dynamic shortcuts.
*/
- private static final Comparator<ShortcutInfoCompat> SHORTCUT_RANK_COMPARATOR
- = new Comparator<ShortcutInfoCompat>() {
+ private static final Comparator<ShortcutInfo> SHORTCUT_RANK_COMPARATOR
+ = new Comparator<ShortcutInfo>() {
@Override
- public int compare(ShortcutInfoCompat a, ShortcutInfoCompat b) {
+ public int compare(ShortcutInfo a, ShortcutInfo b) {
if (a.isDeclaredInManifest() && !b.isDeclaredInManifest()) {
return -1;
}
@@ -76,11 +76,11 @@ public class PopupPopulator {
* @param shortcutIdToRemoveFirst An id that should be filtered out first, if any.
* @return a subset of shortcuts, in sorted order, with size <= MAX_SHORTCUTS.
*/
- public static List<ShortcutInfoCompat> sortAndFilterShortcuts(
- List<ShortcutInfoCompat> shortcuts, @Nullable String shortcutIdToRemoveFirst) {
+ public static List<ShortcutInfo> sortAndFilterShortcuts(
+ List<ShortcutInfo> shortcuts, @Nullable String shortcutIdToRemoveFirst) {
// Remove up to one specific shortcut before sorting and doing somewhat fancy filtering.
if (shortcutIdToRemoveFirst != null) {
- Iterator<ShortcutInfoCompat> shortcutIterator = shortcuts.iterator();
+ Iterator<ShortcutInfo> shortcutIterator = shortcuts.iterator();
while (shortcutIterator.hasNext()) {
if (shortcutIterator.next().getId().equals(shortcutIdToRemoveFirst)) {
shortcutIterator.remove();
@@ -96,11 +96,11 @@ public class PopupPopulator {
// The list of shortcuts is now sorted with static shortcuts followed by dynamic
// shortcuts. We want to preserve this order, but only keep MAX_SHORTCUTS.
- List<ShortcutInfoCompat> filteredShortcuts = new ArrayList<>(MAX_SHORTCUTS);
+ List<ShortcutInfo> filteredShortcuts = new ArrayList<>(MAX_SHORTCUTS);
int numDynamic = 0;
int size = shortcuts.size();
for (int i = 0; i < size; i++) {
- ShortcutInfoCompat shortcut = shortcuts.get(i);
+ ShortcutInfo shortcut = shortcuts.get(i);
int filteredSize = filteredShortcuts.size();
if (filteredSize < MAX_SHORTCUTS) {
// Always add the first MAX_SHORTCUTS to the filtered list.
@@ -140,13 +140,13 @@ public class PopupPopulator {
uiHandler.post(() -> container.applyNotificationInfos(infos));
}
- List<ShortcutInfoCompat> shortcuts = DeepShortcutManager.getInstance(launcher)
+ List<ShortcutInfo> shortcuts = DeepShortcutManager.getInstance(launcher)
.queryForShortcutsContainer(activity, user);
String shortcutIdToDeDupe = notificationKeys.isEmpty() ? null
: notificationKeys.get(0).shortcutId;
shortcuts = PopupPopulator.sortAndFilterShortcuts(shortcuts, shortcutIdToDeDupe);
for (int i = 0; i < shortcuts.size() && i < shortcutViews.size(); i++) {
- final ShortcutInfoCompat shortcut = shortcuts.get(i);
+ final ShortcutInfo shortcut = shortcuts.get(i);
final WorkspaceItemInfo si = new WorkspaceItemInfo(shortcut, launcher);
// Use unbadged icon for the menu.
LauncherIcons li = LauncherIcons.obtain(launcher);