Commit Graph

2100 Commits

Author SHA1 Message Date
Tony Wickham 9e02264bc5 Store mHistoricTimes as longs intead of floats am: 31ef24c934 am: 1802dc3466 am: 27b9abc973
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12375534

Change-Id: I66bbada4462f3186ed6398ab3d89e8ceccb34e02
2020-08-14 11:20:12 +00:00
Tony Wickham 27b9abc973 Store mHistoricTimes as longs intead of floats am: 31ef24c934 am: 1802dc3466
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12375534

Change-Id: I249d4d5058915fe6ba995dc1e9efb56df49da123
2020-08-14 11:01:03 +00:00
Tony Wickham 31ef24c934 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
(cherry picked from commit a145670969)
2020-08-14 06:24:05 +00:00
Sunny Goyal aaf4ee69c6 Fixing wrong velocity state when there are too few samples am: f58a2b9cd9 am: 0581f5b05b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12317133

Change-Id: Ib54a52ee718609908144664ebc5c61bedf55d5ed
2020-08-06 23:14:32 +00:00
Hyunyoung Song bb71582658 Merge remote-tracking branch 'goog/ub-launcher3-master' into temp
Test: make builds

Change-Id: I4e845aa51c9247328159e5aa0d95d425bffa435c
2020-08-06 11:04:41 -07:00
Sunny Goyal f58a2b9cd9 Fixing wrong velocity state when there are too few samples
Bug: 160568387
Change-Id: I32b3b7ee1bff5595941fc0c0b37c9f5a28d1a1fa
(cherry picked from commit 48afb6b3b9)
2020-08-06 16:51:08 +00:00
Sunny Goyal 35376a3591 Using StatsLog for notifyingAppPredictor
> Adding a listener in StartsLogManager for listening to events.
  This allows events to be directored to the predictor only if
  it is already running, instead of creating it.
> Unifying the event format to be same as hotseat predictor

Bug: 160748731
Change-Id: Ib00e6249ff642c030f00bcad5b748255e704d16a
2020-08-01 07:02:31 +00:00
TreeHugger Robot 3834574916 Merge "Fixing wrong velocity state when there are too few samples" into ub-launcher3-rvc-qpr-dev am: 073673e173 am: 52e00d2287
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12275360

Change-Id: I8856f0a4699ba21a1b2bf0ff278c48dad6a423cc
2020-07-31 18:49:34 +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
Jason Chang c22726e067 Merge "Refactoring to use more precise statements when calculating gesture distance and others" into ub-launcher3-master 2020-07-31 02:19:17 +00:00
TreeHugger Robot 54b1d57db0 Merge "Log entire touchable region rect" into ub-launcher3-master 2020-07-31 01:17:11 +00:00
Pinyao Ting 9e13c951f2 Minimal Phone Mode (part-2) am: 553d4dfe7d am: d5d44bcda7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12193271

Change-Id: I760776ca825f728a44dde88de9f45400324f6ced
2020-07-30 23:28:14 +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
Vinit Nayak 2c80b305f4 Log entire touchable region rect
Bug: 162001398
Change-Id: Icac1d81cd6d11aa47279c81db8cc2e5ff92d6b0c
2020-07-30 15:42:30 -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
Jason Chang b0611351e3 Refactoring to use more precise statements when calculating gesture
distance and others

1) Use more precise statements when calculating gesture distance
and refine ACTION_CANCEL motion events and others.

2) Check system property "ro.support_one_handed_mode" to enable or
disable one-handed quicksteps gesture feature.

Bug: 160315874

Test: make and install
Test: manual enable one handed mode and swipe down to trigger
Test: manual start one handed and rotate device
Change-Id: Ib27f9b6f92edda3cbff1ecb554b1a70f2e56e552
2020-07-30 23:16:09 +08:00
Hyunyoung Song 45c0918f47 Merging ub-launcher3-rvc-qpr-dev to rvc-qpr-dev
Bug: 162366734
Test: system image builds

Change-Id: I6675431b180976798afacc7a99251ae36764a50a
Merged-In: Ibff46b3ef7ff89accb459db323f31179adb4ef21
2020-07-30 00:26:39 -07: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
Tony Wickham 7383d4e6d2 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
2020-07-29 20:05:29 +00:00
Hyunyoung Song eeb497cf92 Merge "Revert "Merging from ub-launcher3-rvc-qpr-dev @ build 6690853"" into rvc-qpr-dev 2020-07-28 23:44:26 +00:00
Hyunyoung Song 0a4a4d920e Revert "Merging from ub-launcher3-rvc-qpr-dev @ build 6690853"
Revert "Merging from ub-launcher3-rvc-qpr-dev @ build 6690853"

