Commit Graph

15134 Commits

Author SHA1 Message Date
Chavi Weingarten
57ad5d9e40 Merge "Reparent bounds layer if surface was replaced." into rvc-dev am: ab3d80c98d am: fa48a156c7 am: 75a12e747c am: 04002dfdc4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12123266

Change-Id: Ic583c118d6b9e7b8aa8498482b39f3f2d3dfbb61
2020-07-10 17:39:29 +00:00
Chavi Weingarten
04002dfdc4 Merge "Reparent bounds layer if surface was replaced." into rvc-dev am: ab3d80c98d am: fa48a156c7 am: 75a12e747c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12123266

Change-Id: Id7a415d1cc24dc9f114402d25a0de2e7dfcdc77e
2020-07-10 17:18:37 +00:00
Chavi Weingarten
75a12e747c Merge "Reparent bounds layer if surface was replaced." into rvc-dev am: ab3d80c98d am: fa48a156c7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12123266

Change-Id: Id12f0265c89d98977fd7720c09c9acae129ba7e2
2020-07-10 17:09:06 +00:00
Chavi Weingarten
ab3d80c98d Merge "Reparent bounds layer if surface was replaced." into rvc-dev 2020-07-10 16:49:33 +00:00
Tiger Huang
2abef46ec0 Merge "Update requested state by comparing with source consumer" into rvc-dev am: 894a797421 am: 8e4707ae80 am: 3516329349 am: 792320dbbd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108428

Change-Id: I97634d083f0faaa3ac507edd0080fddf5287638d
2020-07-10 14:44:01 +00:00
Tiger Huang
792320dbbd Merge "Update requested state by comparing with source consumer" into rvc-dev am: 894a797421 am: 8e4707ae80 am: 3516329349
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108428

Change-Id: Ie9202eef0abe923d3046482a909c31dd51e5de0f
2020-07-10 14:31:25 +00:00
Tiger Huang
3516329349 Merge "Update requested state by comparing with source consumer" into rvc-dev am: 894a797421 am: 8e4707ae80
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108428

Change-Id: I54ea63439c9ccab8e5872243fa6fad8970ea2ef4
2020-07-10 14:19:41 +00:00
Tiger Huang
894a797421 Merge "Update requested state by comparing with source consumer" into rvc-dev 2020-07-10 13:51:37 +00:00
Tiger Huang
ff06666dba Update requested state by comparing with source consumer
If the local state and mLastDispatchedState are the same, the logic in
onStateChanged will skip updating the requested state. This could be an
issue, for example, a new focused window requested to hide status bar,
but status bar has already been hidden by the previous focused window,
so the new focused window will never send the requested state to server.
This can easily happen when an immersive activity is re-created due to
the configuration change.

This CL updates the requested state if any visibility within it is not
the same as the requested visibility of the source consumer, while
receiving controls.

Fix: 160854328
Test: atest InsetsControllerTest
Test: Swipe to show transient bars after rotating an immersive activity
Change-Id: I5d9acb1b59252fa80e66070db86b2555764588da
2020-07-10 18:04:57 +08:00
chaviw
c1dcac9568 Reparent bounds layer if surface was replaced.
In a normal case, the app will get either a visibility changed to
false or stopped from system server to indicate that the content
should be cleaned up. In those cases, it will request a relayout
to WM, which will notify VRI that the surface is gone. Since the
VRI surface is removed, the SV and bounds layer will get notified
that they should be destroyed. On the next relayout, the VRI will
get a new surface and notify SV and the bounds layer to create
new surfaces.

The scenario in the bug happens when VRI receives a visibility change to
false, but doesn't process the information fast enough. By the time it
calls relayout, WMS is in the state where the client is visible again. This
time the relayout will return a valid surface so the SV and bounds layer
will not get cleaned up. The reason this causes issues is VRI now has a
new main surface. The bounds layer is parented to the old layer that's been
deleted so it's not parented to anything. The SurfaceView is a child of
the bounds layer so it also renders offscreen.

