Commit Graph

1958 Commits

Author SHA1 Message Date
TreeHugger Robot
01a5b52b42 Merge "Fix a couple issues with overview to home transition" into ub-launcher3-rvc-qpr-dev 2020-08-26 21:54:08 +00:00
Tony Wickham
5c460a4663 Fix a couple issues with overview to home transition
- In fake portrait, fade out instead of translating offscreen, as
  the orientation doesn't map to where RecentsView actually lives
- From OverviewModalTaskState, start from > 1 scale, and use
  OverviewToHomeAnim (to ensure RecentsView doesn't fade out etc)
  - To keep parameter list sane, added RecentsParams to
    AnimatorControllerWithResistance which has the new startScale
    (set to current scale for modal state) and renames the old
    RecentsParams to RecentsResistanceParams. Sorry if that's
    confusing.

Bug: 144170434
Change-Id: Id36ebde440b398159cef50d95822627fca761527
Merged-In: I437f0d18cad4c94feea25954aed3390acedcaed5
2020-08-24 23:29:14 +00:00
TreeHugger Robot
93f595fd5a Merge "Set new scrimMultiplier instead of scrimProgress for overview -> home" into ub-launcher3-rvc-qpr-dev 2020-08-20 02:59:26 +00:00
Tony Wickham
375c602fc0 Set new scrimMultiplier instead of scrimProgress for overview -> home
Animating this new property allows us to adjust the scrim without
competing with other state animations that could be setting the
scrim progress. Also reset scrimMultipler = 1 for state transitions.

Test: Swipe from home to overview, then during that transition swipe
from overview to home; when the former transition ends while the
second is still in progress, ensure scrim value doesn't jump

Bug: 144170434
Change-Id: I44b57ced1c6902e558fe1818bcbf11ceb4ff2f6f
Merged-In: I44b57ced1c6902e558fe1818bcbf11ceb4ff2f6f
2020-08-20 02:49:30 +00:00
Pinyao Ting
96186aff87 Minimal Phone Mode (part-3)
Introduces a separate database for minimal device mode.

When minimal device mode is enabled/disabled:
1. WellbeingModel receives onChange event from ContentObserver
2. WellbeingModel called DWB's ContentProvider for latest state in
minimal device mode
3. Based on the state, WellbeingModel calls LauncherProvider to put
launcher into normal/minimal mode.
4. When going from normal -> minimal, Launcher switches to a different
database, namely minimal.db, then proceed to database initialization.
5. If the database hasn't been initialized yet, Launcher will call
ContentResolver#openInputStream with following uri:
content://com.google.android.apps.wellbeing.api/launcher_layout
to get the default layout xml.
6. The default layout is then saved in database, and the database is
considered initialized and doesn't need to go through step 5 again in
the future.
7. In case of minimal -> normal, Launcher switches back to its original
database (e.g. launcher.db if the grid size is 5x5), then reload launcher.

Bug: 161462256
Change-Id: I6bafa66440da23281f63454b698ea56b15960022
2020-08-19 14:58:20 -07:00
TreeHugger Robot
6c1a88f172 Merge "Track OverviewToHomeAnim with StateManager" into ub-launcher3-rvc-qpr-dev 2020-08-14 22:45:17 +00:00
Tony Wickham
9dfcc316c1 Track OverviewToHomeAnim with StateManager
This way we mark the the current state as NORMAL at the start of
the animation, and cancel it as part of other state transitions.
This allows us to interact with launcher (e.g. to go to all apps
or pull down the notification shade) during the animation.

Also use OverviewToHomeAnim from RecentsView#startHome() to
ensure the animation is consistent, e.g. doesn't fade out
RecentsView, scrolls to page 1, etc.

Bug: 144170434
Change-Id: I5348565b9e705d8ffba39818dde9efe82b16bb7a
Merged-In: I5348565b9e705d8ffba39818dde9efe82b16bb7a
2020-08-14 22:30:33 +00:00
Tony Wickham
a145670969 Store mHistoricTimes as longs intead of floats
The loss of precision was causing us to miscalculate the age of
events, and thus not detecting any pause due to denominator = 0.

Test: have a device that hasn't been rebooted for a certain
amount of time such that SystemClock#uptimeMillis can't be
accurately converted to a float, then try to swipe up and hold

Fixes: 160568387
Change-Id: Idef112187f34a18feea7e6a0b77258626f9d0ed4
2020-08-12 17:02:53 -07:00
Tony Wickham
03a4a0cd53 Update overview from home transitions
For both NoButtonNavbarToOverviewTouchController and
NavBarToHomeTouchController:
- Have consistent resistance applied such that RecentsView scales
  down and translates up slightly (but not as much as from an app)
- Have consistent animation to home if you fling to that state
  rather than stay in overview. This is handled by a new class,
  OverviewToHomeAnim, which consolidates logic from NBTHTC and
  overrides some interpolators such that RecentsView doesn't fade
  out or translate downwards during the animation (it just slides
  off the screen while the home animation plays).

Also make overview actions not clickable when alpha == 0, so that
you can tap the hotseat/qsb during the transition from home to
overview.

Bug: 144170434
Change-Id: Ic291f285ff2f63c477633c48d4fadb23cf70c28a
2020-08-10 13:15:23 -07:00
Tony Wickham
ce8b2b5180 Add translation component to swipe up resistance
Now recents view follows your finger all the way to the top of the
screen. Specifically, your finger tracks the bottom of the window
until resistance starts (when RecentsView is at 75% scale), then
we add translation to compensate for the slower rate of scaling
down, such that your finger slips to the top of the window by the
time it reaches the top of the screen.

Also reset this translation back to 0 in the state handlers.

Bug: 149934536
Fixes: 158701272
Change-Id: Iaee58da758d422f0173c29d002f5c451ce0c1809
2020-08-07 12:32:50 -07:00
TreeHugger Robot
ffc06198ff Merge "Rewrite long swipe resistance ("pullback") logic" into ub-launcher3-rvc-qpr-dev 2020-08-03 22:11:30 +00:00
Tony Wickham
354a436f4e Rewrite long swipe resistance ("pullback") logic
- Rename "pullback" to "resistance" to reduce confusion.
- Remove mDragLengthFactorStartPullback & mDragLengthFactorMaxPullback
- Add AnimatorControllerWithResistance, which has 2 controllers, one
  for the normal shift to overview, then one to apply the resistance
  when swiping beyond that.
- Don't hack animator interpolators/progress; insteaad, allow progress
  to go > 1 (which will run the separate resistance animator).
- Don't start launcher controller separately from window controller;
  instead, both are controlled by mCurrentShift in updateFinalShift().
- The resistance animation logic is shared by both the active window
  and launcher (RecentsView).

Bug: 149934536
Change-Id: Ib0f9da18e10cc9ddf1a2f82ed767f237c89d3a41
Merged-In: Ib0f9da18e10cc9ddf1a2f82ed767f237c89d3a41
2020-08-03 21:01:46 +00:00
TreeHugger Robot
073673e173 Merge "Fixing wrong velocity state when there are too few samples" into ub-launcher3-rvc-qpr-dev 2020-07-31 18:12:40 +00:00
Sunny Goyal
48afb6b3b9 Fixing wrong velocity state when there are too few samples
Bug: 160568387
Change-Id: I32b3b7ee1bff5595941fc0c0b37c9f5a28d1a1fa
2020-07-30 15:44:05 -07:00
Pinyao Ting
553d4dfe7d Minimal Phone Mode (part-2)
Integrate with ContentProvider from Digital Wellbeing

Change-Id: Ie1fbb706e767ac5d760d686af88a9a0adf162418
2020-07-30 22:07:20 +00:00
TreeHugger Robot
d354443535 Merge "Fix adjacent task offset distance" into ub-launcher3-rvc-qpr-dev 2020-07-29 22:26:31 +00:00
Tony Wickham
16eb9226c5 Fix adjacent task offset distance
Instead of calculating an overall distance for tasks to translate
based on RecentsView width, calculate the distance for the tasks
to the left and right of the midpoint based on how far the first
adjacent tasks in those directions are from being offscreen.

Changes made to make "distance to offscreen" calculations possible:
- Update TaskView curve scale to reach final scale as soon as it is
  completely offscreen. Before, it would reach its final scale just
  shy of that point (calculations were off).
- As we update RecentsView scale, calculate how much the new scale
  will push out tasks that are just offscreen.
- With both above, we can calculate the scale and position of a
  TaskView such that it is just offscreen, and interpolate
  between its current position and that position.

Tests:
- Task comes in immediately when quick switching from home, and
  doesn't shift as you swipe directly upwards.
- When swiping far up from an app, tasks come in from all the way
  offscreen, and cover distance appropriately (e.g. if you're
  scrolled a bit to the right when you pause, the left adjacent
  app will move faster to cover the farther distance).
- Task modalness: entering Select mode now animates adjacent tasks
  at the same rate as the scaling up, because they move only the
  distance needed to get offscreen (before they moved way too far
  and thus seemed to be much faster than the rest of the animation).

Bug: 149934536
Change-Id: Ie3fffe0e5c304cb16e7637f058f5ce72cee40aeb
Merged-In: Ie3fffe0e5c304cb16e7637f058f5ce72cee40aeb
2020-07-29 22:17:33 +00:00
Andy Wickham
91fbf6619a Merge "Adds haptics to Overview gesture in Sandbox." into ub-launcher3-rvc-qpr-dev 2020-07-28 01:43:56 +00:00
thiruram
b6d0607d8b Logs system navigation details part of launcher snapshot logging.
Bug: 157997545
Change-Id: I18e908dc62bb790c3a77e1aacd0236a7d84e8ce5
Merged-In: I18e908dc62bb790c3a77e1aacd0236a7d84e8ce5
2020-07-27 16:32:21 -07:00
Andy Wickham
17f379bf4b Adds haptics to Overview gesture in Sandbox.
Change-Id: I4b8ec88bfc051de287b1b8ac27c4b5ab9ac90bbf
2020-07-24 16:49:15 -07:00
Sunny Goyal
ff4b142789 Fixing touches getting ignored just after swipe-up
Moving the input proxy logic outside the recents controller, so that it
is not lied to the controller lifecycle.

> Fixing input consumer not getting registered if recentsController
  was not received until ACTION_UP
> Fixing input events being ignored after finishing recentsAnimation,
  but before handler is invalidated

Bug: 161750900
Change-Id: Ib06617caef77f18a71c5a231e781291c3a4ee57e
2020-07-24 16:48:56 -07:00
thiruram
a4661192ff Limit launcher snapshot logging once per day.
This change will make sure launcher snapshot is logged only once in 24hrs interval using sharedpreference.

Bug: 161375303
Change-Id: Iab6b25d931b2e91ae5647e266bd68ead86c99bc6
Merged-In: Iab6b25d931b2e91ae5647e266bd68ead86c99bc6
(cherry picked from commit efa41c1c52)
2020-07-22 15:51:03 -07:00
TreeHugger Robot
7416a9097a Merge "Use display of activity to get rotation for recents" into ub-launcher3-rvc-qpr-dev 2020-07-22 17:35:32 +00:00
thiruram
3344b8ce3d Fixes missing field mappings from launcher_atom.ItemInfo to Statslog.
Bug: 161284668
Change-Id: I70b247e896bfcad5f6dbb6ce3ec5ed7aa57b8a61
2020-07-21 21:04:50 +00:00
Sunny Goyal
30ac97d938 Adding home animation support for non-system Launcher
When user swipes up to home, Launcher will receive a onNewIntent
callwith a bundle-extra gesture_nav_contract_v1. It will contain
the componentName & UserHandle of the closing app & a callback.
Launcher can use the callback to return the final position where
the app should animate to and an optional surface to be used for
crossFade animation. The surface cleanup can be handled in
onEnterAnimationComplete.

Change-Id: I76fdd810fdcb80b71f7d7588ccac8976d9dfe278
2020-07-21 11:43:21 -07:00
Riddle Hsu
354b8fc081 Use display of activity to get rotation for recents
The rotation of WindowConfiguration in Configuration is non-public
field. There is no guarantee that the information will be updated.
E.g. a 180 degree rotation change won't make difference to the
public configurations, so the Resources will keep the old one.

The display rotation of activity is accurate to use for its content
because even the activity is transformed to different rotation than
the physical display, there is FixedRotationAdjustments to adjust
the information which will be consistent as how the activity is
laid out.

Bug: 159877752
Test: 1. Enable auto rotation.
      2. Launch some portrait activities.
      3. Put device in reverse portrait (upside down).
      4. Launch a landscape activity.
      5. Swipe to another activity with full-sensor orientation.
      6. Return to home and enter recents to check the task views
         of step 2 don't show upside down.

Change-Id: I5e16e71d43b8892a394c06de9e76fb3d4ad55919
2020-07-21 06:15:35 +00:00
Winson Chung
5b7bf9147b Create a new instance of rotation touch helper per device state
Change-Id: I4e4288eaf37aab5bf0b8115f5e06e64459c20f00
(cherry picked from commit 00850fb588)
2020-07-20 22:05:46 +00:00
Sunny Goyal
12f46d521a Fixing recents orientation (when home rotation is allowed) during swipe-up
Bug: 158781568
Bug: 160149607
Change-Id: I27be09febcdb6f19687469db34b002ce682aa0cb
Merged-In: I27be09febcdb6f19687469db34b002ce682aa0cb
(cherry picked from commit 141c231d2f)
2020-07-17 18:53:01 +00:00
Tony Wickham
94be66acd6 Fix tracking window being slightly off when swiping from an app
Test: swipe up from an app in landscape, seascape, and portrait,
and verify the window tracks with the finger 1:1 until pullback

Bug: 149934536
Change-Id: Ia469877e7152c8135e0b9153f69c191ba86cbd14
(cherry picked from commit f0a1b2ccd8)
2020-07-16 20:03:36 +00:00
TreeHugger Robot
eb2eb38cc2 Merge "Move rotation logic to RotationTouchHelper" into ub-launcher3-rvc-qpr-dev 2020-07-16 05:14:25 +00:00
Vinit Nayak
0affd89031 Move rotation logic to RotationTouchHelper
No functional changes.

Fixes: 159764370
Change-Id: Ie7739a62242377bda69c86bd46e24d2f847f17e0
2020-07-15 22:03:14 -07:00
TreeHugger Robot
add69c70c4 Merge "Fix velocity in StaggeredWorkspaceAnimation." into ub-launcher3-rvc-qpr-dev 2020-07-13 22:20:33 +00:00
TreeHugger Robot
054280dba4 Merge "Using original taskInfo to create the taskKey instead of fake data" into ub-launcher3-rvc-qpr-dev 2020-07-13 22:06:13 +00:00
Jon Miranda
aee792403d Fix velocity in StaggeredWorkspaceAnimation.
* Velocity should match the direction of the spring values.
  (Swipe direction is upwards, but icons move downwards on screen).
* Remove additional conversion to pxPerS since getDimension already does that.

Bug: 160003774
Change-Id: I12912edb2354c4a30c538da6ca3789c46d82b94d
(cherry picked from commit 54003963d8)
2020-07-13 21:48:19 +00:00
Sunny Goyal
55a9b544c9 Using original taskInfo to create the taskKey instead of fake data
Change-Id: Ie4e35b35484e0f6cb939febe6357b37381d81682
(cherry picked from commit fabfb3ae90)
2020-07-13 21:47:16 +00:00
Pinyao Ting
9d51e49cec Fixes the issue Launcher state propagation is slower than onDeferredResume.
There's currently a bug prevents Launcher release drag lock for two step
widgets. Supposedly, onDeferredResume should release the drag lock; However,
in 3-button navigation mode, the transition from Overview -> Normal is
triggered in Launcher#onNewIntent, which happens after onDeferredResume.

This issue is not reproducible with gesture navigation because its
transition from Overview -> Normal is handled in NavBarToHomeTouchController

Test: manual verified with following steps
1. Enable 3-button navigation
2. Long press in WorkSpace -> Widgets
3. Drag Settings Widget to WorkSpace
4. When the config activity is shown, press "recents" button to see Overview
5. press "home" button to go back to workspace
6. repeat 2 and 3, verify the widget can be dragged
Bug: 149659788

Change-Id: I396ffa8a7db44bf3872a10de4208340a99a7efe8
(cherry picked from commit 3bf889a02f)
2020-07-13 21:46:05 +00:00
TreeHugger Robot
5491b2e2e0 Merge "Fix shelf tracking distance for landscape app over portrait launcher" into ub-launcher3-rvc-qpr-dev 2020-07-13 20:44:30 +00:00
Tony Wickham
452db0db0c Fix shelf tracking distance for landscape app over portrait launcher
Bug: 149934536
Change-Id: I14fa62fa9f51356613f4a3827446b00af774dbf5
2020-07-13 13:21:02 -07:00
Sunny Goyal
6fd105b69a Updating gesture tutorial home animation
> Using a separate View as icon, instead of the taskView
> Updating swipe animation logic to abstract out FloatingIconView dependency

Change-Id: Ib466262afead11ebe4ca035d589f0382c37e3e97
2020-07-09 07:51:34 -07:00
Zak Cohen
a3629bd52c Thumbnail Cache - check canceled status on the right thread.
The cache was checking the canceled status on the background
thread, but the cancel call was being made on the main thread.
This was leading to canceled requests still delivering this thumbnail
in some cases.

Bug: 159840851
Test: local build and non-repo of bug
Change-Id: I9a3556f6570eee1db39ebec202c115d58010d7f8
2020-06-28 21:10:07 -07:00
TreeHugger Robot
f59922d0d7 Merge "Add NPE check for prediction controller" into ub-launcher3-rvc-dev 2020-06-26 07:42:38 +00:00
Samuel Fufa
514df92bcf Add NPE check for prediction controller
Bug: 159835714
Test: Manual
Change-Id: I9cc03f6491f4e14462be6c01edf3ed4ca1d82136
2020-06-25 13:08:55 -07:00
Andy Wickham
fce6be550b Merge "Updates Assistant gesture regions when no longer tracking multiple." into ub-launcher3-rvc-dev 2020-06-24 22:29:45 +00:00
Andy Wickham
4b531b972d Updates Assistant gesture regions when no longer tracking multiple.
This should prevent states where Assistant triggers from
the vertical-center of the screen in portrait (see bug).

Also fleshes out OrientationTouchTransformerTests and
adds some new ones that fail without this change:
 - enableMultipleRegions_assistantTriggersInMostRecent
 - enableMultipleRegions_assistantTriggersInCurrentOrientationAfterDisable

Fixes: 158686674
Change-Id: I6d045a485f62e4010e9e3d00805a50fdd953a2fc
2020-06-24 21:23:35 +00:00
Vinit Nayak
f2daafcdf8 Prevent premature resetting of quickswitch mode
Previously, whenever a user returned to the same
rotation that they had started quickswitch in,
we were sending sysui the reset flag(-1) indicating
that quickstep was complete instead of sending
the rotation of the device the user was in.

This was intentional and it worked, however we now
always send the active rotation while the user
is in a quickswitch session because sysui needs
to show the fake home handle for immersive apps,
which can occur in any rotation. This state is
distinct from not being in quickswitch at all, in
which no fake handles are shown.

Fixes: 158677967

Change-Id: I910324abf781b4b30fe981139712bcb5b653c318
2020-06-23 15:07:22 -07:00
thiruram
dbd61d4026 Log query_length & parent_container for actions on search results.
Bug: 154717227
Change-Id: I8e7d725014f60a2fd9a7fe13fce705acbc7623ad
2020-06-22 18:14:12 -07:00
TreeHugger Robot
ceaad08f06 Merge "Fixing rotation watcher not enabled in landscape" into ub-launcher3-rvc-dev 2020-06-22 21:00:07 +00:00
Hyunyoung Song
5c9a1ef5cd Merge "Log Launcher transitions to WW" into ub-launcher3-rvc-dev 2020-06-22 20:21:10 +00:00
Sunny Goyal
f67deb8e06 Fixing rotation watcher not enabled in landscape
Bug: 159636793
Change-Id: Ia7e5d90e9d441dfbe9877293957eff1ae7f69877
2020-06-22 13:02:53 -07:00
Hyunyoung Song
801f81fba5 Log Launcher transitions to WW
- ONRESUME / ONSTOP
- HOME_GESTURE
- OVERVIEW_GESTURE
- QUICKSWITCH
- SWIPELEFT/SWIPERIGHT

Bug: 156875719
Bug: 148822714
Bug: 137777105

Debug log: go/launcher-log-parity

Change-Id: I64a0deab4996b5be36320fbe0339f320891c53e0
2020-06-22 12:09:06 -07:00