Commit Graph

1421 Commits

Author SHA1 Message Date
Nicolò Mazzucato
aea723c854 Merge changes from topic "cancel_unfold_anim_on_rotation" into tm-qpr-dev
* changes:
  Cancel unfold animation when rotation changes
  Create RotationChangeProvider in sysui
2022-10-13 23:06:44 +00:00
Nicolo' Mazzucato
0def5f9805 Cancel unfold animation when rotation changes
In DeviceFoldStateProvider.kt, FOLD_UPDATE_FINISH_HALF_OPEN is emitted if the rotation changes while the animation is in progress.

 This targets the case when the device goes to tabletop mode during the transition.

+ Using RotationChangeProvider to fix problems when the new orientation change was received in a background thread unexpectedly. This fixes: (1) wrong launcher icons movement after the rotation, and (2) wrong dark overlay scrim after rotation.

+ Minor formattig fixes by ktfmt

Bug: 241743859
Test: DeviceFoldStateProviderTest && NaturalRotationUnfoldProgressProviderTest && manual stress testing
Change-Id: I0ff6a823709e0891a7bcd13528a0e160d6f39c98
2022-10-13 12:30:59 +00:00
Will Osborn
6d1c1b57b4 Merge "Allow rotation when display is half-folded" into tm-qpr-dev 2022-10-13 08:47:42 +00:00
TreeHugger Robot
2689585c62 Merge "Add information to Task model for desktop entry" into tm-qpr-dev 2022-10-12 21:10:12 +00:00
TreeHugger Robot
5cc7eec00a Merge "Check activity start result code to properly return whther startActivityFromRecents was successful." into tm-qpr-dev 2022-10-11 22:22:10 +00:00
Hawkwood Glazier
941c170c1c Improve dumps and logging around AnimatableClockView and KeyguardClockSwitch
Bug: 251403277
Test: Manually took a bug report
Change-Id: Ie4d11e51e7768d8ad968986c259a70d6b94e2043
2022-10-11 15:10:24 +00:00
William Osborn
9723cfbc38 Allow rotation when display is half-folded
When in 'tabletop' or 'book' mode, allow the display to rotate
even if it is frozen. Then return to the previously locked rotation when
the device is unfolded.

Bug: 240146362
Test: locally tested + ran atest on DisplayRotationTests
Change-Id: I9869f5b070fecd7df70e08323dfacef8b883f470
2022-10-10 20:47:26 +01:00
Schneider Victor-tulias
e48a269ca2 Check activity start result code to properly return whther startActivityFromRecents was successful.
Launcher was not properly giving the user an error message when an activity failed to launch from recents. Added a result code check.

Bug: 240373119
Test: Manually repro'd bug and checked logs
Change-Id: I12e299077b51b27c4e3f477a0a7440f0502fee39
2022-10-07 15:23:16 -07:00
Hawkwood Glazier
edd7822744 Seperate clockface specific callbacks
This change cleans up the Clock interfaces a bit by seperating some of
the interface methods and passing darkness data in to each clock face
seperately.

Test: Manually checked existing clock on device. Some unit tests.
Bug: 229771520
Change-Id: I8fee1c6c9bfff3a970f8333c5d5c3940f797dc28
2022-10-07 18:00:03 +00:00
Matt Pietal
90c03205a6 Merge "Fix unfold transition with RTL" into tm-qpr-dev 2022-10-07 17:19:31 +00:00
Winson Chung
dc06f11eb0 Merge "Simplify exposing external interfaces to Launcher" into tm-qpr-dev 2022-10-07 16:55:55 +00:00
Winson Chung
c03010f150 Simplify exposing external interfaces to Launcher
- Currently, the collection of binders to send to Launcher is inverted
  and managed by OverviewProxyService which has to know about each
  component directly (and a SysUI interface has to be created to support
  this even if there are no other calls in SysUI to that component).

  Instead, we should have each component register itself with the
  ShellController for controllers which can be exposed to an external
  process, and each product can customize which set of controllers it
  needs to support.
