Commit Graph

15412 Commits

Author SHA1 Message Date
Nikita Dubrovsky
210c931b21 Merge "Update RichContentReceiver API (now OnReceiveContentCallback)" 2020-09-28 14:48:42 +00:00
Tiger Huang
b7d379147e Merge "Remove redundant logic about System UI visibility" 2020-09-28 13:30:22 +00:00
Tiger Huang
a9b8fa272c Remove redundant logic about System UI visibility
This CL removes
- mSeq
- System UI flags used to communicate between WMS and System UI
- redundant AIDL methods
- redundant fields and methods
- redundant tests
- PolicyControl

This CL also
- refines the format in DisplayPolicy#dump
- sends a boolean to InputManager to indicate if System UI is in a low
  profile mode instead of sending the legacy system UI visibility

Bug: 149813814
Fix: 169105126
Test: presubmit
Test: dumpsys window displays
Test: See if the layout of ImmersiveModeConfirmation is as expected
Change-Id: I8c8df509355bebc9b560af57d5458614557bcd2f
2020-09-28 02:04:21 +08:00
Nikita Dubrovsky
dd9869aa4c Update RichContentReceiver API (now OnReceiveContentCallback)
Bug: 163718378
Bug: 165632620
Bug: 152068298
Test: Unit tests
  atest CtsWidgetTestCases:TextViewOnReceiveContentCallbackTest
  atest CtsViewTestCases:ViewTest
  atest FrameworksCoreTests:TextViewProcessTextTest
Change-Id: I3fa65b47c920a9d1ddad88a79e60864dc8109753
2020-09-25 13:46:33 -07:00
TreeHugger Robot
343552e1fc Merge "Fix showing keyboard without editor focused in some cases (1-2/2)" 2020-09-25 13:31:09 +00:00
Heemin Seog
5955a19009 Merge "Ensure mapping between internal and public insets" 2020-09-25 02:44:36 +00:00
Vishnu Nair
cf143d4408 Add BlastBufferQueue adapter in SurfaceView
Add support for submitting buffers in SurfaceView via BLAST using
BlastBufferQueue adapter.

Introduce a new config wm_use_blast_adapter_sv, that is disabled by
default to enable the adapter.

When enabled, the blast SC is created as a child of the main
SurfaceView SC and the main SC is set as a container layer. This layer
will continue to handle position, visibility and transforms while the
blast SC will handle buffer updates via the adapter.

Test: atest SurfaceViewBufferTests
Test: go/wm-smoke w/ & w/o adb shell adb shell settings set global use_blast_adapter_sv 1
Bug: b/168504870, b/168917217

Change-Id: I826eef39e03ea339df54400be0709eaba6c88797
2020-09-24 21:45:18 +00:00
Youngjun Kwak
4294ebdbc8 Merge "Map bar type to new ITYPE_{SIDE}_MANDATORY_GESTURES_INSETs" into rvc-qpr-dev am: 4d714cb8e9 am: dcfa722f4c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12641033

Change-Id: I23a25bddc218d0ceff66cb891d61de68abc289fc
2020-09-24 16:13:05 +00:00
Youngjun Kwak
dcfa722f4c Merge "Map bar type to new ITYPE_{SIDE}_MANDATORY_GESTURES_INSETs" into rvc-qpr-dev am: 4d714cb8e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12641033

Change-Id: Icdd22f81cc8d75e565073ee322b2bf3c6ec0064c
2020-09-24 15:53:19 +00:00
Riddle Hsu
340ce85572 Merge "Make process level rotated config and display metrics consistent" 2020-09-24 15:42:39 +00:00
Ming-Shin Lu
9d63d35578 Fix showing keyboard without editor focused in some cases (1-2/2)
As CL[1] mentioned window focus behavior changes from R,
ignoring STATE_VISIBLE or STATE_ALWAYS_VISIBLE request doesn't enough
to fix unexpected keyboard visible issue when same window focused with
the above softInput flag without editor focus, since there is no
additional unspecified window focus to hide the current soft-input
as prior to R's behavior.

To fix that, we introduced new SoftInputShowHideReason to hide
soft-input when the same window focused without valid editor focus
after screen unlock, in order to align with the behavior prior to R.