Revert "Merging from ub-launcher3-rvc-qpr-dev @ build 6690853"

Revert submission 12190253-merge_ub-launcher3-rvc-qpr-dev_6690853

Reason for revert: Build ID picked from ub-launcher3-master and not ub-launcher3-rvc-qpr-dev

Reverted Changes:
I9e658ece0:Merging from ub-launcher3-rvc-qpr-dev @ build 6690...
I2a47fe180:Merging from ub-launcher3-rvc-qpr-dev @ build 6690...
Ie86b0a2e0:Merging from ub-launcher3-rvc-qpr-dev @ build 6690...
Id3ca76da6:Merging from ub-launcher3-rvc-qpr-dev @ build 6690...
Ib6a63da0f:Merging from ub-launcher3-rvc-qpr-dev @ build 6690...
Bug: 162366734


Change-Id: Ie81853a34c9a48d5b3fd922c65483a9ff639e0ce
Merged-In: Ibff46b3ef7ff89accb459db323f31179adb4ef21
2020-07-28 23:43:43 +00:00
Sunny Goyal 52e2545a66 Removing arrow indicator from homescreen and
adding a separate view for various accessibility actions

Bug: 159247871
Change-Id: I14536844929e03d36a6a5f294d4f5daad8c82d15
2020-07-28 14:21:31 -07:00
Sunny Goyal 57bda9f71d Fixing touches getting ignored just after swipe-up am: 16e165defe am: fd5e6fe615 am: c718e55f23
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12240766

Change-Id: I366046998ba5566ebb6632c528b04548bfe479f0
2020-07-28 10:14:26 +00:00
Sunny Goyal c718e55f23 Fixing touches getting ignored just after swipe-up am: 16e165defe am: fd5e6fe615
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12240766

Change-Id: I58e9b5ecea445819ae8e26b74b882b0a012f38d2
2020-07-28 10:04:13 +00:00
Sunny Goyal 0a7049055e Fixing touches getting ignored just after swipe-up am: 16e165defe
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12240766

Change-Id: I3f741e2bd27157e69c84b982df38171041d89e41
2020-07-28 09:47:44 +00:00
Andy Wickham a6684ba440 Merge "Adds haptics to Overview gesture in Sandbox." into ub-launcher3-rvc-qpr-dev am: 91fbf6619a am: 4341d7847b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12230464

