summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/popup/PopupContainerWithArrow.java
diff options
context:
space:
mode:
authorZak Cohen <zakcohen@google.com>2018-10-19 14:21:05 -0700
committerZak Cohen <zakcohen@google.com>2018-10-22 11:38:09 -0700
commit658c67a609161bc5958636636fbac81a872934b5 (patch)
tree9b9c975284d95f467602770e28d89f1ddaebbeeb /src/com/android/launcher3/popup/PopupContainerWithArrow.java
parentdea579981c489011aae8917260695323ba7f8f43 (diff)
downloadandroid_packages_apps_Trebuchet-658c67a609161bc5958636636fbac81a872934b5.tar.gz
android_packages_apps_Trebuchet-658c67a609161bc5958636636fbac81a872934b5.tar.bz2
android_packages_apps_Trebuchet-658c67a609161bc5958636636fbac81a872934b5.zip
Deepshortcuts - only keep the per package shortcut count in memory.
Change to only keep the per Activity shortcut count in memory, not the list of ids. The full shortcuts are loaded at long press time so saves memory. Bug:117239104 Test:Manual and ran instrumentation tests Change-Id: Iee974ecba2c977216be4f078396ceed22b931f5d
Diffstat (limited to 'src/com/android/launcher3/popup/PopupContainerWithArrow.java')
-rw-r--r--src/com/android/launcher3/popup/PopupContainerWithArrow.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index b9e6a98b4..4f1fcda12 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -216,13 +216,13 @@ public class PopupContainerWithArrow extends ArrowPopup implements DragSource,
BubbleTextView icon, ItemInfo item, SystemShortcutFactory factory) {
PopupDataProvider popupDataProvider = mLauncher.getPopupDataProvider();
populateAndShow(icon,
- popupDataProvider.getShortcutIdsForItem(item),
+ popupDataProvider.getShortcutCountForItem(item),
popupDataProvider.getNotificationKeysForItem(item),
factory.getEnabledShortcuts(mLauncher, item));
}
@TargetApi(Build.VERSION_CODES.P)
- protected void populateAndShow(final BubbleTextView originalIcon, final List<String> shortcutIds,
+ protected void populateAndShow(final BubbleTextView originalIcon, int shortcutCount,
final List<NotificationKeyData> notificationKeys, List<SystemShortcut> systemShortcuts) {
mNumNotifications = notificationKeys.size();
mOriginalIcon = originalIcon;
@@ -240,12 +240,12 @@ public class PopupContainerWithArrow extends ArrowPopup implements DragSource,
int viewsToFlip = getChildCount();
mSystemShortcutContainer = this;
- if (!shortcutIds.isEmpty()) {
+ if (shortcutCount > 0) {
if (mNotificationItemView != null) {
mNotificationItemView.addGutter();
}
- for (int i = shortcutIds.size(); i > 0; i--) {
+ for (int i = shortcutCount; i > 0; i--) {
mShortcuts.add(inflateAndAdd(R.layout.deep_shortcut, this));
}
updateHiddenShortcuts();
@@ -284,7 +284,7 @@ public class PopupContainerWithArrow extends ArrowPopup implements DragSource,
final Looper workerLooper = LauncherModel.getWorkerLooper();
new Handler(workerLooper).postAtFrontOfQueue(PopupPopulator.createUpdateRunnable(
mLauncher, originalItemInfo, new Handler(Looper.getMainLooper()),
- this, shortcutIds, mShortcuts, notificationKeys));
+ this, mShortcuts, notificationKeys));
}
private String getTitleForAccessibility() {