Commit Graph

1331 Commits

Author SHA1 Message Date
Jeff Chang
9e73750458 Merge "Handle the uncontrolled task in split-screen" into tm-qpr-dev 2022-07-11 05:47:58 +00:00
Alejandro Nijamkin
d6ef72ba9c Merge "Unit test for CameraGestureHelper." into tm-qpr-dev 2022-07-10 18:26:19 +00:00
Alejandro Nijamkin
4af7cc97bc Unit test for CameraGestureHelper.
Also includes some massaging of `CameraGestureHelper` to be more
testable.

Test: Made sure that double-tapping the power button still brings up the
camera correctly in all the scenarios described in ag/19214502
Bug: b/235403546

Change-Id: I54e3f760b0c2fa5738766f8b97568caf07676a8d
2022-07-09 15:02:28 -07:00
Jeff Chang
89f86c1813 Handle the uncontrolled task in split-screen
Exit the split-screen in case users put the uncontrolled task into
split-screen. This CL do below change to support handling this task.
   1. If no controlling activity appeared, dismiss the split screen
      and show a toast to inform users.
   2. Reparent all tasks out of split root when dismissing instead of
      just reparent controlling tasks.
   3. Disable the split-item from launcher for tasks that are
      uncontrolled.

Bug: 230461945
Bug: 208646963
Bug: 238032411
Test: atest MultiWindowTests
      atest WMShellUnitTests
Change-Id: Iab59561e9d532b10dab8f5063047c4b68b73eb87
2022-07-08 12:40:27 +08:00
Riddle Hsu
14bfb89c8a Fix race of releasing leashes with shell recents transition
The code flow:
RecentsAnimationController#finishController
 mOnFinishedListener.accept(this);
  RecentsAnimationCallbacks#onAnimationFinished
   *Post to "main" thread
    RecentsAnimationListener#onRecentsAnimationFinished
     TaskAnimationManager#cleanUpRecentsAnimation
      Invoke SurfaceControl#release
 *Post to "UiThreadHelper" thread
  RemoteTransitionCompat.RecentsControllerWrap#finish
   Invoke SurfaceControl.Transaction#remove
   on the same SurfaceControl.

Then it may be either NullPointerException from
SurfaceControl#checkNotReleased. Or rarely native crash by
changing the surface control from 2 threads at the same time.

Bug: 238192072
Bug: 238047903
Bug: 237631001
Bug: 237497909
Bug: 235616350
Test: Loop launch app and swipe to home.

Change-Id: I7e4ce2c273b8396ed464eb48426fd4435d6c5338
2022-07-07 00:52:59 +00:00
Iris Yang
483981c639 Merge "Take the snapshot if the thumbnail cache returns empty." into tm-qpr-dev 2022-07-01 05:52:34 +00:00
Iris Yang
8b1aed0247 Take the snapshot if the thumbnail cache returns empty.
To avoid Recents thumbnail being empty, a snapshot is triggered if no
cache exists.

Bug: 191272693
Test: manually test with Exo (Host apps on virtual display.) to check if
the Recents displays non-empty thumbnail.

Change-Id: I2a898d5127e18e6209ff236d3a72aa22c2a0ca82
2022-06-29 15:58:01 +08:00
Issei Suzuki
d5fec58feb Merge "Pass keyguard occluded status in onAnimationCancelled." into tm-qpr-dev 2022-06-28 17:24:33 +00:00
Hongwei Wang
955ef1849f Merge "Polish enter PiP animation on back pressed" into tm-qpr-dev 2022-06-28 16:40:20 +00:00
Evan Rosky
513bde42a0 Fix issues with early-finish
There were a couple of situations where both cancel and finish
collided. In those cases make sure only one is called.

Somewhat related, launcher actually continues to use leashes
even after calling the finishCallback. Since we make leashes
for launcher anyways, just use launcher's existing leash
clean-up logic.

Bug: 235616350
Test: run/monitor wm presubmits.
      Try launching and closing apps in rapid succession.