[1]: I37ae6e30d1de581ba15131c2a90396b3a522a4d6

Bug: 161506356
Test: atest CtsInputMethodTestCases
Change-Id: I20e8076acc5fec3c055af0740e2e2a64b1fb6f0d
2020-09-24 23:23:47 +08:00
Youngjun Kwak
4d714cb8e9 Merge "Map bar type to new ITYPE_{SIDE}_MANDATORY_GESTURES_INSETs" into rvc-qpr-dev 2020-09-24 15:19:11 +00:00
Tiger Huang
1dae14ec14 Clear low profile mode while forcing client to show system bars am: 3b6bdffa44 am: 2920a61a6b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12683363

Change-Id: I98a48d3c033d3c9336c9443ef869ea5a11f13d81
2020-09-24 14:05:28 +00:00
Tiger Huang
2920a61a6b Clear low profile mode while forcing client to show system bars am: 3b6bdffa44
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12683363

Change-Id: Iefd90b4aebc1c683fb99a482f5c897d7ea6b7ac4
2020-09-24 13:31:42 +00:00
Tiger Huang
3b6bdffa44 Clear low profile mode while forcing client to show system bars
Forcing client to show system bars would clear system UI flags at the
client side. SYSTEM_UI_FLAG_LOW_PROFILE would be cleared as well in
previous Android versions. This CL makes the behavior compatible.

Fix: 167892531
Test: Steps in the bug
Change-Id: I466a05120a08ac95b619eadd8291fc546d3bb450
2020-09-24 17:35:48 +08:00
TreeHugger Robot
a5a220e8ca Merge "Second reland "Use new create/removeInputChannel()."" 2020-09-23 23:03:42 +00:00
Heemin Seog
4d29498a65 Ensure mapping between internal and public insets
Bug: 166149440
Test: manual (flash automotive device with all system bars and show/hide
insets using WindowInsetsController), atest InsetsStateTest
InsetsStateControllerTest

Change-Id: I500b2fb0129739c6fc609561377d90cca6e45f7e
2020-09-23 11:12:54 -07:00
Chavi Weingarten
3c99024fdb Merge "Ensure overlapping draws won't break BLAST sync" 2020-09-23 17:01:28 +00:00
Alison Cichowlas
13edc9d085 Merge "Set the default screenshot delay to 0ms" into rvc-qpr-dev am: 96c7d2368f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12557348

Change-Id: I2540d2e1cfa574ee71f6beac4549942a16aa10d5
2020-09-23 15:48:00 +00:00
Alison Cichowlas
96c7d2368f Merge "Set the default screenshot delay to 0ms" into rvc-qpr-dev 2020-09-23 15:39:42 +00:00
Miranda Kephart
c632e0f8df Set the default screenshot delay to 0ms
Bug: 165267251
Test: manual -- ensured that the time needed to hold is 0ms if the
screenshot_keychord_delay debug value is not set, and that the
delay can still be changed using

adb shell device_config put systemui screenshot_keychord_delay <ms>

Change-Id: Iab989ecf14ef379658130adbced241e084554e63
Merged-In: Iab989ecf14ef379658130adbced241e084554e63
(cherry picked from commit bf82822698)
2020-09-23 13:58:41 +00:00
Garfield Tan
0023f7d8c4 Second reland "Use new create/removeInputChannel()."
Make sure the token in InputMonitorHost remains valid.

Bug: 167947395
Bug: 169173706
Test: atest NexusLauncherTests:com.android.launcher3.ui.TaplTestsLauncher3
Change-Id: I05ebf15588bea8f0f321b61e82417f1594843554
2020-09-22 21:05:19 -07:00
Chavi Weingarten
5b730482e8 Merge "Add SKIP_SCREENSHOT flag instead of using the window type." 2020-09-22 22:49:20 +00:00
Garfield Tan
e97ad446cb Revert "Reland "Use new create/removeInputChannel().""
Revert "Reland "Let InputFlinger create the server InputChannel""

Revert submission 12655292-hide-server-input-channel

