Commit Graph

2822 Commits

Author SHA1 Message Date
Tracy Zhou 263cebc2bd Finish the current task in live tile mode when swiping up and right to the previous task
Fixes: 143714109
Test: manual
Change-Id: I65689d49679e073be7fd51b92dd72f71ae11f37c
2019-10-31 14:12:27 -07:00
TreeHugger Robot de6770a2ec Merge "Adding support for dynamic calendar and clock icons" into ub-launcher3-master 2019-10-30 18:16:28 +00:00
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
Sally Yuen 70d7860eae Merge "Fix TalkBack page announcments in RecentsView" into ub-launcher3-master 2019-10-28 19:10:51 +00: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
Winson Chung 4998b19307 15/ Move some more logic into gesture/device state
- Bake overview/home component into the gesture state (it should never
  change mid-gesture), this allows us to remove OverviewComponentObserver
  refs from the handlers
- Move nav bar position into DeviceState
- Remove passing RecentsModel into the handlers, it already partially
  references it statically

Bug: 141886704
Change-Id: I62f9138651cbe1fb984b57b96e4212ebaa1ffb5d
2019-10-25 15:52:25 -07: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
Tracy Zhou c491463895 Merge "Fix unable to launch shortcuts in live tile mode." into ub-launcher3-master 2019-10-25 20:23:53 +00:00
TreeHugger Robot 2193689fe1 Merge "Merging task icon cache with content description cache" into ub-launcher3-master 2019-10-25 20:10:18 +00:00
Winson Chung b247608b3f Merge "Skip handling input while the user is still locked" into ub-launcher3-master 2019-10-25 19:35:43 +00:00
Sunny Goyal 9f975ed089 Merging task icon cache with content description cache
> Removing activity info cache as icon and description are loaded at the same time
> Invalidating icon if task cache is old

Bug: 38268585
Bug: 138944598
Change-Id: I28ae61a089556198534d48fcdb3aae6109748dff
2019-10-25 12:26:39 -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
Winson Chung fc8c975880 Skip handling input while the user is still locked
- None of the gestures work when the user is locked so
  we can just skip them.

Bug: 143107728
Test: Manual
Change-Id: I2661d58269f7eccbfcd2214792c128b432e0347c
2019-10-25 18:04:54 +00:00
Tracy Zhou 6b5b190324 Fix unable to launch shortcuts in live tile mode.
The finish recents animation callback is nullified when invalidateHandlerWithLauncher gets called.

Fixes: 143361207
Test: Turn on live tile mode, swipe up to Overview, try to launch an app from the shortcuts
Change-Id: Icce076f69cd38f54870229344266106360be6aa4
2019-10-25 10:58:11 -07:00
TreeHugger Robot a0b026a6ed Merge "Fix screenshot not getting cleaned up after recents animation cancelation" into ub-launcher3-master 2019-10-24 22:43:51 +00:00
Tracy Zhou 734f2d9f15 Fix screenshot not getting cleaned up after recents animation cancelation
Before this change, mCanceledThumbnail is used but never assigned.

Test: Turn on live tile, swipe up to overview from app and observe that the screenshot from recents animation gets properly cleaned up.
Fixes: 143307786
Change-Id: I8fba46324c43df661adf12cd1e5d9e06a0a3ee6f
2019-10-24 14:51:23 -07:00
TreeHugger Robot 949b96a82d Merge "Move addPluginListener to onUserUnlocked" into ub-launcher3-master 2019-10-24 21:26:34 +00:00
Winson Chung eed626a63c Move addPluginListener to onUserUnlocked
addPluginListener() needs to be moved into onUserUnlocked() since it
reads from the shared preferences. This fixes a crash in
Launcher3QuickStepGo on wembley.

Bug: 143249037
Change-Id: Ib60f688cb3f91e377141fab1ad9f2a0071c96694
2019-10-24 13:44:43 -07: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
TreeHugger Robot 6735624704 Merge "Adding support for remote app action provider." into ub-launcher3-master 2019-10-24 17:33:42 +00:00
sallyyuen cd0a5c536a Fix TalkBack page announcments in RecentsView
Because a PagedView has page a11y actions (PAGE_LEFT/RIGHT),
a11y services now identify recents apps as a pager.
Tweak the a11y event info to accomodate this so the announcements
are correct.
Also fix the CollectionItemInfo to have the correct page index.

