Commit Graph

17351 Commits

Author SHA1 Message Date
TreeHugger Robot
b14918c0f2 Merge "SurfaceView: Fix SurfaceControl synchronization issues" 2021-09-13 17:17:58 +00:00
Naomi Musgrave
0f7b150d6f Merge "[1/n] Introduce API for all available max WindowMetrics" into sc-v2-dev am: aca90d6d64 am: f8e8e36f93
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15557284

Change-Id: Ia04fdf1c680df6162c7768c98f66f9769ee7745d
2021-09-10 16:13:14 +00:00
Naomi Musgrave
aca90d6d64 Merge "[1/n] Introduce API for all available max WindowMetrics" into sc-v2-dev 2021-09-10 15:35:32 +00:00
Joanne Chung
06c8b28bff Merge "Allow translation should also work on non-resume state" into sc-v2-dev am: fb894242ba am: d9cc1370f2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15786469

Change-Id: I7dbebe2a073cc891d71d646de15fc1801828a807
2021-09-10 15:22:59 +00:00
Joanne Chung
fb894242ba Merge "Allow translation should also work on non-resume state" into sc-v2-dev 2021-09-10 14:51:45 +00:00
Naomi Musgrave
f70f8ecefc [1/n] Introduce API for all available max WindowMetrics
New API provides all maximum WindowMetrics, for all
possible rotations in each DeviceState. This information
allows launcher apps to determine different device
layouts ahead of time, without having to reload the
grid model on every device state change (fold/unfold).

Done:
* WindowManager calculates bounds for the given display, in
  possible rotations
* Defining API surface

Not started:
* WindowManager calculates insets for each rotation
* Display stack builds collection of DisplayInfo, for all
  possible display states (folded, unfolded)
* Display stack pushing set of DisplayInfos to WindowManager

Bug: 181127261
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest FrameworksCoreTests:WindowInsetsTest
Change-Id: Ic4580f9c1ee919e5e93cd96b8f11c743fa42f9f1
2021-09-10 09:53:49 +01:00
Naomi Musgrave
d3fc9072c6 Merge "[1/n] Introduce API for all available max WindowMetrics" 2021-09-10 08:38:01 +00:00
Kriti Dang
ca2b154112 Merge "Default resolution settings [Backend]" 2021-09-10 07:31:02 +00:00
Vishnu Nair
2cafd8b44d SurfaceView: Fix SurfaceControl synchronization issues
Hold the surface control lock in PositionUpdateListener
callbacks before checking if the SurfaceControl will
be null. UI tread might release it after the checks
causing crashes.

Also fix a case where the ViewRootImpl may be null
in the positionChanged callback.

Bug: 199261027
Test: run steps in bug
Test: go/wm-smoke
Change-Id: I5a4cac35fe14356389b29268fddf9703b25c03aa
2021-09-09 19:57:24 -07:00
Adam He
e6664abbc8 Merge "Fill in javadocs for translation feature." into sc-dev am: 1553fc7fad am: 4b02f45293
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15597859

Change-Id: I538dd665f0f322cfe01ce79d83f1fde064749329
2021-09-09 16:23:06 +00:00
Sally Yuen
2b00db99b0 Merge "Add API to inform the system a drag is initiated by an A11yAction#ACTION_DRAG_START." into sc-v2-dev am: cd9481d29a am: 19813a5ded
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15787312

Change-Id: If2949fc7d22534e0f0a600ee5c3ec3b4765d0b83
2021-09-09 16:18:43 +00:00
Adam He
4b02f45293 Merge "Fill in javadocs for translation feature." into sc-dev am: 1553fc7fad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15597859

Change-Id: I214790439c5b6520131cf8a9f03a255ebe16421f
2021-09-09 16:04:28 +00:00
Sally Yuen
19813a5ded Merge "Add API to inform the system a drag is initiated by an A11yAction#ACTION_DRAG_START." into sc-v2-dev am: cd9481d29a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15787312

Change-Id: I0ef3dc0af15c1ec3b266401c5246c2f2a92f7a5b
2021-09-09 15:58:05 +00:00
Sally Yuen
cd9481d29a Merge "Add API to inform the system a drag is initiated by an A11yAction#ACTION_DRAG_START." into sc-v2-dev 2021-09-09 15:57:38 +00:00
Kriti Dang
ccc7d4bd37 Default resolution settings [Backend]
Added new APIs to DisplayManager to:
1. set the user preferred display mode,
2. clear user preferred display mode and
3. wheteher user has chosen a display mode