The reparent needs to be done on the client side since WMS won't
reparent the children to the new surface if it thinks the app is
closing. WMS gets the signal that the app is stopping, but on the client
side, it doesn't get stopped since it's restarted quick enough. WMS
doesn't want to keep around old children since they will leak when the
client creates new children.

This change will reparent the bounds layer to the new VRI surface. It's
possible WMS will take care of this in certain cases where the app
isn't stopped. But for those cases, the reparent will not have
any effect since the bounds layer will be correctly parented.

Fixes: 159545768
Test: Can no longer repro black SV in maps
Test: Test app with SV and delay in onPause no longer has the same issue
Change-Id: I616652e1cc4380ebbcb386586d8d5889fcc19497
2020-07-10 00:32:46 +00:00
Adrian Roos
c9f51fe239 Merge "Fix IME flicker: move hiding the surface into the control target" into rvc-dev am: 895a2e626a am: 2f07569650 am: 2b8b39ec24 am: 679ed2e0cc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12070682

Change-Id: Idfed2355c5072990709623fcacd96e5a2d56c001
2020-07-09 17:54:27 +00:00
Adrian Roos
679ed2e0cc Merge "Fix IME flicker: move hiding the surface into the control target" into rvc-dev am: 895a2e626a am: 2f07569650 am: 2b8b39ec24
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12070682

Change-Id: Ia20c30a8b9b0f7e61488c56d9e5fffeb53bc73e9
2020-07-09 17:33:44 +00:00
Adrian Roos
2b8b39ec24 Merge "Fix IME flicker: move hiding the surface into the control target" into rvc-dev am: 895a2e626a am: 2f07569650
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12070682

Change-Id: Id91802e75d496b824c22d53bb2ee86868cb80d79
2020-07-09 17:24:23 +00:00
TreeHugger Robot
2626853ac2 Merge "ViewRootImpl: Call surface destroy callback after layout pass" into rvc-dev am: 276abcb6b3 am: 15f0a2590a am: 5a08944e47 am: 88dd62af5a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108557

Change-Id: I53da1cca48329a17ea58df318ec407f2899449bf
2020-07-09 17:19:15 +00:00
TreeHugger Robot
88dd62af5a Merge "ViewRootImpl: Call surface destroy callback after layout pass" into rvc-dev am: 276abcb6b3 am: 15f0a2590a am: 5a08944e47
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108557

Change-Id: I746fd9dafd07400c149b8a15016f9770596f44b6
2020-07-09 17:06:58 +00:00
Adrian Roos
895a2e626a Merge "Fix IME flicker: move hiding the surface into the control target" into rvc-dev 2020-07-09 17:02:15 +00:00
TreeHugger Robot
5a08944e47 Merge "ViewRootImpl: Call surface destroy callback after layout pass" into rvc-dev am: 276abcb6b3 am: 15f0a2590a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108557

Change-Id: Ic265cb06ed44886d0e00053418fa38723779ecf3
2020-07-09 16:55:01 +00:00
TreeHugger Robot
276abcb6b3 Merge "ViewRootImpl: Call surface destroy callback after layout pass" into rvc-dev 2020-07-09 16:32:33 +00:00
Adrian Roos
2260ce4daf Fix IME flicker: move hiding the surface into the control target
Fixes a flicker that occurs during transitions between windows.

This happens for two reasons:

1.) Control is immediately transferred to the new window, and the
    previous window didn't get a chance to play the animation.

    This is addressed by adding logic to keep control on the
    exiting window for the duration of the transition - similar to
    what we do with the target for z-ordering purposes.

2.) Upon the input connection being severed, the InputMethodService
    immediately hides its window, preventing any animations whenever
    the input connection changes

    This is addressed by moving hiding of the surface into the
    controlling windows - where upon receiving control, we now
    trigger removal of the IME surface if we don't show it.

Additionally:

- Now ensures that any requests from the ImeInsetsSourceConsumer
  ensure that they come from the window that is currently served
  by IMM.

- Removes the transparancy clause from isImeTargetFromDisplayContentAndImeSame
  to match the updated IME target computation in DisplayContent in [1].

[1]: Iedd5f7407926167f4891ce9b7e9a79e22751e668

Fixes: 153145997
Fixes: 150902448
Test: atest WindowInsetsAnimationControllerTests
Test: atest DisplayContentTests InsetsSourceConsumerTest
Test: Open app with IME, press HOME button, verify IME smoothly animates away
Test: Open Messages, open a thread, open IME. Click search icon, verify IME opens in the search activity
Change-Id: I4910c2a06cc67b0470477b245fc1de54b75f10f9
2020-07-09 14:46:55 +02:00
Jian-Yang Liu
042623ba3b Merge "Added systemui controller to control system bars." into rvc-qpr-dev am: 32fe6cf1d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12013479

Change-Id: I48e0177ec6f428dcf5a57006d2411437cc720912
2020-07-09 01:45:49 +00:00
Jian-Yang Liu
32fe6cf1d6 Merge "Added systemui controller to control system bars." into rvc-qpr-dev 2020-07-09 01:37:33 +00:00
Jacky Kao
ecdcd93c2f Merge "Sending A11y events when a view becomes invisible." 2020-07-08 23:42:10 +00:00
JianYang Liu
2c403a6526 Added systemui controller to control system bars.
When config_remoteInsetsControllerControlsSystemBars is true,
DisplaySystemBarsController provides its own policy of how system
bars are displayed for specific packages. Currently limited to
only auto versions of Android.

Bug: 149585273
Test: Manual, atest BarControlPolicyTest, atest InsetsPolicyTest,
      atest DisplaySystemBarsControllerTest
Change-Id: Ie6b1cc3e2760cbc9e48d62dfbd8bc3e23ffca20c
Merged-In: Ie6b1cc3e2760cbc9e48d62dfbd8bc3e23ffca20c
2020-07-08 23:06:14 +00:00
JianYang Liu
6d7745e1bc Added systemui controller to control system bars.
When config_remoteInsetsControllerControlsSystemBars is true,
DisplaySystemBarsController provides its own policy of how system
bars are displayed for specific packages. Currently limited to
only auto versions of Android.

Bug: 149585273
Test: Manual, atest BarControlPolicyTest, atest InsetsPolicyTest,
      atest DisplaySystemBarsControllerTest
Change-Id: Ie6b1cc3e2760cbc9e48d62dfbd8bc3e23ffca20c
2020-07-08 20:10:42 +00:00
Vishnu Nair
019e08fdbb ViewRootImpl: Call surface destroy callback after layout pass
If a requestLayout happens on a child view after the measure
pass, before the layout pass then the child view will not layout.
This can happen if a view calls requestLayout during measure
or during SurfaceView surface destroyed callback.

This fix addresses the second scenario by moving the callback
to after the layout pass.

Bug: 159183008
Test: Repro steps in bug
Test: go/wm-smoke
Change-Id: Ie2794a3751c99cabf6e07445c91159e35eeb1729
2020-07-08 12:44:47 -07:00
Jacky Kao
19d214bd75 Sending A11y events when a view becomes invisible.
Making the A11y event sending to A11y services when a view becomes
invisible if the ancestors of this view are all visible, and this view
becomes invisible from visible.

Bug: 130273130
Test: a11y CTS & unit tests
Change-Id: I836d3e34c7a9cba31843d34922b7ba02a8a062f0
2020-07-07 16:14:32 +08:00
TreeHugger Robot
8aab9f7506 Merge "Revert new logic around FLAG_ALT_FOCUSABLE_IM" into rvc-dev am: 0ef33bcb35 am: 6b2c843091 am: 3c23d4a4ed am: 835fdefa81
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12059199

