Commit Graph

4 Commits

Author SHA1 Message Date
Rajeev Kumar
14c3389dfe Revert changes made in http://ag/2388716 as we have few open questions
about the performance loss because of this CL.

Change-Id: I4c499b176dbd80a31f2088ece27346077fbbcdec
Bug: 62466540
2017-06-09 17:13:23 -07:00
Rajeev Kumar
93527e2c5d Replace use of java.util.HashMap with android.support.v4.util.ArrayMap.
Note: I could not use android.util.ArrayMap as it is a final class.

Change-Id: I1314961885dfbaa427cb830bdbd3d1f494be63d2
Bug: 62466540
2017-06-09 15:19:06 -07:00
Sunny Goyal
5f06401807 Fixing potential ConcurrentModificationException
mBgDeepShortcutMap is only accessed on the background thread. But
the same instance of list of values was getting passed to the UI
thread, instead of being cloned.

Change-Id: Ie7d0442d895304489ce9323ea872b9091d668ae5
2016-08-08 10:13:33 -07:00
Tony Wickham
bfbf7f9f4a Add support for launcher shortcuts.
- This CL has no UI but provides the necessary backing for one.
- Adds new item type: ITEM_TYPE_DEEP_SHORTCUT, to distinguish from
  ITEM_TYPE_SHORTCUT. We can reconsider these names.
- Adds ShortcutCache, using LruCache for up to 30 dynamic shortcuts
  (pinned shortcuts are always cached in a HashMap).
- DeepShortcutManager queries for shortcuts and other things like
  pin them. In a future CL it will use the cache, but for now it
  simply makes an RPC for all queries.
- LauncherModel maintains counts for pinned shortcuts, pinning and
  unpinning when counts reach 1 or 0, respectively.
- LauncherModel maintains a map of components to lists of shortcut ids,
  which Launcher gets a copy of after it is changed in the background.
  This will allow us to know how many shortcuts an app has immediately,
  and query for details as the UI is animating.

Change-Id: Ic526f374dd10d72a261bae67f07f098fca8d8bca
2016-06-21 15:49:16 -07:00