This CL fixes a bug where the width of any SystemUIDialog animated by
DialogLaunchAnimator would be smaller than it was supposed to be. See
b/230825604#comment4 for more info.
Bug: 230825604
Test: Manual
Change-Id: Ief2265b93fb4e45138f2f8c890c085d00e86b76d
Allows the user to specify an destination for the addition animation,
and removes the view from the hierarchy animating it towards that
position.
Bug: 224980454
Test: manual and unit tests included
Change-Id: I3d5d6c839ce40d0684f1613f3d48545abde9c309
The goal is to have a clear API difference between views animating from
not being on screen to being visible and the normal view bound
animations.
Allows the user to specify an origin to the addition animation, and
animates the view starting from that position.
Bug: 224980562
Test: manual and unit tests included
Change-Id: If0e86a3d240582c3e276f76c029cb8d3251e82b0
With shell transition, there won't be task info if the transition
is launching activity in the same task. ActivityLaunchAnimator
assumed the task info is non-null, which causes NPE.
Bug: 223397404
Test: adb shell setprop persist.wm.debug.shell_transit 1; reboot
Long press quick settings tile from notification multiple
time. Especially launch the same tile twice, systemui
should not crash.
Change-Id: I0ad1fef17653d72162d430339ac7e8a716aa9bfe
When ViewRootImpl is going to draw a frame due to a blast sync request,
we call forceDrawNextFrame to ensure we get a draw this vsync, even if
RT animation rendered a frame. This will ensure that we aren't required
to reschedule a draw either in rt thread or ui thread since we'll get a
frame back as long as there's an available buffer.
We also disable rt animations if a sync set has started with Syncer and
then re-enable when the sync set is complete. This ensures we don't
continue to acquire buffers for a render thread scheduled animation
during a UI animation since we want the UI request to get the buffer.
Test: Open internet dialog from notification shade on 60hz device
Fixes: 217621394
Bug: 200284684
Change-Id: Ic1534d21b0ee2ad82f20ff34df4cbbbad87557fd
Replace the usage of consumeNextDraw with the SurfaceSyncer since
it's safer and integrated with VRI in a cleaner way.
Test: Internet Dialog in Notification Shade
Bug: 200284684
Change-Id: Ia837086040329c5fd3b8bb5b0adb0fddb339f3f9
This CL exists solely because git refuses to mark files as renamed if
the diff between the before and after is too large.
Bug: 224980562
Test: manual
Change-Id: Ie0c2a878437b189d523d7a6955baa125fd0b2998
Includes the ability of animating a single upcoming layout or all
following layouts until the animator is detached.
Bug: 221432937
Test: unit tests included, also manual
Change-Id: Ie15ab83b1b06ef4d0b388177682ed51479f37dc1
This CL makes the launch animations a bit more robust by trying to find
a background in the View that is expanded into the activity/dialog
instead of just taking the View background (that can sometimes be null).
See b/222668708#comment1 and #comment2 for before/after videos.
Bug: 222668708
Test: Manual
Change-Id: I590b6d77a7c9b29a73f37e1f8072643cc8c0bcfa
When overriding pending activity starts using remote animations,
we're now also allowing the passage of a launch cookie to associate
the task with the launched app. This allows us to return to the
right widgets for certain apps using broadcast trampolines.
Fixes: 220290671
Test: add Photos widget, return properly to widget
Change-Id: I339ea827836fa53ab5bb1617a72f9e0e5ae0f5ec
This CL fixes the animation triggered when opening an app/dialog from
one of the new QS buttons.
Before this CL, the background of those buttons was oval and therefore
can't animate its radius.
This CL changes the oval shape by a rounded rectangle so that it can
properly animate the radius of the background.
Bug: 217196619
Test: Manual
Change-Id: I77ebbb9be62b3457844e06803ab3ce7b9af5d594
See b/214961273#comment1 and #comment2 for before/after videos as well
as technical explanations on how this animation works.
This CL also enables the generation of Java 8 default method bodies in
interfaces, in the animation library. This is necessary to avoid
unexpected behaviors when using @JvmDefault on an interface +
delegation, which is a common pattern when using the animation library.
See [1] and [2] for more info. Note that this is enabled only for the
animation library (and not SystemUI(Lib)) to avoid breaking code
depending on the (now deprecated) @JvmDefault method in SysUI.
[1] https://youtrack.jetbrains.com/issue/KT-34612
[2] https://blog.jetbrains.com/kotlin/2020/07/kotlin-1-4-m3-generating-default-methods-in-interfaces/
Bug: 214961273
Test: atest DialogLaunchAnimatorTest
Test: Manual
Change-Id: I27d53400a5dc852543a68f5b6f107d9eb08b06db
This works by separating an app launching to 2 phases
(similar to legacy fixed rotation). First it launches
the app into a different rotation. Once the animation
finishes it creates a new seamless display-rotation
transition.
Because we have displayRotation in windowconfiguration,
we can directly rotate a window's surface instead of
checking explicitly for fixedRotationState. Since the
second-phase is a transition, we don't (ab)use
seamlessRotator. Once the display lines-up, the
surfaces and configurations automatically update.
Since we still want to explore shell-transitions style
rotation (single-transition), add a system property
to turn it off and on.
Bug: 217560545
Test: existing tests and manual tests
Change-Id: I0b34b32ff5b2650a519d3c195df452de446cf515
systemui also defines several remote animations. Given the number
and complexity of animation entry-points in sysui, insert a
cheeky hack to swap remotetransitions in for remoteanimations
when shell transitions are enabled.
Bug: 217810915
Test: Open quick-settings, poke Settings icon. Observe animation
and no paus.
Change-Id: I462034210f28051a03812eb6ae650fa1f0446ef5
In DialogLaunchAnimator, disable animation sync if device is low-RAM.
This is a mitigation to workaround a bug in animations sync which
currently causes the UI to freeze for 4s when opening a dialog on
certain devices.
Also, rename isForTesting to forceDisableSynchronization for clarity
Test: Tap "internet", "power", or "select-user" buttons in QS
Bug: 217621394
Bug: 216391326
Change-Id: I33117466b5002671ee086aedade56737b19c8edb
This is used when the lock screen is visible and an activity occludes it,
such as the camera. Currently, the camera launches behind the lock screen
and then the lock screen janks out of the way to show the camera.
There are currently some pretty severe performance issues, but I'm not sure
yet whether that's due to the new launch animator, or the fact that the
old animation is so janky that you can't really tell. I'm investigating
that, but we should get this into the build to start working out any bugs
with the remote occlude animations.
This requires remote occlude animations to be enabled:
adb shell setprop persist.wm.enable_remote_keyguard_animation 2
Test: atest SystemUITests
Bug: 197312643
Change-Id: Id801e44c25c6e2340b4269d215b9a1c056f0ceff
Before this CL, the UDFPS affordance would instantly disappear after
launching an Activity (like Device Controls) over the lockscreen.
This CL now nicely fades out the affordance during the launch animation,
unless the Activity requested the UDFPS (like the Wallet).
See b/213555622#comment1 for before/after videos.
Bug: 213555622
Test: Open device controls and wallet over lockscreen
Change-Id: I589a4a6c10a118d05fae87b70d14c924d468b63f
This CL fixes some accessibility issues that would happen with dialogs
launched by the DialogLaunchAnimator. See bugs for more info.
Bug: 204944038
Bug: 208951968
Bug: 208951526
Fixes: 204944038
Fixes: 208951968
Fixes: 208951526
Test: Manual
Change-Id: I35b12a6e2bb2c4ae8556178fb634deb963457db6
* changes:
Change DialogLaunchAnimator X-axis interpolator
Extract interpolators and durations out of LaunchAnimator
Synchronize dialog launch animation using BLAST
This dialog changes the interpolator used to animate the X-axis position
of dialogs during the launch animation. This avoid animating the dialog
out of the screen bounds (see b/208241926#comment1).
Bug: 208241926
Test: Manual
Change-Id: Ia5accb747615fcc8410b5c488ff13617556305be
This CL extracts the durations and interpolators from LaunchAnimator so
that we can use different durations and interpolators in the
DialogLaunchAnimator (compared to the ActivityLaunchAnimator).
This CL is a no-op and does not change the interpolators and durations
yet. Those will be changed in a follow-up CL.
Bug: 208241926
Test: Manual
Change-Id: Ic4d7def45cabc8c73700efcec67706eaf81b2b9e
We may set a z-order different from the prefix order, for example
TaskDisplayArea#adjustRootTaskLayer. As a result, we should no longer
set animation leash layer based on the prefix order.
Fix: 208793409
Test: manually test launching activity over another
Change-Id: If8d545ca7a9ac42162262ad3a8f95b4ac9f65585
This CL synchronizes the start of the launch and the end of the exit
dialog animations using BLAST. This replaces the previous
synchronization that was performed using preDraw listeners, which was
not optimal as it led to flickering (and was also slower).
Bug: 193634619
Test: Manual
Change-Id: I30bd56fcd082b76c4c7693da8c1d59bc2f6f781b
This CL is a refactoring of the DialogLaunchAnimator and a major change
in how it works internally.
Before this CL, when DialogLaunchAnimator.show(originalDialog, ...) was
called, it would create a fullscreen dialog (called hostDialog) to
which we would add the content view stolen from the originalDialog (that
would then be hidden). We would then run the launch animation in the
host dialog and listen for show(), hide() or dismiss() calls to the
originalDialog to know when we should show(), hide() or dismiss() the
hostDialog.
The main reason we did that was because there was no way to override the
dismiss() behavior of the originalDialog, which we need to do given that
we want to animate the dialog into the view that showed the dialog
before actually dismissing it.
This approach had multiple downsides:
- We were showing the dialog content view inside a different window
than the one in which it was created, therefore any change made to or
any listener added to the originalDialog window was lost.
- Code calling DialogLaunchAnimator.showFromView needed to know that
their dialog content will be moved to another window, which is
unexpected and can lead to subtle bugs.
- We were waiting for 2 dialogs to be shown instead of 1 before being
able to start the animation.
This CL does what we should have done since the beginning: it adds a
hidden API to Dialog so that we can override what happens when
Dialog.dismiss() is called. This allows the DialogLaunchAnimator to run
the exit animation into the view that triggered the dialog before
actually dismissing it. The only modification that
DialogLaunchAnimator.show(originalDialog, ...) now does to the
originalDialog is making its window fullscreen and inserting two views
between the originalDialog DecorView and its children. The first
inserted view is a fullscreen transparent background used to dismiss the
dialog when the user taps outside the dialog content. The second
inserted view is a View that we size and position the same way that the
DecorView was before we made it fullscreen, and to which we set the
originalDialog background. This view now serves as a "fake window" with
the same size, background and position as the original window
(DecorView).
This CL improves the time to start the launch animation by 20-25%
(measured in a totally unrigorous logcat way).
Bug: 193634619
Test: atest DialogLaunchAnimatorTest
Change-Id: If09eda7b06e83b3ed7714cec97afef08b3d9fd3e
This CL animates the power menu when it is triggered from its QS button.
It does that by first adding support for fullscreen dialogs in
DialogLaunchAnimator, given that the power menu dialog is fullscreen for
legacy reasons.
Note that I first tried to migrate it to a non fullscreen dialog, but I
hit issues with the ConstraintLayout + Flow that are used to display the
grid of the power menu items (see b/206097842 for more info).
In this CL, I also removed:
- Custom window flags that were added in the past and don't seem to be
needed anymore.
- The handwritten animation when triggering from the power button. We
now simply fade the dialog in/out like we animate all the other
dialogs (approved by UX in b/202257171#comment16). I will improve
this default animation in a follow-up CL too.
- Some dialog reinflation that would happen when the configuration or
UI mode would change. For the former, I still make sure that we
recompute the maximum number of items per row. For the latter, it
would not happen while this dialog is shown as changing the UI mode
would require dismissing the dialog first anyways.
See b/202257171#comment11 for a video.
Bug: 202257171
Test: Manual
Test: atest GlobalActionsDialogLiteTest
Change-Id: Ib5facb579c8dce114f29c07502a4a10b50d281be
This purpose of InteractionJankMonitor.begin() and
InteractionJankMonitor.end() is used for e2e tests
(scenario / latency / benchmark tests)
SysUI had setup dagger for InteractionJankMonitor,
it would be helpful on unittest if inject instance
in SysUI code directly.
Test: atest SystemUITests
Bug: 206720526
Change-Id: I59af3f444bbc836c2ae2c0ef0803f788dba9ab46
Allows to dismiss a dialog stack (dialogs launched from dialog content)
by dismissing the top one to the original touchSurface. After this, all
the intermediate dialogs are dismissed.
Use this in the user switcher dialog.
When adding users, the dialog that opens to set the name and picture is
not part of this stack (it's a separate activity), so the dialog stack
is collapsed before launching the activity.
Test: atest SystemUITests
Bug: 185360864
Change-Id: Ife8e0f9189783b69034ce660d1075c3f76fbbf06
Allows to dismiss a dialog stack (dialogs launched from dialog content)
by dismissing the top one to the original touchSurface. After this, all
the intermediate dialogs are dismissed.
Use this in the user switcher dialog.
When adding users, the dialog that opens to set the name and picture is
not part of this stack (it's a separate activity), so the dialog stack
is collapsed before launching the activity.
Test: atest SystemUITests
Bug: 185360864
Change-Id: Ife8e0f9189783b69034ce660d1075c3f76fbbf06
This CL fixes a regression that was caused by ag/16191211: when opening
the media output dialog, we would animate from the media dialog content
instead of its parent (that has the dialog background).
This CL changes that by detecting that the view we are launching from is
actually the content of a dialog that was animated using
DialogLaunchAnimator, and animates its parent to also animate the
background.
See b/200781817#comment8 for before/after videos.
Bug: 200781817
Test: Manual
Change-Id: I20cf8bdff8b6d29e9aa458f96d65851a0298f98d
This CL animates the height of the Internet dialog when it changes,
using a custom layout animator.
Note that I have tried using TransitionManager to get a better animation
(that would also properly fade elements in & out) but hit a few bugs
that made me lose confidence in TM (see b/203045010).
See b/201046726#comment20 for a video.
Bug: 201046726
Test: Manual
Change-Id: I02a0bfe67b705ea68e0d82a310a4361a94c1200d
Before this CL, when animating a dialog from a View, we would extract
the original dialog Window background and set it as the background of
the original dialog content View. This would cause problems if that
original dialog content View had some paddings and if the background had
insets, as setting the View background would mess up the View paddings.
This CL now adds an additional View between the host dialog root and the
original dialog content Wiew. We set the original dialog Window
background to this additional View, so that the original dialog View
remains unchanged.
Bug: 193634619
Test: atest DialogLaunchAnimatorTest
Test: Manual, launch the User Switcher dialog and observe that the
paddings are correct.
Change-Id: I64e688431c2d205f0cf200b9debfe195dc3e2364
Before this CL, system dialogs would not react to configuration changes,
which would cause weird UI issues when folding into a smaller screen.
This CL makes all SystemUIDialog's listen for configuration changes, and
resize their window accordingly.
Bug: 204042506
Test: Manual
Change-Id: I4cf1dbfff2a95c83ed3e240d165eae60660c429b
Before this CL, when an animated dialog was dismissed because we were
locking the device, we would run the exit animation while fading out the
dialog window with the current doze amount. This did not look really
good.
This CL now disables the exit animation when the dialog is dismissed
because the device was locked.
See b/193634619#comment8 for before/after videos.
Bug: 193634619
Test: Manual
Change-Id: I516b5c0e9ccf9d5650b5708350472aeb209d71e5
This CL adds some synchronization to the dialog launch animation to
avoid flickering at the beginning and the end of the animation. It does
so by drawing the touch surface twice (in both the original window and
the dialog window) using a temporary ghost that is added/removed
before/after the animation.
I decided not to reuse the ghosts created by
GhostedViewLaunchAnimatorController because this would make this change
much more invasive, which I wanted to avoid given that the end goal is
to use BLAST synchronization instead of this CL.
Change-Id: Iac2eb2a2e78801a43847eebc72679c4952a73f1f
Bug: 193634619
Test: Manual
This CL animates the launch of the internet dialog from the touch
surface that started the dialog.
Note that changes of the content of the dialog itself are not animated
yet, this will be done in a follow-up CL.
See b/201046726 for before/after videos.
Bug: 201046726
Test: Manual
Change-Id: Iaf45371eec5d8cf1f5c6a13ebf20474a0b565abc
Changing split shade status bar alpha so that it's dependent on shade expansion. This has two effects:
- it doesn't show on HUN (alpha = 0), which is the main issue
- it's animated on expansion and transition between launcher status bar and split shade status bar is less jarring - this likely needs to be adjusted in the future but for now should be good enough.
Also splitting getNotificationScrimAlpha into two separate ethods as it's usage got weirder over time and inline comments in method calls got outdated.
Also moving split of getNotificationScrimAlpha to seperate object - it feels a bit weird that this very specific interpolation calculation is in the general Interpolation object.
Bug: 198595419
Test: Receive HUN and NOT see split shade status bar on top of regular status bar
Change-Id: I3bfcd0697da4798fc845d2636303fd3616e131fc