8 Commits

Author SHA1 Message Date
Makoto Onuki
a1d38b3c95 Fix some exception messages and enhance unit tets
Bug 29275393

Change-Id: Idaa8564d41f86de2a2cbefa4ff3c08b89a3a6dd2
2016-06-10 15:32:26 -07:00
Makoto Onuki
51ab2b3fd0 ShortcutManager: Break down unit tests
The test file is getting too big and making the IDE very slow.
Now it's split into multiple files

Change-Id: I50ed89f19defd3809f327bc21e7d9ea790dcde4e
2016-06-02 14:00:34 -07:00
Makoto Onuki
7001a61540 ShortcutManager: Implement max # of shortcuts
- Each activity (launcher icon) can have at most 5 dynamic +
manifest shortcuts.

Bug 28536066

Change-Id: Id34371d51c4a1c5e3df7debe3b71b535eb157b6c
2016-06-02 10:47:37 -07:00
Makoto Onuki
eddbfecb8d ShortcutManager: API rename
The words "title" and "text" implies that "text" is a secondary label
that's shown with the title, but it turned out the launcher would show
only one of those depending on how much space it has.

So now we change them to "shortLabel" and "longLabel"

Note we're only changing the API surface -- in order to mimimize
the impact to the code, internally we'll keep using the old names.

- Also remove "shortcutRank" while I'm here -- it should be implied
from the order of the XML elements.

Bug 29057378

Change-Id: I3203f63b0318c7462c1c61fef43cf9755fa8c008
2016-06-01 10:09:10 -07:00
Makoto Onuki
22fcc68e6b ShortcutManager: Support manifest shortcuts
- Now apps can publish shortcuts via AndroidManifest.xml
(Sample: I5b127150)

- Rename some APIs per API council feedback

- Publishers can now "disable" shortcuts.
(https://docs.google.com/presentation/d/1raUn1QBURDb1yrd6mSmVxII9ezNh3MWukODdtufJ29U/edit#slide=id.g13ef592464_7_39)

Bug 28785283
Bug 28536066

Change-Id: I4a126841e43e40139bb4baa6d0f98ad7b3a75ac1
2016-05-27 09:40:58 -07:00
Makoto Onuki
20c95f854e ShortcutManager: API changes for DR
See https://goto.google.com/shortcutmanager-spec-dr for
the details.

This CL contains changes to ShortcutInfo and all the new API
entry points, but not the implementation of the new APIs.

- ShortcutInfo.activityComponent is now mandatory.
- Publishers can now disable shortcuts.  ShortcutInfo can now have
"disabled message".
- ShortcutInfo now supports string resources for all the String
fields.
  -> When launcher fetches shortcuts, ShortcutService will
  automatically load resources and expose as strings.
- LauncherApps now supports getShortcutIconDrawable() and
getShortcutBadgedIconDrawable() to be consistent with
LauncherActivityInfo.

- ShortcutInfo.weight is replaced with "rank".

- Added ShortcutManager.reportShortcutUsed(), which will be used for
usage tracking / suggestion.

Bug 28536054
Bug 28536066
Bug 28564134
Bug 28594168

Change-Id: Ib8245b39bb1e753991a9de89c0b73accacd90355
2016-05-16 16:25:50 -07:00
Makoto Onuki
39686e8cde When app is updated, save the new version code, and update shortcuts
with resource based icons.

Bug 28152054

Change-Id: I14f537c08b1a0ba48dd508b0c42fc1d3ed4f5eb0
2016-04-15 12:33:15 -07:00
Makoto Onuki
5ba0d3e3a3 ShortcutManager: First cut of CTS
Bug 27548047

Change-Id: Idd7a768ea4fee44c2cf6e3bd473cea9e67f5f7cd
2016-04-11 14:48:44 -07:00