Commit Graph

1397 Commits

Author SHA1 Message Date
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
Hawkwood Glazier
ed1efe9f31 [DO NOT MERGE] Allow manually specified time
Additionally, disable layout animation from test

Bug: 229771520
Test: Automated
Change-Id: I2518d293f5b03e7bea7a45d8ef24ec6a998b5d30
2022-08-19 21:18:00 +00:00
Alex Florescu
b49a28e1c8 Show floating rotation button in sticky immersive mode if taskbar is used
Bug: 241245977
Bug: 216182085
Test: atest SystemUITests:RotationButtonControllerTest
Change-Id: I1664241cc8cd156e301466c06c92090c1eb5be8d
2022-08-19 15:18:00 +00:00
Shan Huang
d888fe4428 Merge "[DO NOT MERGE] Separate Region Sampling Instance" into tm-qpr-dev 2022-08-18 23:51:11 +00:00
Grace
0371876473 [DO NOT MERGE] Separate Region Sampling Instance
This change abstracts out the creation of a region sampling helper
and the initialization of all its fields. It adds test coverage
for the new class.

Bug: 202758428
Test: atest RegionSamplingInstanceTest
Change-Id: Ife2aafccc20466e81f481d1764210806dffc3123
2022-08-17 18:54:01 +00:00
Hongwei Wang
4a24c54245 Merge "[Re-land] Deprecate getSfInstance usage in PiP component" into tm-qpr-dev 2022-08-11 14:59:33 +00:00
Jerry Chang
9de781b8a4 Merge "Integrate split pair cold launch transition with shell transition" into tm-qpr-dev 2022-08-11 07:05:17 +00:00
Hongwei Wang
9fe333a07e [Re-land] Deprecate getSfInstance usage in PiP component
- Deprecated also the custom animation handler in PhysicsAnimator
- Ensures the transactions within PiP have VsyncId being set
- Still using getSfInstance in PipResizeGestureHandler since migrating
  to getInstance causes regression for resize-and-tap PiP window.

Trace: https://ui.perfetto.dev/#!/?s=8a3a073ce2f9ad84c7e377e6ba866657076adf0525444c0261e65b2e66f24a
Bug: 222697646
Test: Record perfetto trace while moving PiP, see the Trace
Test: verify PiP functionalities still work
Change-Id: I93f8bf2392425d72829600d0bbed0b3c58ec08d0
2022-08-10 13:31:09 -07:00
Nicolò Mazzucato
c912c03106 Merge "Disable hinge sensor while the screen is off" into tm-qpr-dev 2022-08-10 09:32:50 +00:00
Nicolo' Mazzucato
909d347180 Disable hinge sensor while the screen is off
This allows to save some power while the device is unfolded but with screen off.

+ Avoiding registering more listeners if HingeSensorAngleProvider.start() is called multiple times sequentially without a `stop` in the middle. It seems that otherwise we would get duplicated callbacks.

+ Adding onScreenTurningOn and onScreenTurningOff callbacks to forward to Launcher (as only sysui is receiving them)

Bug: 240661156
Bug: 240374404
Test: DeviceFoldStateProviderTest
Change-Id: I40b77033690c2e708275ce49bbe156c781105a00
2022-08-09 09:32:15 +00:00
Dave Mankoff
2719567655 Add ability for flags to be server-overridden.
This works in both debug and release builds. In debug builds,
all flags can be overridden via the same mechanisms as before,
but can also be overridden by flags defined on the server.

On release builds, only `ReleasedFlag`s can be overridden.
`UnreleasedFlag`s remain set in their default state.

With this cl, server side flags do not get their new value
until SystemUI is restarted (via a reboot or a crash).

Bug: 239863271
Test: atest SystemUITests
Change-Id: I08166cb90675dea06b2671669cecfc16ac58ab61
Merged-In: I08166cb90675dea06b2671669cecfc16ac58ab61
2022-08-06 23:25:13 +00:00
Jerry Chang
46a4f036b2 Integrate split pair cold launch transition with shell transition
Separate RemoteAnimationTargetCompat.wrap to wrapApps and wrapNonApps to
support extracting non-app targets. Update to distinguish a divider
change from non-app targets to ensure it can be animated properly.

Fix: 222163803
Test: atest RemoteTransitionTest
Test: atest SplitTransitionTests
Test: enabled shell transition, cold launch a split pair from overview
      has proper transition.
Change-Id: Ibd45d612e75c3a3b664aaf3944f424289419858b
2022-08-04 07:47:36 +00:00
Hawkwood Glazier
23535e29d1 [DO NOT MERGE]Revert "Migrate KeyguardClockSwitch to new shared Clock library"
Revert "Expose the clock version of google-sans"