These new settings are stored in Settings.Global.

Bug: 192332479
Test: atest DefaultDisplayModeTest
Test: atest LocalDisplayAdapterTest
Change-Id: I3a60e271c7ec23c84e74487e89b3e29ca91e8a40
2021-09-09 14:58:04 +02:00
Naomi Musgrave
65fe74c166 [1/n] Introduce API for all available max WindowMetrics
New API provides all maximum WindowMetrics, for all
possible rotations in each DeviceState. This information
allows launcher apps to determine different device
layouts ahead of time, without having to reload the
grid model on every device state change (fold/unfold).

Done:
* WindowManager calculates bounds for the given display, in
  possible rotations
* Defining API surface

Not started:
* WindowManager calculates insets for each rotation
* Display stack builds collection of DisplayInfo, for all
  possible display states (folded, unfolded)
* Display stack pushing set of DisplayInfos to WindowManager

Bug: 181127261
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest FrameworksCoreTests:WindowInsetsTest
Change-Id: Ic4580f9c1ee919e5e93cd96b8f11c743fa42f9f1
2021-09-09 12:36:25 +00:00
Adam He
4e3a00abbc Merge "Fill in javadocs for translation feature." into sc-dev am: 1553fc7fad am: 44ef83555f am: c6caf136f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15597859

Change-Id: If47d2f678466ccf67feed85d21f15090d5608d56
2021-09-08 20:36:55 +00:00
Adam He
c6caf136f5 Merge "Fill in javadocs for translation feature." into sc-dev am: 1553fc7fad am: 44ef83555f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15597859

Change-Id: Ie250391bba22fb83b0ca02ecc099f57c7a8fa7d7
2021-09-08 20:18:29 +00:00
Adam He
1ee68ced5b Merge "Fill in javadocs for translation feature." into sc-dev am: 1553fc7fad am: ed877ee1ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15597859

Change-Id: I9ab6500fa6c8c64ca1c14383dbf1bb7b2a64f909
2021-09-08 20:18:06 +00:00
sallyyuen
5d00ad6e13 Add API to inform the system a drag is initiated by an
A11yAction#ACTION_DRAG_START.

This allows the system to run a11y-specific code
and still accept drags via touch events when a11y is
enabled.

Test: builds
Bug: 26871588
Change-Id: I40e8f1adf5b773c8fa02173cbd96aa5e9ed54a4d
2021-09-08 12:19:36 -07:00
Chavi Weingarten
da143d4a41 Merge "Call applyPendingTransactions when frame didn't draw" 2021-09-08 15:50:25 +00:00
Chavi Weingarten
8bd6b0d178 Merge "Remove flushShadowQueue" 2021-09-08 14:50:17 +00:00
Joanne Chung
5f68630b15 Allow translation should also work on non-resume state
Currently, we only allow translation for the resumed Activity. It
works fine for full screen Activity. On foldable devices, we may
have two Activity in the same time. It is possible one Activity is
on the paused state but there is still new incoming message, we
should also allow the message can be translated.

Bug: 199264898
Test: atest CtsTranslationTestCases
Test: manual. Use one Activity targetsdk prior to Q then receiving
broadcast to start Ui translation on paused state in split mode.

Change-Id: I6720b41d9995c9ced2e3b2b87eb95540101d15a0
2021-09-08 14:15:41 +00:00
TreeHugger Robot
fe29c8481c Merge "Clean up some translation todos." 2021-09-08 01:21:10 +00:00
Adam He
47cb06a213 Fill in javadocs for translation feature.
Bug: 190236094
Test: atest CtsTranslationTestCases
Change-Id: I4d3e68cb4de4ca003f6f2cf1c0be626b91c0de97
2021-09-07 23:38:09 +00:00
chaviw
a9997a38fe Remove flushShadowQueue
flushShadowQueue no longer does anything in BBQ so remove from Java and
JNI code.

