Commit Graph

447 Commits

Author SHA1 Message Date
Chris Li
cbc449164b Merge "Register remote animation per Task" into tm-dev 2022-04-02 10:36:24 +00:00
Shan Huang
69a3984aae Remove OnBackInvokedDispatcherOwner interface.
Test: m -j update-api. Build and flash and test back behavior throughout
the system.
Bug: 227500290

Change-Id: Ibdb13d02e044741d05d99f1cad96e43dc0129fe4
2022-04-01 20:27:34 +00:00
Vadim Caen
d0923a2197 Merge "Split animation methods out of OnBackInvokedCallback" into tm-dev 2022-04-01 20:13:30 +00:00
Vadim Caen
c627777dda Split animation methods out of OnBackInvokedCallback
This makes OnBackInvokedCallback SAM compatible

Bug: 227789359
Test: atest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationLegacyTest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationTests \
        WmTests:com.android.server.wm.BackNavigationControllerTests \
        FrameworksCoreTests:android.window.BackNavigationTest \
        FrameworksCoreTests:android.window.WindowOnBackInvokedDispatcherTest \
        CtsViewTestCases:android.view.cts.OnBackInvokedDispatcherTest
Change-Id: Iab86b0488f1b3048eb02042191acaeb6a645a0bc
2022-04-01 20:09:26 +00:00
Vadim Caen
a28e989921 Merge "Some cleanup logging and test for back navigation" into tm-dev 2022-04-01 15:57:59 +00:00
Vadim Caen
71297c8aab Some cleanup logging and test for back navigation
- Better logging
 - Remove method form OnBackInvokedDispatcher interface (but not the
   implementation)
 - Add test for ag/17211289

Bug: 222675481
Test: BackNavigationControllerTests#testUnregisterCallbacksWithSystemCallback
Change-Id: I6a3ae30da7e29dddda116acd8fa0c9af4b9faa6e
2022-04-01 15:57:49 +00:00
Chris Li
add68184dd Register remote animation per Task
Before, we register remote animation per organizer, and assume it only
organizes in one Task. Now, we register per organizer Task if there is a
rule that supports split in the Task width.

Bug: 207720388
Test: atest WMJetpackUnitTests
Change-Id: Iac4e10af9aa0e7846c81b036b2cf708b6cbe627e
2022-04-01 16:47:46 +08:00
Nick Chameyev
3f12009a16 Migrate unfold animation to Shell transitions [Part 1]
Adds a trigger to DisplayContent that creates
unfold transition before applying the display size
and marks it as ready when the sizes are applied.

Adds a placeholder animation for fullscreen tasks.

Bug: 204925795
Test: enable shell transitions, open an app, unfold =>
 check that app surface is animated
Change-Id: Ia88178a7c7849a99c17b4d18117a05b2a0fb8b7f
2022-03-31 10:38:56 +00:00
Hongwei Wang
b2a5b198cd Merge "Handle PiP shadow radius in WMShell" into tm-dev 2022-03-30 22:23:51 +00:00
Shan Huang
82f3bb31ea Merge "Remove DISPATCH_BACK_INVOCATION_AHEAD_OF_TIME." into tm-dev 2022-03-30 14:58:54 +00:00
Shan Huang
778d3d83f8 Remove DISPATCH_BACK_INVOCATION_AHEAD_OF_TIME.
We are not gating the new back dispatch by targetSdkVersion in T. The new dispatch is controlled by the enableOnBackInvokedCallback app
manifest flag (which defaults to false).

Test: m -j update-api
Bug: 195946584
Change-Id: Iab59051ec5b6336ca4d42cc47015fe86a3f37942
2022-03-29 20:47:53 +00:00
Chavi Weingarten
8089e6f249 Merge "Force draw during a blast sync and disable rt animations" into tm-dev 2022-03-29 18:38:02 +00:00
Hongwei Wang
2708c3a74d Handle PiP shadow radius in WMShell
Deprecate also the shadow radius for PiP in Task

Bug: 206508708
Test: Verify the PiP enter/exit/move/resize transitions
Change-Id: I8ff83dd4e626a3455373fed6c908cf131ecae8fe
2022-03-28 16:43:46 -07:00
Vadim Caen
09f7f6f69b Merge changes from topic "presubmit-am-b87ddd3bbf2947f1aa639cddcee6ecb8" into tm-dev
* changes:
  Remove callback before WindowState removal
  Improve startBackNavigation stability