Change-Id: I7553ba9f9bbad052632a4d8d5a7225ab6c3dbce5
2022-06-27 16:23:01 -07:00
Hongwei Wang
ab392150d4 Polish enter PiP animation on back pressed
The PipTransitionAnimation#ofBounds is used when entering PiP on back pressed.
- Adjust the scale based on current animation progress
- Alter the auto-enter-pip animation running in Launcher to use the same
  mechanism
- Update the ofBounds animation to ignore small source rect hint,
  similar to what's in auto-enter-pip animation running in Launcher

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/dv35ov6nK2Mrr98DGkLNaE
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/gm8Kl7N3NPIoWoDKyDfd5s
Bug: 235268241
Test: Verify enter PiP animation on back pressed with YouTube in \
      both folded and unfolded state. See also videos.
Change-Id: I6043cff31eed7b63087ea03b17ced7549c89e4fb
2022-06-27 15:47:56 -07:00
TreeHugger Robot
5b87b8c569 Merge "Avoid using starting bounds of open transitions" into tm-qpr-dev 2022-06-27 08:30:32 +00:00
Issei Suzuki
a60723b1c8 Pass keyguard occluded status in onAnimationCancelled.
Test: No visible changes yet. Pass existing tests.
Bug: 235463625
Change-Id: Iabee71bc76e19f20702f8a2739f565aa915f9b52
Merged-In: Iabee71bc76e19f20702f8a2739f565aa915f9b52
2022-06-25 01:36:07 +00:00
Evan Rosky
f0ff75fd24 End transitions when receiving merge request
The default behavior (if nothing is done) for a merge request
is to let the animation continue and queue up the incoming animation
to start once the current one has finished.

This is maybe the "smoothest" default; however, it is not
responsive for the user. So, instead, go through and, where
appropriate, make animations "jump-to-end" when they receive
a merge request. This way the user will see the new animation
start immediately after they perform an action. There is
technically a "jump" in the animation, but it seems like the
responsiveness is preferable and the jumps aren't super
noticable anyways. This is also how legacy transitions works
so it's not a behavior change.

Bug: 236309064
Test: interrupt animations with other transitions and observe.
      Example: launch an app and then go "back" before it finishes
      animating.
Change-Id: I4a76e7efe2c610b22f3fe97b0bd3ab692a01be08
2022-06-21 15:19:52 -07:00
Wei Sheng Shih
8f3ab8cb49 Merge "Fixes a race condition when merge animation transition" into tm-qpr-dev 2022-06-20 10:48:23 +00:00
Garfield Tan
926a76243d Avoid using starting bounds of open transitions
Starting bounds are undefined in open transitions.

Bug: 235496520
Test: Animation leash isn't put at the origin of the screen display for
non-fullscreen tasks.

Change-Id: I4913daeead5471f82086d41eac61600b342d02a0
2022-06-17 10:03:54 -07:00
Winson Chung
7f371fabc8 Merge "Clear snapshot buffer preemptively if unused" into tm-dev am: 87b7e43b14 am: 1945aedc41
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18800614

Change-Id: Ic0e23837c7e560a3623ff108266bb7cb05f2b538
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:52:30 +00:00
Winson Chung
91800b7efb Clear snapshot buffer preemptively if unused
Bug: 235273016
Change-Id: Ib5105ee45905f0452ade47f90d0c090b0a4f9a84
2022-06-14 03:40:27 +00:00
Yunfan Chen
9607932ce9 Merge "Refine the provide insets parameters" into tm-qpr-dev 2022-06-13 11:38:13 +00:00
Yunfan Chen
7ced0e2438 Refine the provide insets parameters
There're 3 different parameters trying to affect the insets provided by
a window and can be set independently but are related. This change will
make a new class InsetsFrameProvider to let the window set all the
information needed for the insets at the same place.

Besides, this change also extends the insets calculation logic to
support more use cases. With this, the bars can provide insets outside
of its window frame as well.