Reason for revert: b/169173706
Reverted Changes:
Iefbfd9313:Reland "Let InputFlinger create the server InputCh...
I14837d545:Reland "Use new create/removeInputChannel()."

Change-Id: I2e002829ad2f077e1f118d0b09d274002b71afa9
2020-09-22 21:53:55 +00:00
chaviw
422dd22c3d Ensure overlapping draws won't break BLAST sync
Previously, the code would pause the renderer and then call
setNextTransaction. This was to ensure the transaction would
wait for the upcoming frame, not the previous one that may about
to get processed. This was bad becuase it slows down the renderer.

Instead, add a frameCallback listener to the renderer and call
setNextTransaction when the frame callback is invoked. This will
ensure that we only call setNextTransaction when the renderer is
ready to draw, ensuring the next frame in BLASTBufferQueue is the
correct frame to sync with the transaction.

SurfaceView doesn't need to check if VRI is in a blast sync transaction
since any call to PositionListener can be assumed to be a in a blast
sync. This is because SV requests to use blast sync when position, size,
or visibility changes.

Test: Youtube with BLAST enabled
      Contains a SurfaceView that will force blast sync transaction
Test: SurfaceViewSyncTest
Fixes: 149747443
Change-Id: I3e42f87aa8473ee0ee65f23cc00db95f112b4f63
2020-09-22 13:39:03 -07:00
chaviw
b222d48559 Add SKIP_SCREENSHOT flag instead of using the window type.
The way WM tell SurfaceFlinger not to screenshot certain layers is by
setting the window type WINDOW_TYPE_DONT_SCREENSHOT. This is a bit
confusing since window type represents the type of window. Instead, use
a new flag called SKIP_SCREENSHOT that is explicitly used to tell SF not
to screenshot this layer.

Test: Rounded corners aren't in screenshot
Test: SurfaceViewSyncTest with blast enabled
Fixes: 168943350
Change-Id: Iaafad35e7ce3d15ade25be18dde4862e2d126703
2020-09-22 13:38:57 -07:00
kwaky
9b2063caaf Map bar type to new ITYPE_{SIDE}_MANDATORY_GESTURES_INSETs
Bug: 167565741
Bug: 167288724
Test: atest WindowInsetsPolicy and atest SystemBarConfigs all passing

Change-Id: I767a423bc2437021af02c01a84fa3e1834413c1e
2020-09-22 11:05:56 -07:00
Garfield Tan
c27066ac9f Reland "Use new create/removeInputChannel()."
Bug: 169083114
Bug: 169088136
Bug: 167947395
Test: Gesture navigation works.
Test: atest TaplTestsLauncher3
Change-Id: I14837d5458a98972b2f90e826aaed25eb1df47ec
2020-09-21 16:12:21 -07:00
Roshan Pius
97bd7a52f4 Merge "Revert "Use new create/removeInputChannel()."" 2020-09-21 22:48:19 +00:00
Roshan Pius
e61a71b9bd Revert "Use new create/removeInputChannel()."
Revert "Let InputFlinger create the server InputChannel"

Revert submission 12594832-hide_server_input_channel

Reason for revert: <INSERT REASONING HERE>
Reverted Changes:
I7033caf10:Use new create/removeInputChannel().
I35f768c8a:Let InputFlinger create the server InputChannel

Bug: 169083114
Bug: 169088136
Change-Id: I3aa320272d4092b17e76558ddc67222fbef3b2b8
2020-09-21 22:44:44 +00:00
Garfield Tan
ab0b3a5cf7 Merge "Use new create/removeInputChannel()." 2020-09-21 17:16:31 +00:00
Heemin Seog
9779c9e133 DO NOT MERGE Ensure mapping between internal and public insets am: ae42535e1a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12547244

Change-Id: I518091fb946ce0492acbb65396f743f8ca96ae10
2020-09-21 16:00:33 +00:00
Riddle Hsu
d5c5a1b421 Make process level rotated config and display metrics consistent
The application may get Resources instance from Resources.getSystem()
and context.getApplicationContext().getResources(). Since fixed
rotation is introduced that allows an activity to start in a different
rotation than the current display, when using getConfiguration() and
getDisplayMetrics() of these Resources instances, the orientation
and metrics need to be the same as current display is rotated.
Otherwise the app may show unexpected UI layout.