2022-03-28 18:53:26 +00:00
chaviw
7b7dabc218 Force draw during a blast sync and disable rt animations
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
2022-03-28 09:41:25 -05:00
Wei Sheng Shih
9a14b7c209 Merge "Adjust branding image layout if needed." into tm-dev 2022-03-28 07:05:56 +00:00
Kohsuke Yatoh
5eae33da58 Merge "Move FEATURE_IME to TestApi" into tm-dev 2022-03-25 17:58:40 +00:00
Vadim Caen
d1a57ed491 Remove callback before WindowState removal
ViewRootImpl was removing the callback from the server after the
windowState was removed, which was consistently failing resulting in an
exception in the log.

Now the removal is done before the ViewRootImpl's window removal

Test: Manually check that the error is not appearing in the log
Bug: 226089354
Change-Id: Ie9cb9940791b16d6ae1b243079794583c87b1a5c
2022-03-25 14:11:45 +01:00
Vadim Caen
6a074eca5c Improve startBackNavigation stability
- Use the focused window instead of the topApp window
    - Instead we now rely on WindowManagerService to get
     the focused window.
    - SystemUI does not have ActivityRecord so we can't rely
     on the top window of the Task to find the correct
      window on which the callback will be called.

  - Introduce a Builder for BackNavigationInfo
    - This reduces the number of variable needed outside the synchonized
    block.
    - It also reduces the number of early return of BackNavigationInfo
    instances

  - Adding log messages to help further debug the method.

Test: BackNavigationControllerTests
Test: Manual dismiss of SystemUi dialog in QS
Bug: 216604581
Fixes: 221458292
Change-Id: I9ba2c7f89956f34d6338824502c210b3e58dc076

Introduce builder for BackNavigationInfo

Change-Id: I14b4a4b3abc8f417998b7b32831cb3d5c4faa491
2022-03-24 14:14:26 +01:00
Evan Rosky
53e39e5d06 Merge "Pass through Recent's finish-but-not-really intent" into tm-dev 2022-03-23 22:45:17 +00:00
Jerry Chang
4f5a02e5ec Merge "Integrate recent animation of single-root split with shell transition" into tm-dev 2022-03-23 00:47:08 +00:00
Evan Rosky
69a8b77741 Pass through Recent's finish-but-not-really intent
There are a few situations where recents will tell WMCore
that it is finishing (going home), but then actually doesn't
finish. In these cases, we need to tell WMCore not to enter
PiP even when it normally would.

This functionality is added to shell-transitions by adding
a signal to WindowContainerTransaction.

Bug: 223317893
Bug: 223317556
Test: open pipable, go to recents, swipe pipable to close.
Change-Id: I969ae8b562aa54fc06e35164e676205682f24994
2022-03-22 14:54:24 -07:00
TreeHugger Robot
8bd2541e6e Merge "Deprecating windowSplashScreenAnimationDuration attr." into tm-dev 2022-03-22 14:23:31 +00:00
Chris Li
0300924d51 Move FEATURE_IME to TestApi
This is to allow us to check if the IME is organized by WM Shell in CTS.

Test: atest KeyboardVisibilityControlTest#testRestoreImeVisibility
Bug: 223640691
Change-Id: I19457c4cd26e45a42ba4522fb8ef54a9682cda07
2022-03-22 18:01:28 +08:00
Tiger Huang
630c25ddaa Merge "Let the client compute the backdrop frame on its own" into tm-dev 2022-03-22 04:05:18 +00:00
Vadim Caen
44311a6646 Merge "Fix setSplashScreenTheme documentation" into sc-dev am: ffad2f714d am: 73ee4fe036
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16343578

Change-Id: I11ada44b09906012acd33000caeed2b479420572
2022-03-21 14:05:10 +00:00
wilsonshih
a16fe36115 Adjust branding image layout if needed.
THe branding image could overlaps the icon, adjust the layout or hide
it according the window size at runtime.

Bug: 203366774
Test: modify wm size, verify the branding image won't overlaps on icon.
Change-Id: I094c8f2a3f1c8f5fbc87e2234ab2c03daae86c7c
2022-03-21 16:03:36 +08:00
Tiger Huang
351d589dad Let the client compute the backdrop frame on its own
Since the new split-screen doesn't need the fullscreen backdrop frame.
The backdrop frame will always be the window frame. The server doesn't
need to send the backdrop frame to the client. The client just needs to
offset the backdrop frame to (0, 0).