Revert "Changes to SystemUIGoogle to support clock migration"

Revert submission 19451291-cherrypick-clock_migration-tvip0m638i

Reason for revert: b/241084042
Reverted Changes:
Ia053aaec6:Migrate KeyguardClockSwitch to new shared Clock li...
Ia3e067b93:Changes to SystemUIGoogle to support clock migrati...
I5dbf01a83:Add clock version of google-sans
Ia654d4f41:Expose the clock version of google-sans

Change-Id: I432d3d814c85b9ba20bbb7a88d2e52bd2337c10c
2022-08-03 15:22:58 +02:00
Hawkwood Glazier
79dac2d234 Merge "Add Flag for Custom Clocks" into tm-qpr-dev 2022-08-02 21:59:14 +00:00
Hawkwood Glazier
341b5a877a Merge "Add exception handling to ClockRegistry to prevent crashes" into tm-qpr-dev 2022-08-02 21:58:58 +00:00
Evan Rosky
8dc61b1ee2 Merge "Hook up setWillFinishToHome in recents wrapper" into tm-qpr-dev 2022-08-02 20:13:54 +00:00
TreeHugger Robot
5c0ba8f0f5 Merge "Add willShowImeOnTarget in RemoteAnimationTarget(Compat)" into tm-qpr-dev 2022-08-02 13:05:02 +00:00
Hawkwood Glazier
a8aa52eaf9 Add exception handling to ClockRegistry to prevent crashes
Test: Manual
Bug: 229771520
Change-Id: I9db17a3d945b75846ac238b59634fb595a8c8706
(cherry picked from commit 901c0a5dcb)
Merged-In: I9db17a3d945b75846ac238b59634fb595a8c8706
2022-08-02 02:00:01 +00:00
Hawkwood Glazier
1110e66232 Add Flag for Custom Clocks
Test: Manual
Bug: 229771520
Change-Id: Ic06481b3da589ab6f27ae4ff79bd39a45dee3711
Merged-In: Ic06481b3da589ab6f27ae4ff79bd39a45dee3711
2022-08-02 01:59:20 +00:00
Hawkwood Glazier
5f092e150a Merge "Migrate KeyguardClockSwitch to new shared Clock library" into tm-qpr-dev 2022-08-02 01:55:12 +00:00
Evan Rosky
a929d5bf32 Hook up setWillFinishToHome in recents wrapper
When using 3p launcher, this extra call needs to be
tracked in order to prevent returning-to the live
app instead of the launcher

Bug: 238328090
Test: atest Launcher3Tests
Change-Id: I9748da0475536373750efe9aecc7fb91b66dd61e
2022-08-01 23:12:15 +00:00
Wei Sheng Shih
334a4be176 Merge "Correct SHOW_WALLPAPER conflicts the definition of isTranslucent" into tm-qpr-dev 2022-07-29 12:44:05 +00:00
Ming-Shin Lu
ce1a4f3fe5 Add willShowImeOnTarget in RemoteAnimationTarget(Compat)
..used for signaling the launcher to crop the
remote animation target bounds when task animating on the taskbar.

If the task will show IME on the top means the animation taget would not
need to be cropped according to the taskBar insets, since visually the
taskbar is hidden when IME is visible.

Bug: 219981732
Test: manual as steps
 0) enable taskbar with Settings > Developer options > Smallest width
    as 600dp.
 1) launch an app from all apps and show the IME by tapping the editor.
 2) swipe out to home and launch it again by pressing the shortcut.
 3) Verify the animating task preview with IME shown without being
    cropped.

Change-Id: Iab526e78614c68626bd5424e0e3219044f671f4d
2022-07-28 15:41:26 +00:00
Hawkwood Glazier
a19e59d717 Migrate KeyguardClockSwitch to new shared Clock library
This change modifies the KeyguardClockSwitch and Controller
to get clocks from the ClockRegistry. Since the only clock
available from the registry is the default one, this should
have no user-facing changes, and is intended only to update
the relevant codepaths.

Bug: 229771520
Test: Manual and Automated
Change-Id: Ia053aaec6987e00de980388a6c024d8bcf5203a2
(cherry picked from commit c8b33ca43f)
Merged-In: Ia053aaec6987e00de980388a6c024d8bcf5203a2
2022-07-28 14:53:21 +00:00
Hawkwood Glazier
9158a60bce DefaultClockProvider implementation using AnimatableClockView
Bug: 229771520
Test: Automated
Change-Id: Iba6c81f8b469ef2d0a5bc38dd89454d75bfe8a43
(cherry picked from commit c742a9cb68)
Merged-In: Iba6c81f8b469ef2d0a5bc38dd89454d75bfe8a43
2022-07-28 00:51:26 +00:00