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
This commit is contained in:
Zak Cohen
2018-10-19 14:21:05 -07:00
parent dea579981c
commit 658c67a609
12 changed files with 49 additions and 61 deletions

View File

@@ -27,10 +27,10 @@ import com.android.launcher3.LauncherModel.Callbacks;
import com.android.launcher3.ShortcutInfo;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.MultiHashMap;
import com.android.launcher3.widget.WidgetListRowEntry;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.Executor;
/**
@@ -107,13 +107,9 @@ public abstract class BaseModelUpdateTask implements ModelUpdateTask {
}
public void bindDeepShortcuts(BgDataModel dataModel) {
final MultiHashMap<ComponentKey, String> shortcutMapCopy = dataModel.deepShortcutMap.clone();
scheduleCallbackTask(new CallbackTask() {
@Override
public void execute(Callbacks callbacks) {
callbacks.bindDeepShortcutMap(shortcutMapCopy);
}
});
final HashMap<ComponentKey, Integer> shortcutMapCopy =
new HashMap<>(dataModel.deepShortcutMap);
scheduleCallbackTask(callbacks -> callbacks.bindDeepShortcutMap(shortcutMapCopy));
}
public void bindUpdatedWidgets(BgDataModel dataModel) {