This CL also moves the logic of calling onWindowSizeIsChanging to the
handler thread because it reads some fields which should only be
accessed on the handler thread. Otherwise, there might be race
conditions.

Bug: 161810301
Test: 1. Perform drag-resize and drag-move on a freeform app, and see if
         the layout is expected.
      2. Move the divider in the split-screen mode, and see if there is
         any abnormal.
Change-Id: Ie0058db0447260dd0561634179fc7721d965a9e2
2022-03-20 14:36:54 +08:00
Chavi Weingarten
249f65916d Merge "Store last data received from WindowInfosListener" into tm-dev 2022-03-18 21:11:20 +00:00
wilsonshih
4748ce9e02 Deprecating windowSplashScreenAnimationDuration attr.
In previous CL(5e0c72a2c5) we provide a
way to read the animation duration from AVD and AnimationDrawable,
which should be enough to deprecate this attribute since the naming
could confusing developers.

The attribute was used to cut off the animation if the icon is
animatable, but since the animation can be stop when removing the
splash screen view from window, the attribute is useless so framework
won't read it anymore.

The attribute was also be the return value from
SplashScreenView#getIconAnimationDuration, however, since this API was
designed to let developer decide when to cut off the animation if the
app want to handle OnExitAnimationListener#onSplashScreenExit,
developer can pre-decide the duration in the app without set this
attribute.

Bug: 211707095
Test: atest SplashscreenTests StartingSurfaceDrawerTests
Change-Id: Ib3a0b4314bd15158c392e56c0e125a33c753e716
2022-03-18 09:44:37 +08:00
Vadim Caen
3686891611 Change parameter order to make it SAM compatible
Move the callback as the last paramter to registerOnBackInvokedCallback

Test: Existing
Bug: 224562951
Change-Id: I8608a03b53baa04bedee81d2e86b2339abd6c594
2022-03-17 22:19:54 +01:00
Jerry Chang
bb750d8ad3 Integrate recent animation of single-root split with shell transition
Stop propergating child task information up if the parent task having
multiple child task changes in the same transition. And skip wrapping it
into the final remote animation targets so its child tasks won't get
transfered multiple-times in such transition.

Bug: 207185041
Bug: 206487881
Test: enabled shell-transition and triggered split screen, observed
      the recent animation works properly
Change-Id: I8d2c62df99ccb88303aa2b06dd18f2f4edb330f2
2022-03-16 13:49:04 +00:00
Tiger Huang
c1cf2472f6 Merge "Use ClientWindowFrames to collect frames computed by WindowLayout" into tm-dev 2022-03-15 18:43:37 +00:00
TreeHugger Robot
b6468930d0 Merge "Revert "Turn off predictive back"" into tm-dev 2022-03-14 22:55:32 +00:00
Shan Huang
d7d9fb32d7 Revert "Turn off predictive back"
This reverts commit ad89a82145.

Reason for revert: b/222170518 was unrelated to gesture back, and is now fixed.
Test: m -j. Test back behavior throughout system.

Change-Id: Ia27c7ea97416831355e1949ec6874de570b52108
2022-03-14 17:09:00 +00:00
Tiger Huang
45790587c7 Use ClientWindowFrames to collect frames computed by WindowLayout
This is a step to move the window layout to the client side.

ClientWindowFrames is used to carry window frames dispatched from the
server to the client for now. Later, the window frames will be computed
at the client side, and the frames will be sent to the server side via
ClientWindowFrames.

Bug: 161810301
Test: presubmit (no behavior change but only code refactors)
Change-Id: I83d8cfff2432e09759ef5b3d5f3b21731fc71bff
2022-03-14 22:30:45 +08:00
TreeHugger Robot
77946e2ae8 Merge "Add API to indicate supported windowing modes on the virtual displays" into tm-dev 2022-03-11 01:22:20 +00:00
chaviw
277f1608be Store last data received from WindowInfosListener
Store the last data received from WindowInfoListener on the client so it
can easily be retrieved when a new caller registers to listen for
updates. This will help with accessibility since they won't need to
register their listener all the time and instead just get the last data
that was sent, immediately.

From the system server process, the data is constantly being updated
because WindowInfo is sent to InputDispatcher when any geometry in SF
changes. If a different process registers for the WindowInfoListener,
it's possible the initial data will be empty since we won't explicitly
request the latest data immediately.