Bug: 141899192
Test: Tested with TalkBack on device
Change-Id: Ic578bee8de26a41f0ab0e5468f1fd060ed21a7e1
2019-10-24 16:53:50 +00: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
TreeHugger Robot 85561d1e44 Merge "Fix testQuickSwitchFromApp" into ub-launcher3-master 2019-10-24 00:12:09 +00:00
TreeHugger Robot e60ae45b9e Merge "13/ Rely on the device state's navigation mode" into ub-launcher3-master 2019-10-23 23:45:52 +00:00
Tony Wickham bc42d64c85 Fix testQuickSwitchFromApp
Instead of starting getAppPackageName() and relying on it being our Test
Pin Item activity, instead launch our own test activities with the
FLAG_ACTIVITY_MULTIPLE_TASK and FLAG_ACTIVITY_NEW_DOCUMENT flags.

Test:
- Locally run testQuickSwitchFromApp() from Android Studio
- flake -oop -t com.android.quickstep.TaplTestsQuickstep#testQuickSwitchFromApp

Bug: 140252765
Change-Id: Ie137261ce65bfd3dd39df78d57784854a026e967
2019-10-23 23:42:19 +00:00
TreeHugger Robot 91fbe43990 Merge "Separating SystemShortcut and Factory" into ub-launcher3-master 2019-10-23 22:30:08 +00:00
Winson Chung a85365c22b 13/ Rely on the device state's navigation mode
- Rely on the device state navigation mode instead of tracking it
  independently in various places

Bug: 141886704
Change-Id: I421c1fa11ca7362aff8e2388a2b5d427b39af3e9
2019-10-23 15:00:59 -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
TreeHugger Robot 7caa519140 Merge "Step 4 from the plan below:" into ub-launcher3-master 2019-10-23 17:54:19 +00:00
Sunny Goyal c78308a9a7 Merge "Subclassing Launcher instead of using UiFactory" into ub-launcher3-master 2019-10-22 19:21:11 +00:00
James O'Leary 9e57e74005 QuickCaptureInputConsumer -> OverscrollInputConsumer + plugin
Test: Implemented plugin interface in Compose studiow build in
google_experimental, verified plugin shows up appropriately in
Launcher's home settings screen, verified gesture works if Compose
plugin enabled, and doesn't work if Compose plugin disabled.
Bug: n/a

Change-Id: Ica24ee8fe814ee02a1497a1bfbe7c7a24489b71e
2019-10-22 13:04:20 -04: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
TreeHugger Robot d78d80beca Merge "Skip updating launcher state if it's already destroyed" into ub-launcher3-master 2019-10-19 00:26:52 +00:00
Winson Chung 94302570e6 Skip updating launcher state if it's already destroyed
- Prior to ag/9526193, there were a mixture of getCreatedActivity() and
  passed in Activity calls. In the cases where we used the passed in
  activity, it would happily make the call even if the activity is already
  destroyed, but since we migrated to using the unified getCreatedActivity()
  call, it results in an NPE. Since it's unnecessary to update the destroyed
  activity, we can simply skip this work.

  Long term, we should consider baking the activity associated with the
  call into the activity interface, and ensure that the interface itself
  is updated whenever the activity is recreated.

Bug: 141886704

Change-Id: I4f043e455d8d0d1c1b86362cc72618018bfbd900
Signed-off-by: Winson Chung <winsonc@google.com>
2019-10-18 12:15:12 -07:00
vadimt ad81b816f0 Step 4 from the plan below:
1. Skip all tests that fail in inproc mode on CF (this CL)
2. Observe postsubmit and make sure no inproc tests are failing or too
flaky on CF
3. Enable presubmit
4. Switch to skipping tests from step 1 only for inproc presubmit;
they'll start failing in postsubmit
5. Gradually make all tests pass and not flaky and enable them back on
presubmit

