Commit Graph

10334 Commits

Author SHA1 Message Date
Andy Wickham d386d7da7c Forces OveriewInputConsumer to be used when Assistant is running on top of Launcher.
Previously it was using OtherActivityInputConsumer, which got things in a
pretty weird state (e.g. most recent app would appear in the center as if
it was the active app when you started Quick Switching, etc.).

By default (toggleable by a feature flag), OverviewWithoutFocusInputConsumer
is used because Assistant doesn't seem to respect the CLOSE_SYSTEM_DIALOGS
broadcast, at least in half-shelf mode. In this case, the Home intent is
sent on swipe up, or you can dismiss it with the back gesture or by tapping
above the half shelf.

The new feature flag ASSISTANT_GIVES_LAUNCHER_FOCUS routes touches through
OverviewInputConsumer. As opposed to OverviewWithoutFocusInputConsumer,
this allows Quick Step to work while Assistant is running. Additional logic
is added to dismiss the Assistant when appropriate. Note that the dismissal
happens atomically, so it's not completely fluid with the other animations.
As mentioned above, this is disabled by default because Assistant doesn't
currently respect CLOSE_SYSTEM_DIALOGS.

Demo with the flag enabled (and Assistant respecting CLOSE_SYSTEM_DIALOGS):
https://drive.google.com/open?id=1W5jGpn_TEC-KjrYwQtaBT3pzxG_5tC4W

Bug: 139661510
Change-Id: I261653118aff289b329ec2a7ca6e52f100f7835a
Tested: Manually used quick switch after invoking Assistant from home screen.
2019-10-29 14:25:29 -07:00
Sunny Goyal 14168431bd Adding support for dynamic calendar and clock icons
Change-Id: Icdba34340a27a4f6dff7310d0bf9fd29aef1330c
2019-10-29 13:50:02 -07:00
Jonathan Miranda 632bcf76af Merge "Fix NPE caused by an install flow where we decode the LauncherActivityInfo but we don't fill in the data Intent." into ub-launcher3-qt-future-dev
am: dafd8d9225

Change-Id: If55021b2aa2c031adc132b9b4404d4d6fb1a8003
2019-10-29 12:17:45 -07:00
Jonathan Miranda dafd8d9225 Merge "Fix NPE caused by an install flow where we decode the LauncherActivityInfo but we don't fill in the data Intent." into ub-launcher3-qt-future-dev 2019-10-29 19:03:25 +00:00
TreeHugger Robot bec28445ea Merge "Removing tracing for a fixed bug" into ub-launcher3-master 2019-10-29 00:32:31 +00:00
vadimt 5631b4a7ef Removing tracing for a fixed bug
Bug: 141770616
Change-Id: I52ec681eca20733021090fe50058bc7d3f996ade
2019-10-28 16:59:45 -07:00
Sunny Goyal 3808a69a6c Storing BitmapInfo instead of icon and color directly in itemInfo
This will allow subclassing BitmapInfo to support custom icon/dynamic
icons which can be loaded on the background thread instead of going
through IconFactory which runs on UiThread

Change-Id: Ieced6e91330bdff1b505826d097a8df711dfe967
2019-10-28 11:12:47 -07:00
TreeHugger Robot ac04c5fd31 Merge "Reducing chances for the object with finalizer to be reffed by register" into ub-launcher3-master 2019-10-26 03:37:19 +00:00
vadimt 56b800bfea Reducing chances for the object with finalizer to be reffed by register
As suggested in b/143155020#comment27

Bug: 143155020
Change-Id: I4ed87a003fcd7afde213014fc1ba8b004500e71a
2019-10-25 18:12:25 -07:00
TreeHugger Robot db7631ba4b Merge "14/ Bake the running task info into the gesture state" into ub-launcher3-master 2019-10-26 00:43:31 +00:00
Tony Wickham 7af5033e49 Add BothAxesSwipeDetector
This reports both x and y displacement, and both velocities onDragEnd().