Although it is not recommended to use global resources/config for
activity. One of the goal of fixed rotation transform is to simulate
the app is started in a rotated environment, so this CL makes the
configuration and display metrics of system resources are consistent
with application and activity for compatibility.

About WindowProcessController and ActivityStackSupervisor:
 The process configuration passed to LaunchActivityItem may be
 associated from activity. if the sequence number of configuration
 is overridden by activity, the configuration may be ignored when
 launching the activity because the sequence number isn't larger
 than the previous process configuration. Although there will be a
 ConfigurationChangeItem later to update correct state, the app may
 get the intermediate state with old configuration and metrics.

About ResourcesManager and DisplayAdjustments:
 There are 2 new fields appWidth and appHeight added to
 DisplayAdjustments#FixedRotationAdjustments because the display
 metrics from Resources.getSystem() is independent from activity
 configuration. Only window manager knows the rotated size, so
 the values need to send to client and then ResourcesManager takes
 the adjustment to change the global display metrics.

About WindowToken:
 When fixed rotation is applied on the token, send the
 FixedRotationAdjustmentsItem first so the later configuration
 change can pick the adjustment at ActivityThread. And because the
 registration of activity configuration only occurs on add/remove
 activity, if it is only switching to another existing activity in
 different orientation, the process configuration still needs to
 be updated.

About ActivityThread:
 The code flow for a rotated activity (DA = display adjustments):
 - Launch new activity
    handleLaunchActivity: override app DA
     handleConfigurationChanged: adjust global display metrics by DA
     performLaunchActivity
      createBaseContextForActivity: override activity DA
 - Resume existing activity
    handleFixedRotationAdjustments: override app and activity DA
    handleConfigurationChanged: adjust global display metrics by DA
    handleResumeActivity

Also some minor corrections:
- Set missing rotated max bounds.
- Fix wrong display metrics adjustment that xdpi and ydpi should
  not be swapped because they are physical attributes.

Bug: 167564038
Test: atest DisplayAdjustmentsTests
      AppConfigurationTests#testRotatedInfoWithFixedRotationTransform
      WindowProcessControllerTests#testProcessLevelConfiguration
      DisplayContenTests#testApplyTopFixedRotationTransform

Change-Id: I60bedc7e09f54683d5e857ccc51402d5d144cd9e
2020-09-21 06:54:00 +00:00
Riddle Hsu
55109cc71e Merge "Make methods of IWindowSession oneway as possible" 2020-09-21 01:54:55 +00:00
Tiger Huang
a7c40017ff Merge "Remove the legacy insets mode" 2020-09-19 17:07:56 +00:00
Garfield Tan
722f9dea4a Use new create/removeInputChannel().
This way we can restrict server channel in InputFlinger.

Also always use std::move() to move ownership when creating Java object
for InputChannel.

Bug: 167947395
Test: Touch events are still dispatched.
Test: WmTests:DisplayPolicyTests#testUpdateHideNavInputEventReceiver
Change-Id: I7033caf1015ec4bae65beab2c65bdeb4070f4775
2020-09-18 15:16:56 -07:00
Heemin Seog
ae42535e1a DO NOT MERGE Ensure mapping between internal and public insets
Bug: 166149440
Test: manual (flash automotive device with all system bars and show/hide
insets using WindowInsetsController), atest InsetsStateTest
InsetsStateControllerTest

Change-Id: I500b2fb0129739c6fc609561377d90cca6e45f7e
2020-09-18 09:48:08 -07:00
Tiger Huang
6ef3b6e137 Remove the legacy insets mode
This CL also refines the color view logic which checks the system bar
appearance instead of system UI flags.

Bug: 149813814
Test: atest InsetsAnimationControlImplTest InsetsControllerTest
            InsetsStateTest InsetsPolicyTest InsetsStateControllerTest