Test: atest DisplayPolicyLayoutTests
Bug: 161689946
Bug: 232044523
Merged-In: I7059b3a222745818b6852a288416e197e2afd7b2
Change-Id: I7059b3a222745818b6852a288416e197e2afd7b2
2022-06-13 03:13:37 +00:00
wilsonshih
53baa13515 Fixes a race condition when merge animation transition
When merge a TO_FRONT transition to the recents animation,
onTasksAppeared will finish the recents animation, so there can be a
race that the open transition for recents animation might be finish
before the merge transition, which leave the merge transition become
a standalone transition.
To make the sequence correct, register a transition commit callback
to know the merge transition has done in Shell, then goes to finish
the recents animation.

Bug: 235433368
Test: enable shell transitin, quick switch back/forward and verify no
flicker.

Change-Id: I39fc898a8922f900e1e1808f92a471749664e194
2022-06-10 18:51:40 +08:00
Nick Chameyev
06272cf2fd Add DeviceConfig feature flag type to SystemUI
Adds support of DeviceConfig feature flags.
DeviceConfig flags are used by Phenotype
A/B testing framework.

Bug: 218314434
Test: change phenotype flag =>
 check that FeatureFlags returns correct value
Test: atest com.android.systemui.flags.FeatureFlagsDebugTest
Test: atest com.android.systemui.flags.FeatureFlagsReleaseTest
Change-Id: I7dd9e47280ba56b7f9ea552c0d44d3e36fc6b041
2022-06-10 10:26:20 +00:00
Vinit Nayak
3ba101f940 Merge "Remove deprecated methods from SysUiProxy" into tm-qpr-dev 2022-06-03 16:39:11 +00:00
Vinit Nayak
65030621f8 Remove deprecated methods from SysUiProxy
Bug: 233006032
Change-Id: If934c96245eb782d7905334421d437a8b45bd801
2022-06-01 16:06:10 -07:00
Tracy Zhou
2a4e1476d3 Show floating rotation button in sticky immersive mode if in gesture nav
Bug: 216182085
Test: manual
Change-Id: I00f1718e754f81e68ea2cc153540d65a65576599
2022-05-31 12:52:46 -07:00
wilsonshih
c2a9637541 Cancel the recents animation when keyguard is occluding.[1/2]
User can enter recents animation while a showWhenLocked activity on top
of keyguard by touch down navigation bar. In legacy, Launcher start the
recents animation by keep the original top activity on top. But for
shell transition, Launcher will start home activity with transient
launch flag. When core receive start activity request, unlike
startRecentsAnimation, core will try to move the activity to top, which
break the keyguard occluding state, so the keyguard will pop up on
screen before dismiss recents animation, and there is not have enough
information for shell know whether to hide the surface of the original
top activity.
To make the occluding state unchange during start transient launch, we
do not resume the launcher activity, also we do not move it to top. So
what we need to do is to collect the surfaces from launcher + top
occluding task + wallpaper and send this transition to shell.
Another change is Launcher will finish recents animation by calling the
RecentsAnimationController directly without start home activity. By
determine the top activity when set restoreTransientOrder, there will
update the hierarchy, which may change the occluding state and decide
whether to play unoccluding animation.

Bug: 230582311
Test: monitor no strange animation when running atest KeyguardTests
Test: enable shell transition. Start showWhenLocked activity while
keyguard showing. Scroll up to dismiss the activity and verify the
activity and home shall be stopped and only keyguard remains on the
screen.
Also verify entering recents works fine when device is unlocked.

Change-Id: Ia16fa01fdc09547cfb3ae1370875ac70f07ede8d
2022-05-25 12:56:10 +08:00
Alex Johnston
00090b1d4a Merge "Add background protection when work biometrics is shown" into tm-dev am: ed00c662dc am: 9eeb0112fd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18351382

Change-Id: Ic48ca6f44aabcb4cc02ac03dc656603f8e8a3c4f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 22:00:03 +00:00
Alex Johnston
b3aa96f89f Add background protection when work biometrics is shown
* Remove existing coloured background.
* Add a background with a layout that includes a
  badged icon of the app being opened.

Manual testing steps:
* Set up device with a work profile using TestDPC
* Set a fingerprint in the work profile
* Open a work app
* Lock the device
* Verify the background protection is shown behind
  the biometric prompt