Bug: 126596417
Change-Id: I1c62074b99fe21bc9eedf615e3c9a0a0a400bf81
2019-10-25 16:54:41 -07:00
TreeHugger Robot 7744b8251a Merge "Moving some notification binder calls to worker thread" into ub-launcher3-master 2019-10-25 22:56:44 +00:00
Tony Wickham 329fca4550 Move overview haptic feedback to VibratorWrapper singleton
Bug: 141886704
Change-Id: I0178a52088dd4150d7ba054983697ea63a00d9a8
Merged-In: I0178a52088dd4150d7ba054983697ea63a00d9a8
2019-10-25 22:53:21 +00:00
Winson Chung a19a2b755f 14/ Bake the running task info into the gesture state
- This removes a bunch of places where we pass it through the gesture flow

Bug: 141886704
Change-Id: I28d2c53b0300c614ed074746b06f2d548b5e8cc7
2019-10-25 15:47:19 -07:00
Tony Wickham 052c881415 Move overview haptic feedback to VibratorWrapper singleton
Bug: 141886704
Change-Id: I0178a52088dd4150d7ba054983697ea63a00d9a8
2019-10-25 21:48:22 +00:00
Jon Miranda 4459e3f6f9 Fix NPE caused by an install flow where we decode the LauncherActivityInfo
but we don't fill in the data Intent.

Bug: 143190879
Change-Id: I8f774203b99f022b2cf1708de6d8fe2398b332ce
2019-10-25 14:24:05 -07:00
Jon Miranda 2bdd24340d Cleaning up unused allAppsIconSize/allAppsIconTextSize variables.
Change-Id: Ifb77458ca0febdf97a806c34e6d1c16f41789d35
2019-10-25 12:01:45 -07:00
vadimt 23c8341096 Removing tracing and @Stability for a fixed bug
Bug: 142514365
Change-Id: I147850db274c465fb964eca30b97b3ebaaa2ccf6
2019-10-25 11:21:33 -07:00
TreeHugger Robot 0c7b01a694 Merge "Add support for work profile promise icons." into ub-launcher3-qt-future-dev 2019-10-24 23:17:43 +00:00
Jon Miranda 7c76a33243 Add support for work profile promise icons.
- We were not getting callbacks for sessions created under work profile.
- We did not pass in the user when creating the workspace item infos.
- Added check for if app is installed before adding item to workspace
  to prevent any stale promise icons. This seems to happen when uninstalling
  and then immediately reinstalling an application.

Bug: 141556707
Change-Id: Ie0320f3ede70b6c7543cb60c3b95a2fe398eecb5
Merged-In: I2db2d8da449c37eb248a59fbc9e7b517f50855c1
2019-10-24 23:07:04 +00:00
Jon Miranda 26256f79c3 Fix work profile promise icon bugs.
- We did not pass in the user when creating the workspace item infos.
- Added check for if app is installed before adding item to workspace
  to prevent any stale promise icons. This seems to happen when uninstalling
  and then immediately reinstalling an application.

Bug: 141556707
Change-Id: I2db2d8da449c37eb248a59fbc9e7b517f50855c1
2019-10-24 13:27:41 -07:00
Tony Wickham eed585b0c3 Refactor SwipeDetector to track both axes
Existing clients now use the SingleAxisSwipeDetector subclass. A
followup CL will add BothAxesSwipeDetector, whose first client will be
the quick switch from home controller.

Bug: 126596417
Change-Id: I54c71088cfe99ff28cdc719a1eb7a7d06ac95d2d
Merged-In: I54c71088cfe99ff28cdc719a1eb7a7d06ac95d2d
2019-10-24 18:56:44 +00:00
TreeHugger Robot b7d463e74c Merge "Refactor SwipeDetector to track both axes" into ub-launcher3-master 2019-10-24 18:36:51 +00:00
Tony Wickham 5aeb3b84b8 Refactor SwipeDetector to track both axes
Existing clients now use the SingleAxisSwipeDetector subclass. A
followup CL will add BothAxesSwipeDetector, whose first client will be
the quick switch from home controller.

Bug: 126596417
Change-Id: I54c71088cfe99ff28cdc719a1eb7a7d06ac95d2d
2019-10-24 10:38:17 -07:00
Sunny Goyal 3a1eadd37b Adding support for remote app action provider.
> Connect to a predefined content provider to get package specific action
> Add that action to shortcut menu and task menu