Bug: 222767081
Test: Accessibility register only when enabled
Change-Id: Ib87edde7a14be8584504d5d8d6c41f20bde5c698
2022-03-09 09:40:40 -06:00
Iris Yang
6d709f6f95 Add API to indicate supported windowing modes on the virtual displays
1. Add new API in DWPC to get windowing features of the virtual display.
2. In ActivityRecord, consume the value of the allowed windowing modes
   of virtual display.

Bug: 180435098
Test: atest WmTests:ActivityRecordTests#testSupportsPictureInPicture && atest WmTests:DisplayWindowPolicyControllerHelperTests

Change-Id: I39a6cd9417f266f7fdef72cc054263c3ca4c5650
2022-03-09 12:48:52 +00:00
Jerry Chang
4ab407e5fe Merge "Support to get the exact task which IME is attached to" into tm-dev 2022-03-09 01:23:38 +00:00
Bryce Lee
459d5bd503 Make OnBackInvoked callback a WeakReference.
OnBackInvokedCallbackWrapper instances are sent to the WindowState over
AIDL. This leads to Activity leak issues even if the reference is
cleared in the remote side. This change makes the held reference weak
So it is not retained.

Test: verified leak no longer present through hprof
Bug: 221285764
Change-Id: I1c529d27769e2426898776e47f37bdb7abe1f681
2022-03-08 09:35:12 -08:00
Chavi Weingarten
53f62e57cf Merge "Changed setSyncTransaction to syncNextTransaction with callback logic." into tm-dev 2022-03-03 22:14:41 +00:00
Vadim Caen
8fa5667732 Merge "Move OnBackInvokedCallback to window package." into tm-dev 2022-03-03 10:03:41 +00:00
Tianhao Yao
5ecd6d37de Changed setSyncTransaction to syncNextTransaction with callback logic.
Modified SurfaceView and ViewRootImpl to provide callbacks when syncing
a transaction instead of sending transactions. This will ensure a clear
ownership of the transaction object since it will be provided in the
callback when BBQ adds a buffer into the transaction. Modified JNI to
add compatibility for native functions.

Test: Manual testing from go/wm-smoke.
Test: BLASTBufferQueueTest
Bug: 210714235.
Change-Id: I1f872d6b2846b0d64d5b33b8866d0b2ec7126c8c
2022-03-02 09:55:46 -06:00
Vadim Caen
72077726f5 Move OnBackInvokedCallback to window package.
Originally, View was implementing onBackInvokedDisptacherOwner, but now
only Activity and Dialog and since back event are related to the
window, it makes sense to move them into the android.window package

This follow up comment at:
ag/c/platform/frameworks/base/+/16764116/comments/e131f3ef_e3e1d2e0

Test: atest BackNavigationTests
Bug: 221401221
Change-Id: Ia2f26162beb6a41b6e162b31e599e882f8bf7320
2022-03-02 16:28:57 +01:00
wilsonshih
db6ba3ba58 Rename 'EMPTY' to 'SOLID_COLOR' for splash screen style.
Preventing from misleading developers.

Bug: 217953215
Test: atest SplashscreenTests StartingSurfaceDrawerTests
ActivityRecordTests

Change-Id: I8669effb2e843ebe61e807850359b07b36b39fb3
2022-03-02 20:30:31 +08:00
Wei Sheng Shih
172ea326de Merge "Estimate animation duration for AVD and AnimationDrawable" into tm-dev 2022-03-02 06:24:50 +00:00
Jerry Chang
f23631e4db Support to get the exact task which IME is attached to
To distinguish which side of the split that IME panel is attached to
after having a single-top root task for split screen, update
getImeTarget API to return the exact task that IME panel is attached to.

Bug: 207185041
Test: WMShellUnitTests
Test: enter split in portrait, toggle IME panel on the bottom split and
      verified split layout will be push up as expectedly.
Change-Id: Ib6ba74ecb1b844bb408475d5b6c28dd5816a8e29
2022-03-02 04:15:11 +00:00
Shan Huang
ad89a82145 Turn off predictive back
Test: m -j. Test back in apps that opt-in, opt-out & sysUI
Bug: 222170518

Change-Id: I97ae7769ff2e04eb7fb39c49e025b255cdba057f
2022-03-02 01:42:11 +00:00
Gaurav Bhola
4b9e5c8811 Merge "Add client API to add/remove insets-provider." into tm-dev 2022-03-01 17:32:52 +00:00