Commit Graph

2792 Commits

Author SHA1 Message Date
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 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
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
Winson Chung 9196cb11a2 8.5/ Follow up to comments from previous CLs
Bug: 141886704
Change-Id: Ib583753e35e57eab3b1cc413a0f910cf10142e42
2019-10-16 17:17:34 -07:00
Winson Chung 40f8756793 Merge "Fix a couple trace issues" into ub-launcher3-master 2019-10-16 20:54:43 +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
Tony Wickham 6b62f28ef9 Fix quick switch test gesture in landscape 2-button mode
am: a0f77c4449

Change-Id: I998081a53a94ff3b1559a7e77d4d470056cfab00
2019-10-15 21:20:24 -07:00
Tony Wickham a0f77c4449 Fix quick switch test gesture in landscape 2-button mode
It should swipe from the bottom right to top right when the nav bar is
on the right, rather than from the bottom left to bottom right.

For now, disable testQuickSwitchFromApp() because it seems to have
other failures as well.

Bug: 140252765
Change-Id: I1f4989f3ea5456c18bb9cbf42ea4b157cee500d7
2019-10-15 17:30:47 -07:00
Sunny Goyal 91ac68284e Changing the taskAffinity for LockScreenRecentsActivity so that other activities do
not get started in this task

Bug: 138473688
Change-Id: I63b72236496a818d08ccb14e02e4fbf698a0cc49
(cherry picked from commit 657d3f8ca7)
2019-10-15 20:45:02 +00:00
Sunny Goyal 657d3f8ca7 Changing the taskAffinity for LockScreenRecentsActivity so that other activities do
not get started in this task

Bug: 138473688
Change-Id: I63b72236496a818d08ccb14e02e4fbf698a0cc49
2019-10-15 12:06:46 -07:00
Andy Wickham bdf1687f57 Merge "Fades out Assistant when entering Overview." into ub-launcher3-qt-future-dev 2019-10-14 23:46:32 +00:00
Andy Wickham fb578e4528 Fades out Assistant when entering Overview.
This makes the transition smoother, since
the Assistant goes away at the end of it.

Note this only applies to the transition
while an app other than Launcher is live.

Before: https://drive.google.com/open?id=18SOWTtTUzt19TReAYnofQLIShJ2I-odP
After: https://drive.google.com/open?id=1hqsikXSlCnSvNg0ZQYHxP-OIbS5yt9aW

Bug: 136282913
Change-Id: Ia53c2407c82725c776f27b0d6e80a34554b4a303
Merged-In: Ia53c2407c82725c776f27b0d6e80a34554b4a303
Tested: Manually
2019-10-14 16:04:33 -07:00
TreeHugger Robot 6a3a09940f Merge "Fades out Assistant when entering Overview." into ub-launcher3-master 2019-10-14 22:43:26 +00:00
Andy Wickham 68e01dda46 Fades out Assistant when entering Overview.
This makes the transition smoother, since
the Assistant goes away at the end of it.

Note this only applies to the transition
while an app other than Launcher is live.

Before: https://drive.google.com/open?id=18SOWTtTUzt19TReAYnofQLIShJ2I-odP
After: https://drive.google.com/open?id=1hqsikXSlCnSvNg0ZQYHxP-OIbS5yt9aW

Bug: 136282913
Change-Id: Ia53c2407c82725c776f27b0d6e80a34554b4a303
Tested: Manually
2019-10-14 15:33:59 -07:00
TreeHugger Robot 6c12641bee Merge "Unifying various tracing calls" into ub-launcher3-master 2019-10-14 22:29:59 +00:00
Sunny Goyal 17c72fbb60 Unifying various tracing calls
Change-Id: Iedf6662ad1d7281b850bdc43b3a1e373ce535ac6
2019-10-14 14:23:19 -07:00
Tony Wickham 2f767469ae Merge "Add tests for quick switch from an app and home" into ub-launcher3-qt-future-dev
am: 7a2076e3ab