Change-Id: Ide5c09d04112e86c8e19c2f9e66c88c15b3fd04e
2019-10-23 17:51:13 -07:00
Sunny Goyal 7805d49764 Separating SystemShortcut and Factory
> This makes easier to extend the factory and callbacks separately
> Availability checks are only performed once when getting the shortcut

Change-Id: I413541eabfb2b9e987c852d5171c6696b1853958
2019-10-23 12:57:50 -07:00
Sunny Goyal c78308a9a7 Merge "Subclassing Launcher instead of using UiFactory" into ub-launcher3-master 2019-10-22 19:21:11 +00:00
Sunny Goyal 7c53d355bf Moving some notification binder calls to worker thread
Change-Id: I16c4aded7b709282a9b3d0df64111a9a40366b50
2019-10-21 15:01:10 -07:00
Sunny Goyal 210e174c9c Subclassing Launcher instead of using UiFactory
Allows us to override only the required methods, instead of providing
a proxy method for everything

Change-Id: I816dcdb2a8d5432496050118ded0f2bbe7122cf7
2019-10-21 11:10:21 -07:00
vadimt 7fcbd2379b Fixing activity leak on config change
If attachTo happens before the view is attached to window,
ViewOnDrawExecutor hooks to the tree observer twice (second time from
onViewAttachedToWindow). It only unhooks once.

Since tree observer is global, this leads to leaking the activity, and
besides, all old activities getting the events from the tree observer.

Bug: 139137636
Change-Id: Ie2641b8f3614545052fe34ad6588b070c3b82a33
(cherry picked from commit ebb5c75344)
2019-10-18 19:36:26 +00:00
Vadim Tryshev 47ed07d708 Merge "Fixing activity leak on config change" into ub-launcher3-master 2019-10-18 19:26:56 +00:00
vadimt ebb5c75344 Fixing activity leak on config change
If attachTo happens before the view is attached to window,
ViewOnDrawExecutor hooks to the tree observer twice (second time from
onViewAttachedToWindow). It only unhooks once.

Since tree observer is global, this leads to leaking the activity, and
besides, all old activities getting the events from the tree observer.

Bug: 139137636
Change-Id: Ie2641b8f3614545052fe34ad6588b070c3b82a33
2019-10-18 11:34:21 -07:00
Winson Chung cebfec6245 Skip waiting for idle if the message queue is already idle
Bug: 142514365
Change-Id: I22eb94c234766a40eac4c8dcc33d204b2417c2d6
2019-10-17 22:51:40 -07:00
Winson Chung c9bf6d45ac 9/ Clean up swipe shared state
- Add TaskAnimationManager which keeps track of the animation state whose
  lifecycle can be longer than the gesture.  Move some of the logic related
  to cleaning up old animations into this class (called when the state is
  shared across gestures).
- Instead of calling into the shared state directly via UIFactory, add
  callback to cleanup the animation and shared state from Launcher

Bug: 141886704

Change-Id: Ib6140b37162f7460a20fa1046cfd4f4068e4a1c6
Signed-off-by: Winson Chung <winsonc@google.com>
2019-10-16 17:17:34 -07:00
Jonathan Miranda 643598987b Merge "Have consistent All Apps UI between grid size changes." into ub-launcher3-qt-future-dev
am: c3a688a973

