Commit Graph

25 Commits

Author SHA1 Message Date
Till Kottmann
6412e65501 Display sesame shortcuts inline with DeepShortcuts 2018-08-26 12:52:37 +07:00
paphonb
31af9a2841 Support launching app shortcuts from gesture 2018-07-28 18:19:32 +07:00
paphonb
ec4bc06a49 Experimental new custom title 2018-05-20 15:36:28 +07:00
paphonb
66c66d858b Merge remote-tracking branch 'amirzaidi_github/o-mr1' into v2-alpha 2018-03-12 19:25:19 +07:00
Amir Zaidi
b3ca3321f2 Rewrite permission checking and pinning for app shortcuts 2018-03-09 01:52:05 +01:00
paphonb
f18f7c320c Custom title for shortcuts 2018-02-25 12:52:13 +07:00
Amir Zaidi
7acd65e708 Backport app shortcuts to Android 6.0 and 7.0 2018-02-20 23:49:20 +01:00
Mario Bertschler
8ff9e1d679 Integrating suggested app by handling new status flags for shortcut items.
Guarded via feature flag SUGGESTED_APP.

Bug: 62483883

Change-Id: I7e0c8a9875bc37c435aa4316b44322a628cd4826
2017-08-24 12:23:06 -07:00
Tony
869a97da73 Promise icons don't support popup
Bug: 62253847
Change-Id: I1123f3d1efad65e74957b1404b5b2c95ba392713
2017-06-02 12:18:46 -07:00
Charles He
3ff9047221 Launcher3: fix app shortcuts for suspended apps
This CL fixes app shortcuts for suspended packages.

1) When DO/PO suspends an app, its pinned shortcuts are instantly grayed
out, but this is not persisted after the launcher restarts (e.g. device
reboot). We now enforce the launcher to check the suspended state when
loading the workspace, and gray out pinned shortcut icons accordingly.

2) When DO/PO suspends an app, its app shortcut popup is still
available. We now temporarily disable the popup when the app is
suspended, and persist the state across restarts.

Bug: 32365540
Test: manual, by following the steps in the bug above
Test: manual, by restarting the launcher package
Change-Id: I983d7c17fa198beca23b66459b50bd67b447bdd2
2017-02-21 20:23:50 +00:00
Sunny Goyal
7c74e4ae64 No more UserHandleCompat
Bug: 32745285
Change-Id: I762fb4e268c1afe48a1860ab12a4ccb3f626aa95
2016-12-15 22:06:10 -08:00
Sunny Goyal
dde4fd971e Changing DeepShortcutManager to have a singleton contructor instead
of getting it from LauncherAppState

This follows the design of other managers and makes it easier to access it
from other processes and non-ui thread.

Bug: 33032833
Change-Id: I8ad82ae5b6cc47bae885f9896985675c7dd0d5b8
2016-11-21 22:28:23 +05:30
Sunny Goyal
f5e3744637 Updating version check method names
Change-Id: If98851677545a9bbb9de308c23ff5c155a61a8bf
2016-11-02 10:31:41 -07:00
Sunny Goyal
b57c893db8 Removing some TODOs with proper system API
Change-Id: I0d0e667cd6af8a7b9dbf3d0fd417f009ae402519
2016-09-30 12:19:13 -07:00
Sunny Goyal
95f3d6ba2c Reloading workspace when the shortcuts permission changes
> Check for permission on every onResume
> If the permission is different than last known permission,
reload and rebind workspace.

Bug: 30789422
Change-Id: Idfa445815e29e2336505779545507d106b33a253
2016-08-10 17:00:15 -07:00
Sunny Goyal
49f4f03dc8 Handling IllegalStateException which can be thrown by the system when the user is locked
Bug: 30411561
Change-Id: I0d7fc0aaecba01b1aaac95b98654f6e3ee090ce8
2016-08-01 16:13:28 -07:00
Sunny Goyal
d3b87ef196 Adding quiet mode support for shortcuts
> LauncherApps returns empty list when the user is locked. Not relying on
LauncherApps in this case
> When the user is locked, removing all dynamic shortcuts
> Loading shortcuts from DB when the user is locked
> Verifying the shortcuts again when the user is available

Bug: 30411561
Change-Id: Ib6eb372c5b009cadb86a8f6e781f3f3cbf787ceb
2016-07-29 16:10:31 -07:00
Tony Wickham
2c99d2ceeb Implement ranking for shortcuts.
- Manifest shortcuts are closest to the original icon, in rank order,
  followed by dynamic shortcuts in rank order.
- Also prevent pinned shortcuts from showing in container if they
  aren't also dynamic (only manifest and dynamic show in container).

Bug: 29822383
Bug: 29946657
Change-Id: I5cdb2ef3700daedca01987f64c245beb3f4aa5ee
2016-07-19 13:53:26 -07:00
Tony Wickham
7b8f1eaba1 Address comments on original shortcuts UI CL (ag/1061538).
- Only add shortcut touch listener to APPLICATION item types, not SHORTCUT.
- Load shortcuts on LauncherModel worker thread instead of using AsyncTask.
- Avoid a couple of unnecessary object allocations.

Change-Id: I31b911b91df71335542545602fe137e270c745d7
2016-07-13 14:47:58 -07:00
Tony Wickham
d82a39da1c Add status to DeepShortcutManager api calls.
This way we can handle SecurityExceptions differently. For instance,
if a SecurityException causes us to fail to get details for pinned
shortcuts, we keep the pinned shortcuts in the database so that they
will be loaded next time launcher has the correct permissions.

Change-Id: I1102fce612ade10ad7f577b44a99c8cf087d5ccd
2016-07-13 12:02:33 -07:00
Tony Wickham
f25cea452f Use reflection to call LauncherApps.startShortcut().
This is necessary because it now returns void instead of boolean, but
we don't yet have the latest SDK with this change to compile against.

Change-Id: Ie4ca718bbe828fd9addfaf003a74b35d32410891
2016-07-01 13:03:37 -07:00
Tony Wickham
1bce7fd342 Long-press on an app to reveal its shortcuts.
- Add ShortcutsContainerListener to icons on workspace, folders, and
  all apps. This handles long-press and forwards following touches to
  the DeepShortcutsContainer that is created.
- Drag over shortcut before lifting finger to launch it.
- Shortcuts are rendered in pill-shaped DeepShortcutViews,
  which are inside DeepShortcutContainer on DragLayer.
- The shortcut container orients above or below the icon, and left or
  right-aligns with it. Biases for above + left-align.
- Long press a DeepShortcutPill to drag and pin it to the workspace.

Bug: 28980830
Change-Id: I08658d13ae51fe53064644e8d8f7b42f150fdd7d
2016-06-29 17:48:46 -07:00
Tony
acd86ff486 Surround shortcut API calls with try-catch.
Bug: 29732661
Change-Id: Iba96eedab67e7715f34139c64f96b1a81ba30ea5
2016-06-27 11:53:58 -07:00
Sunny Goyal
9994b2b171 Making some shortcut manager calls protected by MR1 version check
Change-Id: Ifdfa95a58aa18a825c1838c61055928dbe0ea3be
2016-06-23 14:55:56 -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