Change-Id: I518ad851bac8cf5290692e6387341ef0e5dd013e
2020-07-02 14:19:23 +00:00
TreeHugger Robot
3c23d4a4ed Merge "Revert new logic around FLAG_ALT_FOCUSABLE_IM" into rvc-dev am: 0ef33bcb35 am: 6b2c843091
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12059199

Change-Id: I2d1f32af00c1238690a2928eef1867bb6c6de2e6
2020-07-02 13:52:24 +00:00
TreeHugger Robot
0ef33bcb35 Merge "Revert new logic around FLAG_ALT_FOCUSABLE_IM" into rvc-dev 2020-07-02 13:28:33 +00:00
Adrian Roos
69947c0671 Revert new logic around FLAG_ALT_FOCUSABLE_IM
This broke several apps because it means certain NON_FOCUSABLE windows
are now layered wrong w.r.t the IME, and also no longer get IME insets.

Originally, this was introduced because the IME target was used to
compute which window gets control, but this is now computed based on
the window actually connecting to the IME as reported per IMMS.

Reverts I941571c97145d77b0a59d030cf2a8c8318f3b59f.

Bug: 143898978
Bug: 140641950
Bug: 145812508
Bug: 141738570
Bug: 144619551
Fixes: 159438771
Test: atest WindowStateTests
      atest FocusHandlingTest
      atest WindowManager_LayoutParamsTest
      Also manually using steps:
      1. Launch gmail compose activity
      2. start typing in receipient field
      3. verify that even thoug the suggestions popup
         window w/ FLAG_NOT_FOCUSABLE becomes the
         IME target, control and insets still work.
Change-Id: If451276b1a8c485ec88965d8d30ec8fd3836620f
2020-07-02 11:14:10 +02:00
Charles Chen
82a951abc3 Merge "Revert "Revert "Enable IMS and its config context to obtain UI component""" into rvc-dev am: 8deb612a14 am: f9ccadb06d am: 2712b5e401 am: 718528f4bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12004931

Change-Id: I669e79f51cd8a2390c53308b30cbe1d94a3b39c5
2020-07-02 00:28:39 +00:00
Charles Chen
2712b5e401 Merge "Revert "Revert "Enable IMS and its config context to obtain UI component""" into rvc-dev am: 8deb612a14 am: f9ccadb06d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12004931

Change-Id: I1d815ad1451ff3de66fd7d1fe7d4c1027f73b0d6
2020-07-02 00:00:48 +00:00
Charles Chen
f9ccadb06d Merge "Revert "Revert "Enable IMS and its config context to obtain UI component""" into rvc-dev am: 8deb612a14
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12004931

Change-Id: Ied208126c1c21f736f07d4d7f24cb14c3a83c280
2020-07-01 23:42:26 +00:00
Charles Chen
8deb612a14 Merge "Revert "Revert "Enable IMS and its config context to obtain UI component""" into rvc-dev 2020-07-01 23:21:51 +00:00
John Reck
ee26d1ef65 Merge "Remove legacy callDrawGlFunction2 from HWUI" 2020-06-30 19:09:37 +00:00
Nikolas Havrikov
7189e147e5 Merge "Use ParceledListSlice in a generic manner" 2020-06-30 17:22:03 +00:00
Nikolas Havrikov
24b3591d95 Use ParceledListSlice in a generic manner
Test: built locally

Change-Id: Ib5bc0227f198e7b3c416e8beb423e3541e37f358
2020-06-30 13:36:04 +02:00
Rob Carr
1873699f32 Merge "SurfaceView: Clean up deferred-destroy-surface from UI thread" into rvc-dev am: 9464091e72 am: 7f46d57c67 am: 3da075357f am: 6a6439738a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12010092

Change-Id: Ic25f326eed84a153a02f27f4e9e88b640bf581cf
2020-06-29 22:37:16 +00:00
Rob Carr
6a6439738a Merge "SurfaceView: Clean up deferred-destroy-surface from UI thread" into rvc-dev am: 9464091e72 am: 7f46d57c67 am: 3da075357f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12010092