Test: Builds
Fixes: 199204968
Change-Id: I4df67a23732ba4ffaca42390b29d3f81cadd6457
2021-09-07 17:53:31 -05:00
chaviw
9f19b5d198 Call applyPendingTransactions when frame didn't draw
It's possible for a caller to requested mergeWithNextTransaction, but
the main frame had nothing new to draw. If that's the case, the
mergeWithNextTransactions will be stuck and never applied (or applied
much later). Since this could end up blocking Transactions, it's better
to force apply these when we know a frame wasn't going to draw this
vsync.

Test: Existing tests pass
Bug: 195262673
Change-Id: Ic0919ba6446d6a12d824185f6b3e540c2d5319d7
2021-09-07 17:31:28 -05:00
Chavi Weingarten
019b9be422 Merge "Rework blast sync callback model" 2021-09-07 14:49:14 +00:00
Pankaj Singh
399377c70a Fix typo by removing extra "the"
BUG: 198740909
Test: N/A
Change-Id: I160a435693d61dc18da10725bf416b9af6d291e7
2021-09-06 11:52:01 +00:00
Winson Chung
914b8f8bf1 Merge "Always inset the IME by the extra nav bar frame height" into sc-v2-dev am: 67b04aaef5 am: 94e46b52e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15697097

Change-Id: I3d1e2a91426ca335a4b63f7c80f19c796b624ce5
2021-09-04 00:16:11 +00:00
Winson Chung
67b04aaef5 Merge "Always inset the IME by the extra nav bar frame height" into sc-v2-dev 2021-09-03 23:46:16 +00:00
Winson Chung
5d5f0987b2 Always inset the IME by the extra nav bar frame height
- If the taskbar is collapsed and isn't providing full insets to the
  app, we still want the IME to be inset for the nav button that shows

Fixes: 197727397
Test: Collapse taskbar, open IME
Change-Id: I9f2367344385c9a23e2d6323637a0b2d1713b169
2021-09-03 23:46:00 +00:00
chaviw
9c13753526 Rework blast sync callback model
The previous code waited for a frame complete callback from hwui before
notifying WMS that a draw had occurred. However, frame complete callback
was not guaranteed to get called since it only invokes a callback if a
draw actually occured. VRI really needs a signal that RT has completed,
since it just needs to know that a draw was possible so it can notify
WMS that the RT completed its pass.

Instead, rename frameCompleteCallback to frameCommitCallback since that
API is exposed to a public API when a frame was actually drawn.
Create a new callback, frameCompleteCallback, that is invoked when the
draw has completed, regardless if a frame was actually drawn.

When the frameCompleteCallback is invoked, VRI can check to see if a new
frame actually drew. VRI can call into BBQ to see if the frame acquired
matches the frame that was attempted to draw. If so, VRI can wait on a
transaction callback. If not, it can allow VRI to continue. In either case,
it will notify WMS that the draw has finished.

Test: Split over and over
Bug: 195262673
Change-Id: I24dd19ab2746be3fc33e597761abf8c5249f8b5b
2021-09-03 14:50:37 -05:00
Vishnu Nair
aacc61be3d Surface: Release references to BlastBufferQueue and SurfaceControl on Surface#destroy
SurfaceView clients may hold on to surface references. In S this means
they would extend the lifetime of the SurfaceControl resulting in
"leaking" buffers until the references are cleared or the app is
terminated.

Fix this by calling a new destroy function on Surface which will
explicitly remove references to the SurfaceControl and BBQ it holds.
This is safe because SurfaceView controls the lifecycle of the Surface
and knows when the Surface will become invalid. Once invalid, the Surface
cannot become valid again.

Test: repro steps in bug
Bug: 198133921
Change-Id: I5c7e43736f025fc0965eae2f19719ba40df3cb70
Merged-In: I5c7e43736f025fc0965eae2f19719ba40df3cb70
2021-09-03 17:03:23 +00:00
Tiger Huang
5fa0422c54 Merge "Prevent adding methods in WindowInsetsAnimationController" into sc-v2-dev am: 4fba1c4453 am: a1c5970293
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15746916