Change-Id: Ide2387406eaaad3c281749b9d7bc90f3e403883e
2020-07-28 02:07:46 +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
Sunny Goyal fe00c09076 Unifying handler (#1) BaseSwipeUpHandlerV2 => AbsSwipeUpHandler
Change-Id: I34647ced0e96e63cdbba35f6eb3bdc3f86810ebe
2020-07-27 15:09:22 -07:00
TreeHugger Robot 25b5872296 Merge "Fixing touches getting ignored just after swipe-up" into ub-launcher3-rvc-qpr-dev am: 8527620201 am: 7ed153fbb7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12212836

Change-Id: Ic4d6a37008a7e214357c995e3d37c4a4a9da2694
2020-07-27 18:04:51 +00:00
Sunny Goyal 16e165defe 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
(cherry picked from commit ff4b142789)
2020-07-27 17:55:47 +00:00
thiruram 90573f0515 Logs system navigation details part of launcher snapshot logging.
Bug: 157997545
Change-Id: I18e908dc62bb790c3a77e1aacd0236a7d84e8ce5
2020-07-27 09:51:52 -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
Hyunyoung Song 65b16d6db2 Merging from ub-launcher3-rvc-qpr-dev @ build 6690853
Bug:150504032
Test: manual, presubmit on the source branch
x20/teams/android-launcher/merge/ub-launcher3-rvc-qpr-dev-rvc-qpr-dev_6690853.html

Change-Id: Ie86b0a2e0d82646a0c3d44a0214cbb985435320d
Merged-In: Ibff46b3ef7ff89accb459db323f31179adb4ef21
2020-07-23 03:47:06 +00:00
Winson Chung 18b76be7f2 Merge changes from topic "ub-one-handed-rebase" into ub-launcher3-master
* changes:
  Guard swipe to notification gesture with system settings preference
  Update state and touch region after one handed overlay changed
  Hook one-handed gesture to expand notification panel by default
  Enable one-handed mode gestural in QuickStep
2020-07-23 02:37:54 +00: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
thiruram efa41c1c52 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
2020-07-22 14:07:44 -07:00
TreeHugger Robot c6962d9ad1 Merge "Use display of activity to get rotation for recents" into ub-launcher3-rvc-qpr-dev am: 7416a9097a am: 35f5abc54d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12193289

Change-Id: I4d0a7f28ac14d1d9a8c65d2ce27061a94734fdfc
2020-07-22 18:10:28 +00: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 f668ec0beb Fixes missing field mappings from launcher_atom.ItemInfo to Statslog. am: 3344b8ce3d am: 23331ead95
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12160060

Change-Id: I66321bee8c2470c7eb73f30033a19e2d348b5289
2020-07-21 21:43:20 +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 b9a0a99ade Adding home animation support for non-system Launcher am: 30ac97d938 am: c60023449c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12150115

Change-Id: Idbd4c1ab36928420023987e0e4bdb06edd9e3268
2020-07-21 20:07:31 +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
Winson Chung fbb8c69a56 Guard swipe to notification gesture with system settings preference
Bug: 154080211
Test: make and install, check the gesture works as expectedly

Change-Id: Ibd6bbd595d2fba5d68e66eb54e4a7fec160b9bf8
(cherry picked from commit 779efaca91)
2020-07-21 09:59:44 -07:00
Winson Chung fc6c42107d Update state and touch region after one handed overlay changed
The matrix for overall modes x state changes:
-----------------------------------------------------
   Mode     |      State changed     | *Before|*After
-----------------------------------------------------
  OneHanded |  Portrait->Landscape   |  80dp  |  32dp
  OneHanded |  Landscape->Portrait   |  32dp  |  80dp
-----------------------------------------------------
  OneHanded |  Disable->Enable       |  32dp  |  32dp
 (Landscape)|  Enable->Disable       |  32dp  |  32dp
-----------------------------------------------------
  OneHanded |  Disable->Enable       |  32dp  |  80dp
 (Portrait) |  Enable->Disable       |  80dp  |  32dp
-----------------------------------------------------
  NO_BUTTON |  Portrait->Landscape   |  32dp  |  32dp
  NO_BUTTON |  Landscape->Portrait   |  32dp  |  32dp
  2 BUTTON  |  Portrait->Landscape   |  48dp  |  48dp
  2 BUTTON  |  Landscape->Portrait   |  48dp  |  48dp
  3 BUTTON  |  Portrait->Landscape   |  48dp  |  48dp
  3 BUTTON  |  Landscape->Portrait   |  48dp  |  48dp
-----------------------------------------------------
* dimen : navigation_bar_gesture_height

Test: adb bugrepot | grep mOneHandedModeRegion
Test: manually triger one handed
Test: atest WindowInsetsBehaviorTests
Test: atest com.android.launcher3.memory.MemoryTests
Test: flake -once
Test: rnlot -t com.android.launcher3.memory.MemoryTests
Bug: 157958539
Bug: 159183864

Change-Id: I19755938c3c93eb59a9f621af5722f5679c1da14
(cherry picked from commit 70b5ca2505)
2020-07-21 09:59:44 -07:00
Winson Chung 1c1f5d9aef Hook one-handed gesture to expand notification panel by default
Notify to expand notification panel through SystemUiProxy when
one-handed mode disabled and one-handed gesture detected.

Bug: 154080211
Test: make and install
Test: manual disable one handed mode and swipe down to trigger
Test: verified the gesture works even outside of home page

Change-Id: Iacc0e506ccd04dd81f6182759c8af7d686a7b77b
(cherry picked from commit dd3eb7d075)
2020-07-21 09:59:43 -07:00
Tony Huang a0dfbff96a Enable one-handed mode gestural in QuickStep
Handling swipe-down/swipe-up gestural in device bottom area
for one-handed mode

1) The regsion is larger than gesture navigationbar view
2) One handed gestural in quickstep only active on NO_BUTTON, TWO_BUTTONS mode
3) One handed gestural only support on portrait mode

Bug: 150747547
Bug: 154189137
Bug: 156988988

Test: make and install
Test: manual enable one handed mode and swipe down to trigger
Test: manual start one handed and rotate device

Change-Id: I7b2447bfb2fe4082c95176b62934b98077b84920
(cherry picked from commit 7d375e31fe)
2020-07-21 09:59:43 -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