Change-Id: I26d93b3508c84e436133085bd316ade54d00d76a
2020-09-18 15:13:12 +08:00
TreeHugger Robot
c5404b48e8 Merge "Refine the surrounding text copy logic" 2020-09-18 06:10:36 +00:00
Wilson Wu
93cdaafcb9 Refine the surrounding text copy logic
Our CL [1] used to copy the original surrounding text
in case the text is updated unexpectedly before the
surrounding text retrieval.

Refine the copy logic by:
-. Move copy action to the InitialSurroundingText constructor
-. Apply a deep copy with parcelable, it also avoid the text
   span is updated later

[1] I6082a4cae2fcdc4c529dc14e2e5e7a45ab1aae4d

Bug: 160390184
Fixes: 163176179
Test: atest FrameworksCoreTests:EditorInfoTest
Test: atest CtsInputMethodTestCases:EditorInfoTest
Change-Id: I75edcf6046467f2776d62bb38137f9d15dbfab52
2020-09-18 14:00:17 +08:00
Ady Abraham
41b5d5a764 Merge "Shared timeline plumbing" 2020-09-17 21:16:25 +00:00
Riddle Hsu
a09686317b Make methods of IWindowSession oneway as possible
The methods other than below are set to oneway.
 - with returned value or out argument.
 - holds wake lock.
 - paired with another sync method (e.g. addToDisplay and remove).
To reduce potential blocking calls.

Bug: 161781274
Test: CtsWindowManagerDeviceTestCases CtsInputMethodTestCases
Change-Id: Ifbf0e73316d4f2194928cdb8be973ec5ef3ec5c6
2020-09-17 23:36:48 +08:00
Steven Thomas
6fabb5aa17 Shared timeline plumbing
Add plumbing to get shared timeline data from Surface Flinger to HWUI
and back.

Bug: 162890382
Bug: 162888881
Bug: 162890407

Test: manual using ALOG messages in SF
Change-Id: I85c5eb56d2fa933889518854e7b79b1e65e29af3
2020-09-16 22:58:39 -07:00
Julia Reynolds
125d1725cd DO NOT MERGE Revert "Remove app ops indicators from notifications" am: 8ec5bcb3d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12615554

Change-Id: Ib5170725586b432972ab4b29129c1cadb53d50e1
2020-09-16 16:32:48 +00:00
Vishnu Nair
02a5b03909 Merge "Add focus support for SurfaceControlViewHost" 2020-09-16 15:26:26 +00:00
Julia Reynolds
71f51c54cd Merge "DO NOT MERGE Revert "Remove app ops indicators from notifications"" into rvc-qpr-dev 2020-09-16 15:09:31 +00:00
Julia Reynolds
8ec5bcb3d0 DO NOT MERGE Revert "Remove app ops indicators from notifications"
This reverts commit 2778b62f1d.

Reason for revert: these icons are still needed

Change-Id: I219af393f3d4cd08e431f38a3b66408e12f258bb
Bug: 163076432
2020-09-16 15:09:03 +00:00
TreeHugger Robot
29c1e03816 Merge "Remove unnecessary null checking on ViewRootImpl#mWindowAttribute" 2020-09-16 12:39:22 +00:00
Ryan Lin
28a10589ef Merge changes Ic12d6d90,Iecd5e1bc
* changes:
  Implement transitn animation while switching the mode
  Change magnification animation callback (2/2)
2020-09-16 01:13:03 +00:00
Vishnu Nair
204c023ae2 Add focus support for SurfaceControlViewHost
This change introduces a new call for clients to request focus on their
embedded views. In order to accomplish this, the owner of the
SurfacePackage sends an input token that can identify the input channel
of the embedded window. This token is forwarded as part of the focus
request.

WindowManager will authenticate the calling window and the relationship
between the host and the embedded window. Once authenticated, the
request will be forwarded to InputDispatcher. InputDispatcher will grant
the focus to the SurfaceControlViewHost if the host window is currently
focused or transfer focus back to the host window if the
SurfaceControlViewHost is focused. Otherwise the request is dropped.

In addition, SurfaceView, the host in this scenario, now overrides the
onFocused function to transfer focus to and from the embedded view.

Test: atest SurfaceControlViewHostTests
Bug: 151179149

Change-Id: Ia95545a60d73db4c03679bce9747d2e275806838
2020-09-15 14:48:13 -07:00