Change-Id: I5224d890d1632148fd2a89a39d8b68c0d7386311
2021-09-03 10:49:39 +00:00
Tiger Huang
4fba1c4453 Merge "Prevent adding methods in WindowInsetsAnimationController" into sc-v2-dev 2021-09-03 10:40:38 +00:00
Shawn Lin
8ddf5486f4 Merge "Support rounded corner for multi-display devices" 2021-09-03 03:57:37 +00:00
Shawn Lin
97b0de7326 Merge "[DO NOT MERGE]Support rounded corner for multi-display devices" into sc-v2-dev 2021-09-03 03:57:09 +00:00
Vishnu Nair
f0be204420 Merge "Surface: Release references to BlastBufferQueue and SurfaceControl on Surface#destroy" into sc-v2-dev am: 8047839069 am: 28bcedef70
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15720362

Change-Id: Ic9d63f73755f79e96c13c8983920b8184f77a29f
2021-09-03 02:37:42 +00:00
Vishnu Nair
8047839069 Merge "Surface: Release references to BlastBufferQueue and SurfaceControl on Surface#destroy" into sc-v2-dev 2021-09-03 02:01:53 +00:00
Evan Rosky
a164ab030d Merge "Fix some NPEs in shell transitions" into sc-v2-dev am: 2dd3adff43 am: 83135ec426
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15718081

Change-Id: I6b4ad7d4e25f3f491055bdf553814afe38d44ea9
2021-09-02 21:10:51 +00:00
Evan Rosky
2dd3adff43 Merge "Fix some NPEs in shell transitions" into sc-v2-dev 2021-09-02 20:43:51 +00:00
Tiger Huang
4ba9fc6168 Prevent adding methods in WindowInsetsAnimationController
It is a public interface which should not have different versions
sharing the same API level. This CL moves the methods to an
@hide interface.

Fix: 198614722
Test: atest android.signature.cts.api.current.SignatureTest
Change-Id: Ib02708aeb1ec960bda20b6b60d4df6f0c9b4d9d6
2021-09-03 04:24:34 +08:00
TreeHugger Robot
7f930ba489 Merge changes from topic "layerid-in-wm-trace"
* changes:
  Dump WindowContainer SurfaceControls to proto
  Dump SurfaceControl's layerId to proto
  Expose SurfaceControl's native mLayerId property to Java
2021-09-02 15:14:37 +00:00
Tiger Huang
637cc7dcea Merge "Invoke insets animation callbacks when resizing system bars" into sc-v2-dev am: a42a8d6bf3 am: c5c07300ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15327977

Change-Id: I855558a2b85c58d7e2cd31bc5a429083d4de6d0f
2021-09-02 11:40:10 +00:00
Tiger Huang
a42a8d6bf3 Merge "Invoke insets animation callbacks when resizing system bars" into sc-v2-dev 2021-09-02 11:12:17 +00:00
Winson Chung
38d931cc4a Merge "Return the existing display ids when registering a display window listener" into sc-v2-dev am: 31fd5176c2 am: 064391c966
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15730867

Change-Id: Ia596afdad7a9cf169bce3a07361cda62f6dc1a4f
2021-09-02 00:58:36 +00:00
Pablo Gamito
120ee45bd0 Dump SurfaceControl's layerId to proto
Test: Data appears in Winscope
Bug: 197712697
Change-Id: Ida47f5506a56b19902fcaafc644d1df34ce6c4a3
2021-09-01 22:52:54 +00:00
Winson Chung
851f1df2f1 Return the existing display ids when registering a display window listener
- This ensures that the caller can synchronously initialize the existing
  displays without waiting for the onDisplayAdded() callback, which can
  happen asynchronously (since the callback is oneway).

Bug: 196186963
Test: atest WMShellUnitTests
Test: atest ActivityTaskManagerServiceTests
Change-Id: I0a8d5f9b4ede7b487a8de14bdb6eaacae7d03d9f
2021-09-01 13:37:31 -07:00
Bryce Lee
8379b15dc5 Always reparent SurfacePackage in setChildSurfacePackage.
Currently, SurfaceView#setChildSurfacePackage only reparents a
provided SurfacePackage when there is no SurfaceControl already
present. This can lead to the SurfacePackage potentially never
being reparented.

This changelist addresses the issue by always reparenting the
SurfacePackage, following cleanup of the existing
SurfaceControl.

Bug: 197568243
Test: atest SurfaceControlViewHostTests#testCanReplaceSurfacePackage
Change-Id: Ib0bcfee5cb9801e1b1c4f1f300af9862141b12f3
2021-09-01 12:28:28 -07:00