Change-Id: Id525dae6616757688ccf0e203fefeb9bd6ef08ff
2019-10-14 12:20:37 -07:00
Tony Wickham 7a2076e3ab Merge "Add tests for quick switch from an app and home" into ub-launcher3-qt-future-dev 2019-10-14 19:07:37 +00:00
TreeHugger Robot e1c8f87c46 Merge "Adding tracing for a lab-only flake" into ub-launcher3-master 2019-10-14 18:52:42 +00:00
Tony Wickham 1e73e320b7 Add tests for quick switch from an app and home
Bug: 140252765
Change-Id: I5621b614ae2d8cd3db03cae818cf8b8c1c6cb20f
2019-10-14 11:51:19 -07:00
Sreyas Rangaraju 65d208211d Merge "Create hooks for Recents Card plugin. This adds another card in the Recents Overview space which can show various items." into ub-launcher3-qt-future-dev 2019-10-14 18:41:19 +00:00
vadimt ce25a2bf68 Adding tracing for a lab-only flake
Bug: 142514365
Change-Id: I9c93ecabbcbad6d4683d595587831d8465e62ee8
2019-10-14 11:34:38 -07:00
TreeHugger Robot d2b03972f5 Merge "Suppress ViewInflationDuringSwipeUp test." into ub-launcher3-master 2019-10-14 18:10:34 +00:00
Zak Cohen eb27edffc2 Suppress ViewInflationDuringSwipeUp test.
Test is failing and blocking drop.
Only failing on TH, passing locally.
Tracked in b/141579810

Bug:141579810
Change-Id: Iadf8098cad22835b026984c0a9ea5122054b484b
2019-10-14 10:55:15 -07:00
TreeHugger Robot 4009493f3c Merge "Wait for the task to be in recents before validation" into ub-launcher3-master 2019-10-12 00:20:10 +00:00
Winson Chung c062580b5a Wait for the task to be in recents before validation
- There are two issues:
  1) Currently the system does not add the task to the task list until
     the activity starting the task has been resumed (to be fixed in a
     follow up platform CL). When the three activities are started in
     sequence, it's possible for one of the activities to not reach the
     resumed state leading to an unexpected number of recent tasks the
     next time it's fetched.
  2) When swiping up, it may take time for getTasks to return and call
     applyLoadPlan, so try and wait until the task views have had a
     chance to be applied before continuing.
  3) Use the launcher activity tracker instead of activity rule since it
     will return the same activity even after the activity is destroyed
- Move the margin handling to the caller instead of the scroll method

Bug: 141580748
Change-Id: I2b7634f5ac6869ba4b369b3bd60e0f63747c0f0b
2019-10-11 17:10:38 -07:00
Sreyas 8e02d17fa2 Create hooks for Recents Card plugin.
This adds another card in the Recents Overview space which can show various items.

Change-Id: Ifc36639ece8aa6b554bdbd3256f4195b1b220d68
Merged-In: Ifc36639ece8aa6b554bdbd3256f4195b1b220d68
2019-10-11 21:05:08 +00:00
Sreyas 59b148a440 Create hooks for Recents Card plugin.
This adds another card in the Recents Overview space which can show various items.

Change-Id: Ifc36639ece8aa6b554bdbd3256f4195b1b220d68
2019-10-11 11:48:22 -07:00
Bill Yi e2c21704eb Import translations. DO NOT MERGE
Change-Id: I2ce1448b6a7ee5cb455a2fc044336c37e03093aa
Auto-generated-cl: translation import
2019-10-11 08:19:31 -07:00
Winson Chung c039634c25 Workaround for failing test & fix scrolling in tests
- Workaround issue where instrumentation will fail to finish an activity
  causing the activity to linger longer than expected (leading to issues
  with ordering of static resources like the app widget host registration)
- Fix calculation for scrolling the screen, the previous calculation
  would result in the gesture starting at the left gesture margin due
  to rounding which can trigger a back action instead of the desired
  scroll

Bug: 142351228
Change-Id: I34bdb471030518d2b983cac2badd4d8b0e7d571b
2019-10-10 17:31:38 -07:00
TreeHugger Robot 012fbc78b4 Merge "Using SpringAnimationBuilder instead of SpringObjectAnimator in StaggeredWorkspaceAnim" into ub-launcher3-master 2019-10-08 22:53:50 +00:00
Winson Chung d7269bf8b6 8/ Rename ActivityControlHelper
- ActivityControlHelper -> BaseActivityInterface
  LauncherActivityControlHelper -> LauncherActivityInterface
  FallbackActivityControlHelper -> FallbackActivityInterface
  QuickCaptureTouchConsumer -> QuickCaptureInputConsumer
- Move gestures to use the activity interface from the gesture state

Bug: 141886704
Change-Id: I6f12daeb03d564143404767dfe4576e3e5da2a1d
2019-10-08 13:39:13 -07:00