Change-Id: I47c5a466c839630b7666ac4ddc4bebae6d561dfd
2020-06-29 22:22:55 +00:00
Rob Carr
91ecb004c3 Merge "SurfaceView: Clean up deferred-destroy-surface from UI thread" into rvc-dev am: 9464091e72 am: 7f46d57c67
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12010092

Change-Id: I43f2bd15f8c215dcd6f21541179d3c85140fe3ed
2020-06-29 21:56:16 +00:00
Rob Carr
f1102c8c5d Merge "SurfaceView: Clean up deferred-destroy-surface from UI thread" into rvc-dev am: 9464091e72
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12010092

Change-Id: Icee6625c7731850fce224e6d693d43244968ca98
2020-06-29 21:48:26 +00:00
Rob Carr
9464091e72 Merge "SurfaceView: Clean up deferred-destroy-surface from UI thread" into rvc-dev 2020-06-29 21:42:03 +00:00
Charles Chen
ba4ffa4a6d Revert "Revert "Enable IMS and its config context to obtain UI component""
Test: atest StrictModeTest
Bug: 157027563
Bug: 159795597
Change-Id: I2a1b3fefa0bd82eeaa507c08fc4a79fc9f4391c5
2020-06-29 14:27:08 +00:00
TreeHugger Robot
f4db5aa9bd Merge changes I74d8f555,I7521a5a1 into rvc-dev am: b5d9c88ddd am: 0cfb45900e am: 751c2fe827 am: c7d4699c50
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11959351

Change-Id: I44487d4d0e911c5ad882952002ce669dc4eca2ed
2020-06-27 02:38:36 +00:00
Jorim Jaggi
7a9fa4689a Merge "Pass in callsite of SurfaceControl constructor explicitly (1/3)" into rvc-dev am: 37cf2279c9 am: 3f8fc80e42
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11920862

Change-Id: I2f30c74dab0cf842a5e06257c357cdb23798397a
2020-06-27 00:28:22 +00:00
Jorim Jaggi
41bd44e606 Merge "Pass in callsite of SurfaceControl constructor explicitly (1/3)" into rvc-dev am: 37cf2279c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11920862

Change-Id: I19b6f83b3777bfeccbe90f1c531efcc59e41f54e
2020-06-27 00:14:24 +00:00
Jorim Jaggi
37cf2279c9 Merge "Pass in callsite of SurfaceControl constructor explicitly (1/3)" into rvc-dev 2020-06-26 23:58:17 +00:00
John Reck
aa4c982294 Remove legacy callDrawGlFunction2 from HWUI
Bug: 151439970
Test: CtsUiRenderingTestCases passes

Change-Id: I1c29df17bb6e8b078467edf73cb3547db6948cdd
2020-06-26 13:49:05 -07:00
Robert Carr
9a808a2ee2 SurfaceView: Clean up deferred-destroy-surface from UI thread
We utilize mTmpTransaction without locking from the main thread. The
callback info inside the transaction stores an sp to the SurfaceControl.
If we apply the Transaction from two threads independently we may
implicitly call reset() on the same sp instance twice in an overlapping
fashion. While the reference count is itself atomic, that wont stop us
from decrementing it twice here, when we only had one reference.
This leads to an early free and a crash later.

Bug: 159333209
Test: Existing tests pass
Change-Id: I898bef0b6b8c1cf34891410bbadf63fe2f840697
2020-06-26 18:47:28 +00:00
Jorim Jaggi
543db32125 Pass in callsite of SurfaceControl constructor explicitly (1/3)
Creating a new Throwable (and filling in the stack trace) can take
up to 150us. Since we do this on the critical path when sending
over SurfaceControl via binder multiple times, this is too much.
Instead, add an option to pass in callsite manually.

Bug: 159056748
Change-Id: I46c339c15a07192d61c4c546e46f260684a47120
Exempt-From-Owner-Approval: Large scale refactor
2020-06-26 13:40:07 +00:00