- Add missing dump registration for ShellController
- Updating docs for creating remote callable controllers

Bug: 238217847
Test: atest WMShellUnitTests
Change-Id: Icd0ed33bdbd68b1dd9d782b9ba1f5b4a604479ba
Merged-In: Icd0ed33bdbd68b1dd9d782b9ba1f5b4a604479ba
2022-10-06 22:49:13 +00:00
Matt Pietal
b1ddb662f6 Fix unfold transition with RTL
The code was hardcoded to assume left/right translations, which went
in the wrong direction on unfold. Add an additional multiplier for
RTL.

Fixes: 241793140
Test: atest UnfoldConstantTranslateAnimatorTest
Change-Id: I535ab6e53bf15747e22dcab30d03e01156261158
2022-10-06 14:19:32 +00:00
Nick Chameyev
b55f5dae30 Merge "Extract PreviewPositionHelper to shared library" into tm-qpr-dev 2022-10-05 12:52:01 +00:00
Winson Chung
ddc26a33f8 Merge "Clean up some methods on the Pip interface" into tm-qpr-dev 2022-10-04 16:54:48 +00:00
Winson Chung
5414dab01e Clean up some methods on the Pip interface
- Remove some pip methods that aren't used from SysUI
- Migrate an old ISystemUIProxy pip call to IPip

Bug: 238217847
Test: atest WMShellUnitTests
Change-Id: Iab57329a9d79704b0e35fdb22a36594aa4368141
2022-10-04 04:39:33 +00:00
Selim Cinek
6a2f4e2ab5 Merge "Fix RegionSamplingHelper race condition" into tm-qpr-dev 2022-10-03 12:42:42 +00:00
Ats Jenk
0ba5abfb20 Add information to Task model for desktop entry
Desktop recents entry needs some extra information about a Task.
Add support to populate this

Bug: 244348395
Test: manual
Change-Id: If358ea63dff0725f312672f5c247147c1e3cb9f9
2022-09-30 15:27:50 -07:00
Florence Yang
524ae21e70 Fix RegionSamplingHelper race condition
mSamplingRequestBounds was causing a race condition in RegionSamplingHelper because it becomes an empty Rectangle in the main thread when the background thread needs it to be non-empty for CompositionSamplingListener.register().To fix this, a final copy of mSamplingRequestBounds is passed to the background thread, so that it will always be working with a non-empty Rectangle.

Test: atest testCompositionSamplingListener_has_nonEmptyRect
Fixes: 247690841
Change-Id: Ib0139c8be80f828172e1909503dcf57a59673717
2022-09-29 21:28:56 +00:00
Nick Chameyev
b2551fc716 Extract PreviewPositionHelper to shared library
Moves Launcher's PreviewPositionHelper to shared
library between SystemUI and Launcher to reuse
it in the future in the partial screensharing
recents selector.

There should be no functional changes in the
code itself.

Bug: 240924926
Test: presubmit
Change-Id: I66c2b2ff68deb56394b52c07b98e36d23822025f
2022-09-27 19:08:32 +01:00
Lucas Dupin
5c4704b781 Merge "Allow multiple clock plugins simultaneously" into tm-qpr-dev 2022-09-27 17:09:08 +00:00
Ats Jenk
df2bdd5135 Merge "Add support to show apps on desktop in sysui proxy" into tm-qpr-dev 2022-09-26 23:43:18 +00:00
Lucas Dupin
e601a67d00 Allow multiple clock plugins simultaneously
Test: atest ClockRegistryTest
Bug: 248101364
Change-Id: I92380d19fcbbbcdb3d3c5d292d44fd57f8595996
2022-09-26 13:57:19 -07:00
Ats Jenk
d849498a69 Add support to show apps on desktop in sysui proxy
This enabled launcher to show all desktop apps when user clicks on the
desktop tile in recents.
This is only enabled when Desktop Mode feature flag is enabled.