Screenshots:
* Dark mode: https://screenshot.googleplex.com/3SwGWrBREYoZFaH
* Light mode: https://screenshot.googleplex.com/8bzX9wLoFGJ2ado

Bug: 206761107
Test: Manual testing
    WorkLockActivityControllerTest
    TaskStackListenerImplTest
Change-Id: I90d117a97d7457a3186953c16db8bd0bbac048ed
2022-05-16 14:20:56 +01:00
Tony Huang
0a066377f3 Merge "Remove supportsSplitScreenMultiWindow" into tm-qpr-dev 2022-05-16 08:04:27 +00:00
Nick Chameyev
0f3c4e522e Extract unfold classes to a separate library
No behaviour changes in this CL.
Extracted classes related to the fold/unfold
animation (that plays on foldable devices) to
a separate library that does not depend on
system classes. This is necessary to ease
reusing these classes in live wallpapers.

Bug: 231936088
Test: fold/unfold device
Change-Id: Ic1e1ec742867fca9c1209b930accd5738de18e39
2022-05-13 13:33:17 +00:00
Tony Huang
98b4783fa8 Remove supportsSplitScreenMultiWindow
For new split screen, we are using supportsMultiWindow and other
multi-window features should use it too so remove
supportsSplitScreenMultiWindow and update some files which still
use it.

Bug: 199236198
Test: pass existing tests
Change-Id: I3b3ec3376a4c79295f9d9f913585534a3815e75a
2022-05-11 17:52:34 +08:00
Dave Mankoff
2a9196841c Remove last call to Dep.get from NavigationBarView
Removes the last call to Dependency#get from NavigationBarView. A few
more calls were added in the process, but they will be easier to deal
with in future cls.

Bug: 218354102
Test: manual && atest SystemUITests
Change-Id: I0b6b3837d9f1cfd11f0cdb4089fb51ecf79b467b
Merged-In: I0b6b3837d9f1cfd11f0cdb4089fb51ecf79b467b
2022-05-10 00:23:52 +00:00
Dave Mankoff
6c0c934313 Remove last call to Dep.get from NavigationBarView
Removes the last call to Dependency#get from NavigationBarView. A few
more calls were added in the process, but they will be easier to deal
with in future cls.

Bug: 218354102
Test: manual && atest SystemUITests
Change-Id: I0b6b3837d9f1cfd11f0cdb4089fb51ecf79b467b
Merged-In: I0b6b3837d9f1cfd11f0cdb4089fb51ecf79b467b
2022-05-09 20:45:25 +00:00
Justin Weir
1ebcb179b4 Merge "Ensure log buffers are dumped to file on uncaught exceptions" into tm-dev am: b41c2879b4 am: 844af86b3d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17915248

Change-Id: I3acca5dc2642a2c001d97a841834e0560cfaa139
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 13:36:11 +00:00
TreeHugger Robot
bd3b9d8695 Merge "Listen for VIS window visibility changes in SysUI" into tm-dev am: 0b870355cb am: 9ef47d9ed9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17211291

Change-Id: I7517f6109e45142d02b9749355f5ca7398847a53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 22:52:48 +00:00
Justin Weir
7209b5baf1 Ensure log buffers are dumped to file on uncaught exceptions
Move the functionality for wrapping an uncaught exception pre-handler
from PluginManager to a standalone manager. Make DumpHandler register
another uncaught exception pre-handler that will tell the log buffer
eulogizer to dump contents to a file.

Fixes: 213884413
Test: manually verified, added tests, and ran atest
Change-Id: If829fc33769819624530f766178689ecf0374926
2022-05-02 20:41:24 +00:00
Josh Tsuji
49b3051783 [conflict] Merge "Use Launcher smartspace instead of SysUI's for the shared element transition." into tm-dev am: 7b5e80f2f6 am: 4c4fac6cad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17892808