Change-Id: I6c9d825e85f55bd3160ab5e2a37e707f3f525459
2019-10-16 15:51:36 -07:00
Jonathan Miranda c3a688a973 Merge "Have consistent All Apps UI between grid size changes." into ub-launcher3-qt-future-dev 2019-10-16 22:36:17 +00:00
Pinyao Ting 7242db1a7c Revert "Revert "Revert "Revert "Revert "cache shourtcut image"""""
This reverts commit 28dc8de660.

Reason for revert: the code change introduces significant delay when saving deep shortcut icons in cache.

Change-Id: I5d67ac0c4c867a40e882b7a46be446f8f7f63ac7
2019-10-16 14:52:28 -07:00
TreeHugger Robot 55395ea8f6 Merge "Revert "fetch and update shortcut icons in background thread"" into ub-launcher3-master 2019-10-16 21:49:09 +00:00
Pinyao Ting 01c80d7a00 Revert "fetch and update shortcut icons in background thread"
This reverts commit 4ec390e490.

Reason for revert: the code change introduces significant delay when saving deep shortcut icons in cache.

Bug: 142514365
Change-Id: If7a69844aba7f32690ff347f2db11f0a8041b9e4
2019-10-16 20:51:22 +00:00
Winson Chung 5cc62c7d0b Fix a couple trace issues
- Adding trace tokens since we can be starting/ending traces out of order
- Fixing issue with draw hitting twice causing the trace stack to be
  popped twice
- Fix issue with endFlagOverrides not removing from the stack

Bug: 142803200

Change-Id: I8649b94249910a352f00f2f2c2459c355d2bab00
2019-10-16 12:34:58 -07:00
Jon Miranda 64d7481597 Have consistent All Apps UI between grid size changes.
We build an IDP with no grid size override values. This
allows us to reference the profile measurements so that we can have a
consistent UI for areas that the grid size change should not affect.

Bug: 124967099
Change-Id: I6235862c95800d8f31dbf2de1d12b1fcf4dbd850
2019-10-16 11:21:36 -07:00
Tony Wickham 5347f0c5f6 Merge "Fix mSubtractDisplacement when recatching" into ub-launcher3-qt-future-dev
am: ab732f0baa

Change-Id: I26ab6eb11e0ef1c53c96585ad069e1a0da629bca
2019-10-15 12:19:12 -07:00
Tony Wickham 14b919e2fd Fix mSubtractDisplacement when recatching
Previously we correctly set mSubtractDisplacement when re-catching
during the SETTLING state, but then immediately overrode it to be
+/-mTouchSlop.

Test: Swipe up to all apps, catch it by touching down during the
transition, ensure there's no jump when starting to move again.

Change-Id: I5d543e8a8b027b68bafb26b752e70862f6ae0777
2019-10-15 11:35:15 -07:00
vadimt 6c484bc9bf More logging for a lab-only bug
Bug: 142514365
Change-Id: I9936415fc4f3bfd4676d607f2dfff44070409c0c
2019-10-15 10:55:58 -07:00
TreeHugger Robot 8099e194d7 Merge changes from topic "shortcut-worker-thread" into ub-launcher3-master
* changes:
  fetch and update shortcut icons in background thread
  Revert "Revert "Revert "Revert "cache shourtcut image""""
2019-10-15 17:42:40 +00:00
TreeHugger Robot d410c1b829 Merge "include error log to debug the issue custom shortcut not working" into ub-launcher3-master 2019-10-15 17:01:10 +00:00
Pinyao Ting 4ec390e490 fetch and update shortcut icons in background thread
Bug: 141568904
Test: Manually verified use cases from following call-site (with and
without delay)

LauncherAppsCompatVO
  1. (Custom Shortcut) Long click on google maps -> widgets ->
     drag driving mode to workspace.
  2. Open chrome -> add to home screen -> add -> add automatically.

InstallShortcutReceiver
  Removed the line that trigger above flow for android O and above,
  then open chrome -> add to home screen -> add -> add automatically.

ShortcutDragPreviewProvider
  qdb -> long press on suggested app that has deep shortcut -> drag
  to workspace.

Change-Id: I59a4d004913a8df697af1fcfe0a080b6da01eefd
2019-10-15 09:54:09 -07:00
Pinyao Ting 28dc8de660 Revert "Revert "Revert "Revert "cache shourtcut image""""
This reverts commit 52908c9adc.

Reason for revert: roll-forward and fixes the crash due to access icon cache on main thread

Bug: 141568904
Change-Id: I1274db349c4f508d9cf59735b5f15180bb0ec033
2019-10-15 09:54:09 -07:00
vadimt 54e0c9e49c Tracing to determine why the model doesn't load
Bug: 142514365
Change-Id: I30ecaec5a5d0868db10157c61a2a8d7dd12872ca
2019-10-14 18:39:10 -07:00
Pinyao Ting b9f25e631b include error log to debug the issue custom shortcut not working
Bug: 141568904
Change-Id: I7e6b9aa4c3e1314aee18cbea81efa881b574923c
2019-10-14 15:55:21 -07:00