Bug: 244348395
Test: atest DesktopModeControllerTest
Change-Id: I3c89ef01fd7d1f457a7afabda94b481711c0a350
2022-09-26 10:53:10 -07:00
Josh Tsuji
64a3f7394a Add jank instrumentation for occlude/unocclude/launcher unlock.
Fixes: 241195239
Test: grab a trace
Change-Id: If9af9aa95ddff26c9baf5101fb5aa45389e532eb
2022-09-23 15:33:52 -04:00
Mady Mellor
2b9353ffbc Merge "Support for a floating task window (behind a sysui flag)" into tm-qpr-dev 2022-09-22 14:58:12 +00:00
Lucas Silva
6bf07ae2f3 Merge "Implement DoubleShadowIconDrawable for use in dream complications" into tm-qpr-dev 2022-09-22 02:35:44 +00:00
Mady Mellor
38edb219c0 Support for a floating task window (behind a sysui flag)
Creates a new package within shell for floating tasks along with a
basic controller and interfaces for sysui and launcher to use to
manage floating tasks.

A single floating task is allowed at a time and they can only be
created if a sysui flag is turned on.

The floating task is backed by a TaskView, floats above all other
content, and can be moved via a handle at the top of the view. The
view sticks along the left and right edges of the screen, can be
stashed (similar to PIP), and can be removed by dragging to a dismiss
target in the middle of the screen (similar to PIP & bubbles).