Change-Id: I366fed58aafc477399a792e5b65fca4df915a4d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 11:07:45 -04:00
TreeHugger Robot
0b870355cb Merge "Listen for VIS window visibility changes in SysUI" into tm-dev 2022-04-30 03:29:16 +00:00
Winson Chung
4801f789c5 Listen for VIS window visibility changes in SysUI
Bug: 222308557
Bug: 216301097
Test: Manual, invoke assistant on the lockscreen and verify you can
      go back

Change-Id: I675a0c694b8d85e7cd67f7a550fe8e8ab85e9ad2
2022-04-29 21:11:49 +00:00
Josh Tsuji
ddfe8bda75 Use Launcher smartspace instead of SysUI's for the shared element transition.
See justification/explanation in linked bug.

I re-ordered some methods in the unlock controller so they'd make more sense,
they're generally called from top to bottom now during the unlock sequence.

Bug: 229890190
Fixes: 227713319
Test: atest SystemUITests
Test: manual
Merged-In: I58fa437eea183691ff29548143664698498c2105
Change-Id: I58fa437eea183691ff29548143664698498c2105
2022-04-29 05:40:54 +00:00
Nick Chameyev
f970175b79 Merge "Initialize StatusBar unfold animation with 1f progress" into tm-dev am: cd1db9f39e am: bbe6bb795b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17884335

Change-Id: Ic96c76cc1a94621deab7eaf768ac2b1767d4d240
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-25 14:58:58 +00:00
Nick Chameyev
cd1db9f39e Merge "Initialize StatusBar unfold animation with 1f progress" into tm-dev 2022-04-25 14:24:32 +00:00
Issei Suzuki
3a0ce75489 Merge "Add timestamp to ActivityOptions.OnAnimation*Listener" into tm-dev am: 408b90ffad am: 69ca04c6e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17860344

Change-Id: I2eee80f5c11f997b8071ac62bcb1afa939365251
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-23 05:10:02 +00:00
Issei Suzuki
8fbc23c5c9 Add timestamp to ActivityOptions.OnAnimation*Listener
Bug: 229948029
Test: atest ActivityTransitionTests
Change-Id: I1e6d21c8b603f4e81bde6c649868baad625c2b38
2022-04-22 21:47:24 +02:00
Josh Tsuji
e585c86f02 Merge "Invalidate home task snapshot onWakeAndUnlock." into tm-dev am: 30183c1cf8 am: 84545d2acf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17802841

Change-Id: Ia919ca13990c794f6ee5f47fae7bf9393bff5208
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 18:59:20 +00:00
Josh Tsuji
30183c1cf8 Merge "Invalidate home task snapshot onWakeAndUnlock." into tm-dev 2022-04-21 18:23:28 +00:00
Nick Chameyev
86054beef0 Initialize StatusBar unfold animation with 1f progress
Initializes move from center animator for the statusbar
views with 1f progress, so when the device is booted
in unfolded state and rotated it the translation
wil be applied with 1f progress.

When booted in folded mode the progress will start
from 0f so it doesn't affect the animation.

Bug: 229738545
Test: kill sysui in unfolded state, rotate the device,
  rotate during fold/unfold animation
Test: atest com.android.systemui.statusbar.phone.StatusBarMoveFromCenterAnimationControllerTest
Change-Id: Ia0d4a44ddc444420d3695cab328558bf2fbe589d
2022-04-21 14:22:24 +01:00
Tony Huang
6ebe572217 Merge "Add jank instrument support for split screen enter and exit transition" into tm-dev am: 64202a268d am: ef3ee7afd4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17518067

Change-Id: I168e8b069a658f09de7d85c4c295eddfc01fcb8f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 12:09:32 +00:00
Tony Huang
64202a268d Merge "Add jank instrument support for split screen enter and exit transition" into tm-dev 2022-04-21 11:31:22 +00:00
Hongwei Wang
c9e0ac722a Merge "Revert "Deprecate getSfInstance usage in PiP component"" into tm-dev am: 654c80a2df am: d50b58b680
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17805905

Change-Id: I46e20922880bee9fee52947b5787cae1e6e21e10
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-20 20:03:42 +00:00