Commit Graph

15424 Commits

Author SHA1 Message Date
Adam He
1dab7a7c1f Merge "Send ContentCapture events with mHandler to prevent threading issues causing mEvents to be null." 2020-09-30 20:54:47 +00:00
Ady Abraham
e998888046 Merge "Adding publicAlternatives to UnsupportedAppUsage on Choreographer" 2020-09-30 19:11:26 +00:00
Adam He
8b7eade4fa Send ContentCapture events with mHandler to prevent threading issues causing mEvents to be null.
Bug: 169267614
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I1f0408611154cfdecc30a22f9c77582dd7001967
2020-09-29 16:35:02 -07:00
TreeHugger Robot
c747e87751 Merge "Expose spell checker settings for testing." 2020-09-29 23:08:01 +00:00
Rob Carr
c31ca6d90a Merge changes Icf1215c2,I3c8edef0,Icebd94f8
* changes:
  WindowState: Fix transaction usage in preserve surface
  WindowState/WindowStateAnimator: Remove cropping
  WindowStateAnimator/ViewRoot: Move surface resizing to client
2020-09-29 22:27:57 +00:00
Ady Abraham
42193cbccf Adding publicAlternatives to UnsupportedAppUsage on Choreographer
Adding back the UnsupportedAppUsage annotation together with
publicAlternatives according to
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/12517216/11/core/java/android/view/DisplayEventReceiver.java#158

Test: build
Bug: 162890382
Bug: 162888881
Bug: 162890407
Change-Id: I7b895978ec61290c5320ccb2472b0bf1addc914b
2020-09-29 19:22:09 +00:00
Ioana Stefan
88cefeb2c9 Merge "Add proto-based client side dumping for IME tracing" 2020-09-29 15:27:30 +00:00
TreeHugger Robot
d20030e604 Merge "Implementing Lock contention API" 2020-09-29 14:04:32 +00:00
Anmol Gupta
cf9e5123ce Add proto-based client side dumping for IME tracing
This CL implements a mechanism to dump IME related client states into
a proto file which can later be imported to winscope to allow easy
debugging. A new abstract class ImeTracing.java declares the methods
related to scheduling, collecting and dumping logs. Two child class
implement these methods for server and client separately.

The Design Doc for the IME tracing project is: go/ime-tracing

Bug: 154348613
Test: start trace by calling "adb shell ime tracing start"
      end trace by calling "adb shell ime tracing stop"
      pull trace using "adb pull /data/misc/wmtrace/ime_trace.pb ime_trace.pb"
Change-Id: Ia89f11d5ef8a220ea7746191b18769cea5a8359d
2020-09-29 15:05:18 +02:00
Robert Carr
55d882cf5f WindowStateAnimator/ViewRoot: Move surface resizing to client
The bounds on the client surface are controlled by higher levels of
the hierarchy and so the client can use whatever Surface size it wants
on its node. We move the SurfaceControl setSize call to the client,
following 3 sort of ideas:

1. Project to make relayout window async, but currently it is used as a
sync point for resizing, resizing on client, one problem solved!
2. WM Shouldn't do what it doesnt have to for clients
3. Totally move management of lowest level Surface to client
   clean up lots of WM code (see WindowStateAnimator slimming project)

In the future maybe we don't need to set the SurfaceControl size at all
and the client can just set its buffer size, but it may produce some
differences in geometry handling on the server so I want to maintain
the old semantics for this CL.

Bug: 161937501
Test: Existing tests pass
Change-Id: Icebd94f8443fdbe9f0e6968bc35bbb0504a1520c
2020-09-28 12:20:27 -07:00
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
vadimt
8f16a6c96f Implementing Lock contention API
This API allows the test to create
contention on AM, PM and/or WM locks.

Test: a prototype lock contention test
Bug: 168630376
Change-Id: I656b6b412d517cb3b3b16367d8712f78ccbc33d8
2020-09-24 13:18:12 -07: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
Kohsuke Yatoh
b651d766db Expose spell checker settings for testing.
Bug: 166304720
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I97921baa5a8808f31ae9127df471038fe2b6094c
2020-09-23 00:09:34 +00: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