The tests included trigger the sysui flag on and off to ensure the
flag behavior (i.e. that you can't create one unless the flag is on).

Test: atest FloatingTaskControllerTest
Bug: 237678727
Change-Id: I490c44685825e14166869b2cf7c2994ee0e30ba7
2022-09-21 02:12:46 +00:00
Lucas Silva
f24be85e54 Implement DoubleShadowIconDrawable for use in dream complications
Also refactors the code to place the double shadow code in a shared
location, and specify the shadow config in xml instead of hardcoding.

Bug: 239089588
Test: manually on device by flashing and verifying the icon atop the
dream has the proper shadow

Change-Id: I18db07c243e20785409d5cc760b614a8ee775f1f
2022-09-20 01:34:30 -04:00
Hawkwood Glazier
e5383425e1 Ensure state is set correctly after animateAppearOnLockscreen is called
Before the textAnimator is initialized, animateAppearOnLockscreen can
be called to set the color to be correctly set on the AnimatableClockView.
As a result, we should not suppress the calls to setTextStyle so that
the correct setTextStyle call is cached in onTextAnimatorInitialized.

Fixes: 246831875
Test: Manually checked broken usecase and several working usecases
Change-Id: I9ffbb34bc314affe64180ab1bbea411bebe37d2d
2022-09-16 23:12:10 +00:00
Hawkwood Glazier
60e003dd44 Merge "[DO NOT MERGE] Resolve file inconsistencies between master and tm-qpr-dev" into tm-qpr-dev 2022-09-16 15:00:01 +00:00
TreeHugger Robot
6d8c460357 Merge "Revert "Removing unused surface transaction wrappers"" into tm-qpr-dev 2022-09-16 00:20:41 +00:00
Sunny Goyal
2460910c8c Revert "Removing unused surface transaction wrappers"
Revert submission 19933596-tcompat

Reason for revert: b/246899728
Reverted Changes:
I31123dff7:Using Transaction directly instead of building sur...
I2e2526d21:Removing unused surface transaction wrappers

Change-Id: I44944ccd94def3b5925f1008f0b8d47387594f2b
2022-09-15 20:48:09 +00:00
Winson Chung
de2e7c4348 Merge "Remove more thin wrappers from the shared lib" into tm-qpr-dev 2022-09-14 22:03:05 +00:00
Hawkwood Glazier
3140d3530c [DO NOT MERGE] Resolve file inconsistencies between master and tm-qpr-dev
Bug: 229771520
Test: Manually checked the device build
Change-Id: I03bf5eac968b425344236fbea897501bc5ecbeec
2022-09-14 19:08:04 +00:00
Winson Chung
7d4a22c86c Remove more thin wrappers from the shared lib
- These were only used for the unbundled launcher build, and Launcher
  can reference system code directly now

Bug: 219861883
Test: Builds/Presubmit
Change-Id: I1532f1b853765fb69c5bf46ad5a08230bde00c5f
Merged-In: I1532f1b853765fb69c5bf46ad5a08230bde00c5f
2022-09-14 16:31:17 +00:00
Sunny Goyal
31564922c2 Removing unused surface transaction wrappers
Bug: 221961069
Test: Presubmit
Change-Id: I2e2526d215ab2c9acfd0ae1f86711d9681f62f19
2022-09-12 15:40:56 -07:00
Sunny Goyal
e0b9b1f1dc Removing back-button alpha controlling logic
Bug: 246006580
Test: Presubmit
Change-Id: I57e6346eca52c850a31bdfa399f58e9df97cf682
2022-09-09 21:02:54 -07:00
Hawkwood Glazier
c6bfa32a24 [DO NOT MERGE] Initialize TimeZone during DefaultClockProvider init
This is a duplication of Ie8b08bec36bccfda5a1f1eb20c91a040c1f688ab
for the refactored clock code. It's validated via unit test as it
has proved somewhat tricky to reproduce manually.

Test: atest DefaultClockProviderTest
Fixes: 241729527
Change-Id: I0c664750190572790e71f6095a1ac8c4995c83ca
2022-08-31 22:27:06 +00:00
Hawkwood Glazier
6a62f99b50 [DO NOT MERGE] Correct large clock position
This corrects the large clock positioning error that was introduced with
Ia053aaec6987e00de980388a6c024d8bcf5203a2. It does this by rearranging
the layout slightly to get back to the same position. Of note:
 - Previously the margin for the large clock was computed dynamically
   and applied to the large clock frame from a static resource and
   dynamic value based on the font. Now the static portion is applied
   directly from the resource to the clock frame in the layout resource.
   The dynamic portion is applied to the AnimatableClockView directly
   instead of it's parent as before.
 - ChildClipping has been disabled on the parent view as the dynamic
   portion of this margin moves the AnimatableClockView outside of
   it's parent's bounds.
 - The margin that is now applied to the AnimatableClockView is
   scaled by 0.5 to account produce the ccorrect placement after
   center-aligning the view in it's parent. Before the full value
   was applied to the parent, creating an equivalent effect.

This also fixes the clock translation issue when the splitshade appears
and disappears. They were both fundamentally layout issues with the
refactored clock code.

This change was manually tested by flashing each device and comparing
the clock position in every configuration against a refenece image from
a dogfood build. Additionally the motion of the clock was validated
when the splitshade appears and disappears on a tablet in landscape.

Test: Manual validated screenshots from several devices against reference
images from a known good build. Additionally validated with a screenshot
test, although golden images had to be updated.

Bug: 229771520
Fixes: 241083568
Fixes: 241084042
Change-Id: I273c2996ff67c7b5f77c6bafb292d53275c7bc47
2022-08-31 22:27:06 +00:00
Hawkwood Glazier
a823b466cc [DO NOT MERGE] Additional Tests for DefaultClock
DefaultClock needed additional units as coverage of much of that class
was too low. This additionally adds an animation disable flag into
AnimatableClockView for use by the screenshot test.

Bug: 229771520
Test: atest DefaultClockProviderTest
Change-Id: I7d585cedb9b43ac0fb6405e36bec99ee8a246a61
2022-08-31 22:27:05 +00:00
Grace
a724e0b753 [DO NOT MERGE] Update DefaultClockProvider colors
This is largely a cherry-pick of change
I6b32776dac1853eeab87c2a65da69478e4da5b75 but with
some notable changes to accomadate existing code
differences in tm-qpr-dev.

 - We use a boolean instead of an enum for clock region
   darkness as the enum is in a different place in tm-qpr-dev.
 - We clean up some of the initialization code in
   ClockEventController to prevent testing issues and provide
   a dependency injection point to the screenshot test.
 - Pull the clock color setting from the theme when region
   sampling is disabled instead of defaulting to always dark.

Test: Manually validated colors matched reference images on
light and dark backgrounds with the region sampling feature
both enabled and disabled.

Bug: 229771520
Change-Id: I7906850b5de7f512f55e47e1122dfaacbc9c9406
2022-08-31 22:27:05 +00:00
Grace
417feefd5f [DO NOT MERGE] Moving Text Protection to Clock Event Controller
This change moves text protection from the Animatable Clock Controller
to the Clock Event Controller.

Bug: 202758428
Fixes: 241260493
Test: atest ClockEventControllerTest
Change-Id: I33b8f69c1a5b7b915bb020be16593ef68c46281d
Merged-In: I33b8f69c1a5b7b915bb020be16593ef68c46281d
2022-08-31 22:27:05 +00:00
Hawkwood Glazier
843cd5ea89 [DO NOT MERGE] Revert "[DO NOT MERGE]Revert "Migrate KeyguardClockSwitch to new..."
Revert "[DO NOT MERGE]Revert "Expose the clock version of google..."

Revert "[DO NOT MERGE]Revert "Changes to SystemUIGoogle to suppo..."

Revert submission 19508951-revert-19451291-cherrypick-clock_migration-tvip0m638i-BKWSUCNJAV

Reason for revert: Double Revert w/ fixes
Reverted Changes:
Iccd8d2e19:[DO NOT MERGE]Revert "Add clock version of google-...
I432d3d814:[DO NOT MERGE]Revert "Migrate KeyguardClockSwitch ...
Ifd0aa59df:[DO NOT MERGE]Revert "Expose the clock version of ...
I9a6ca6349:[DO NOT MERGE]Revert "Changes to SystemUIGoogle to...

To minimize merge issues, this topic consists of just cherry-picks from
master. Fixes for bugs are provided as downstream commits and will be
merged back to master as those bugs exist there as well. The commits
in this topic weren't tested in isolation beyond automated testing.

Additionally, I've updated the ktfmt exclude list to include new files
from this cherry-pick instead of reformatting those files.

Test: Screenshot test and manually validated each downstream fix mostly by
comparing reference images from known good builds to test builds.

Change-Id: Iff1d0ee8c6d09c77185be1ca5bbbe1aa5870e0c7
2022-08-31 22:26:07 +00:00
Grace Han
f2f92cd251 Merge "Fix Region Sampling Bounds" into tm-qpr-dev 2022-08-25 05:17:36 +00:00
Grace Han
b713bb6936 Fix Region Sampling Bounds
This change updates the sampling bounds used for region sampling.

Bug: 202758428
Test: Manual
Change-Id: I7a33bb6ce27fdbd8891434c627a3b10545086272
2022-08-25 01:18:42 +00:00
TreeHugger Robot
d8769634c8 Merge "Dump additional AnimatableClock updates" into tm-qpr-dev 2022-08-23 14:29:10 +00:00
Alex Florescu
04fd349391 Merge "Show floating rotation button in sticky immersive mode if taskbar is used" into tm-qpr-dev 2022-08-23 08:22:38 +00:00
Beverly
4466bbb4f6 Dump additional AnimatableClock updates
Test: dump sysui
Bug: 241729527
Bug: 222260948
Change-Id: I8d747a08e4d0a0ad211872f0d2a8495839b0f3a5
Merged-In: I8d747a08e4d0a0ad211872f0d2a8495839b0f3a5
2022-08-22 19:56:14 +00:00
Hawkwood Glazier
aad4ac792e Merge "[DO NOT MERGE] Allow manually specified time" into tm-qpr-dev 2022-08-19 21:21:37 +00:00