Bug: 142828227
Change-Id: I0092d6b92b0358866f8cbf9e00dbe3fabe23703d
2019-10-17 17:52:29 -07:00
TreeHugger Robot 8625d0d8e7 Merge "Fix regression from ag/9518396" into ub-launcher3-master 2019-10-17 23:51:11 +00:00
Sreyas Rangaraju 5a6eb2d5df Merge "Alpha correction. mContentAlpha sometimes equals 0, changing to 1 ensures recents card always shows when supposed to" into ub-launcher3-master 2019-10-17 23:25:00 +00:00
Winson Chung dfd8b5e07d Fix regression from ag/9518396
- Previously, we would only cancel the current animation if
  sharedState.canBeContinued which was only set when mGestureEndTarget
  was set, which is only calculated when the swipe gesture ends,
  and is only true if the end target is not Launcher.

  In ag//9518396 the check for the null end target was moved into
  isRunningAnimationToLauncher(), but that call actually bakes in two
  checks together, which means that even when tapping the home button
  (where there is no gesture and no end target), it would return false.
  Instead, we should ensure that the gesture target is set before trying
  to cancel the animation.
- Also fix an existing issue where if the consumer is cleaned up after
  the start callback is registered, but not before the callback has
  returned, that we may incorrectly set the wrong launcher state since
  the callback is made to the old gesture handler which tries to prepare
  the recents UI (this manifests as a blank launcher screen).

Bug: 141886704
Change-Id: I642f20d631924730e98d10bb2123bd9448793fc6
2019-10-17 16:20:15 -07:00
Sreyas 3f18cc444d Alpha correction.
mContentAlpha sometimes equals 0, changing to 1 ensures recents card always shows when supposed to

Change-Id: I27eda97b72b75263c0aac09e2355bca72daecc27
2019-10-17 14:35:04 -07:00
TreeHugger Robot 221823c337 Merge "Fixing nulpointer exception in AOSP quickstep builds" into ub-launcher3-master 2019-10-17 21:03:15 +00:00
Sunny Goyal be336e0195 Fixing nulpointer exception in AOSP quickstep builds
Change-Id: I37e16b3c238f03306841713d0535eae5882b534d
2019-10-17 12:08:01 -07:00
Winson Chung 89eb36405d Skip setting the deferred launch callback if activity is already destroyed
Bug: 141886704
Change-Id: Iaa151335e5a3994a46406df399f2d159afe2c75e
2019-10-17 12:01:58 -07:00
TreeHugger Robot da6b9f7429 Merge "Preparing to enabling Inproc launcher tests as presubmit" into ub-launcher3-master 2019-10-17 06:45:13 +00:00
vadimt 3680357a67 Preparing to enabling Inproc launcher tests as presubmit
The plan:
1. Skip all tests that fail in inproc mode on CF (this CL)
2. Observe postsubmit and make sure no inproc tests are failing or too
flaky on CF
3. Enable presubmit
4. Switch to skipping tests from step 1 only for inproc presubmit;
they'll start failing in postsubmit
5. Gradually make all tests pass and not flaky and enable them back on
presubmit

Bug: 142828227
Change-Id: I6ea3d53771503e8fd968555bb2e4cb1be10d83ef
2019-10-16 17:35:18 -07:00
Winson Chung dd9d1ea1bf 12/ Clean up some ActivityInterface calls
- Require users of the activity interface to go through the interface to
  get the raw activity
- Remove calls that pass in the activity since the interface already can
  get the reference to it internally (and the interface always has the
  reference before the caller)

Bug: 141886704

Change-Id: I13e52caba593db918e8a7764c751044142fe7ece
Signed-off-by: Winson Chung <winsonc@google.com>
2019-10-16 17:18:12 -07:00
Winson Chung 981ef3a88a 11/ Update MultiStateCallbacks to support multiple callbacks
- Allow multiple callbacks to be set for the same state
- Expose method to set state on ui thread directly
- Ensure callbacks are made immediately if the state is already set
- Clarify that the one shot callbacks vs the state listeners

Bug: 141886704
Change-Id: I8ea0dcd2821ee18d071706eaddeb2852afa13f30
2019-10-16 17:18:11 -07:00
Winson Chung c80b3224aa 10/ Migrate shared state to the gesture state
- Instead of a shared state which is written into, gestures update their
  own gesture state and that state is passed to the next gesture.
- The existing shared state encoded the final end target (which is
  currently directly correlated with canGestureBeContinued). If we move
  the end target calculations to the GestureState, the handlers can listen
  for those changes and we can use the previous gesture state to decide
  which consumer to choose.  In addition, we move over the interrupted-
  finish-launch-task id.

Bug: 141886704

Change-Id: Icb6a3815c16b23692dbcde316114bd3cea06634e
Signed-off-by: Winson Chung <winsonc@google.com>
2019-10-16 17:17:34 -07:00