Commit Graph

15823 Commits

Author SHA1 Message Date
Tiger Huang
7dbb0540c0 Preserve the controlling state of appearance and behavior
Make sure the appearance or the behavior controlled by the new APIs
won't be affected by setting new LayoutParams.

This CL also makes ViewRootImpl#setLayoutParams won't modify the
caller's LayoutParams.

Fix: 175169461
Test: atest ViewRootImplTest
Change-Id: I4cdd846e8638f9813146e6461134e4dd1606bd50
2021-01-06 19:10:02 +08:00
Tiger Huang
335d657422 Merge "Send display cutout to client via insetsChanged" 2021-01-06 06:52:31 +00:00
Chavi Weingarten
f52cfa501c Merge "Clean up unused code." 2021-01-05 21:53:39 +00:00
Chavi Weingarten
af95a200dc Merge "Fix blur in ViewRootImpl" 2021-01-05 21:50:20 +00:00
chaviw
a8ff59dfb6 Clean up unused code.
Since SurfaceView no longer enables blast sync transactions, a lot of
the code is no longer needed.

BlastSync is only set when ViewRootImpl calls relayout that returns the
blast sync flag. This means, we are guaranteed to pause the UI thread
since we don't want to allow overlapping relayouts. Because of this, we
can remove a lot of the complex code and variables.

1. We no longer need both mSendNextFrameToWm and
mNextDrawUseBLASTSyncTransaction. This is because if mSendNextFrameToWm
is true, we will pause the traverse and never set
mNextDrawUseBLASTSyncTransaction until mSendNextFrameToWm is set to
false.

2. Similarly, we don't need mRtNextFrameReportedConsumeWithBlast. This
was added to help with overlapping requests. Since that's no longer
possible, we can just remove this and use mSendNextFrameToWm as the
check

3. We also don't have to be thread safe with mRtBLASTSyncTransaction
since we only update it when the UI thread is paused.

4. We no longer need to call setNextTransaction with null since that was
only when SurfaceView was calling useBlastSyncTransaction and the main
window wasn't drawing. That no longer happens and we are guaranteed
that setNextTransaction is only set when a relayout occurs.

Test: Enable blast sync and use split/pip
Bug: 175229445
Change-Id: I0bebd15804ea3b960e85c20235ae5ce98bcc3f00
2021-01-05 21:03:10 +00:00
Jeff Sharkey
0653eec119 Merge "Add SystemUI owners NotificationHeaderView and NotificationTopLineView" am: 1050d7b88c am: b5de515afa am: 59fb3f9d21
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1532649

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I193eb819384eca352dc3453a121e5a33fd14afb2
2021-01-05 18:37:05 +00:00
Jeff Sharkey
59fb3f9d21 Merge "Add SystemUI owners NotificationHeaderView and NotificationTopLineView" am: 1050d7b88c am: b5de515afa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1532649

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic439b1773199ed952e935169d1730a9bc2366a4c
2021-01-05 18:02:00 +00:00
Fiona Campbell
48df7d1850 Add config.xml fallback in DisplayDeviceConfig
This change adds the default brightness to the ddc, and a fallback to
config.xml when the ddc doesn't exist.

It adds the minimum and maximum brightness constrtaints to the display
device config - which are currently sourced from config.xml.

Bug: 147415200
Test: manual

Change-Id: Ibbfbbbd495048114befb3f867bd5f4e26916ca9e
2021-01-05 14:31:20 +00:00
Tiger Huang
ec1a69e87c Send display cutout to client via insetsChanged
Since the display cutout is a type of insets and the display cutout can
be obtained from WindowInsets, it makes sense that InsetsState has the
display cutout instance. In this way, we can send the display cutout to
client via W#insetsChanged instead of W#resized.

This can be a step to remove the class of ClientWindowFrames, and can
also be a step to make client compute its window frame locally.

Fix: 175858810
Bug: 161810301
Test: atest WindowAddRemovePerfTest ImeInsetsSourceConsumerTest
            InsetsControllerTest InsetsStateTest ViewRootImplTest
            WindowInsetsControllerTests ActivityRecordTests
            DisplayPolicyLayoutTests LaunchParamsControllerTests
            TaskSnapshotSurfaceTest WindowMetricsActivityTests
            WindowMetricsWindowContextTests WindowMetricsTest
            WindowFrameTests WindowStateTests WmDisplayCutoutTest
Change-Id: I9a930b1d2f7df3cea2b29629b767a4a5f31bca17
2021-01-05 22:22:38 +08:00
Chavi Weingarten
67ac97e6e4 Merge "Revert "Revert^4 Flip BLAST for SurfaceView"" 2020-12-31 00:59:00 +00:00
Chavi Weingarten
9befd4baa9 Revert "Revert^4 Flip BLAST for SurfaceView"
This reverts commit 0cbbd54be7.

Reason for revert: b/176411039

Change-Id: I052fd345ab75f04a057f2217949e57450b3eba2b
2020-12-30 19:05:02 +00:00
Tracy Zhou
7db32da533 Merge "Add the missing call to write mInputToken in SurfacePackage to parcel" 2020-12-30 00:17:47 +00:00
chaviw
6fbb788fbd Fix blur in ViewRootImpl
The blur code in ViewRootImpl had a few issues

1. The transaction was applied or merged in frameCompleteCallback. This
is too late since the frame could have already been sent to
SurfaceFlinger and possibly latched already. We need to make sure we
apply or merge the transaction before latching. Therefore, moved the
blur request code into the frameCallback, which is invoked before the
buffers are swapped.

2. The blur code was using the blast sync transaction. This means the
blur would only get applied if a request to sync transactions was
called, which isn't very often. Instead, use mergeWithNextTransaction
which will send the transaction to the BBQ. The BBQ will either apply
it when the buffers are swapped or merge with a pending transaction that
is applied later to work with blast sync. This ensures the transaction
is synchronized with the correct frame

Test: manual
Bug: 174145445
Change-Id: Id36719c03f18739513e3198602c8a7ec4fd8da69
2020-12-29 10:43:04 -08:00
Jeff DeCew
f1507144b4 Add SystemUI owners NotificationHeaderView and NotificationTopLineView
Change-Id: I3164c8562a193bd5f352040d496707df03cd1ca6
2020-12-29 14:56:36 +00:00
TreeHugger Robot
6d432142ed Merge "Merge SV transactions to VRI BlastBufferQueue" 2020-12-29 02:14:08 +00:00
Tracy Zhou
2a4594ec5e Add the missing call to write mInputToken in SurfacePackage to parcel
ag/12396996 introduces mInputToken, but it's only added to parcel
reading. It has thus caused a bug (parcel reading misalignment) in
the Wallpaper app as in our preview feature we passes a
SurfacePackage over from Launcher.

Test: manual
Fixes: 176248059
Change-Id: Ife46d6d67991964d63513c946318cffbaf4ffae9
2020-12-28 17:43:49 -08:00
TreeHugger Robot
631135a9a8 Merge "Better IME transition while switching app with recents (3/N)" 2020-12-28 18:34:32 +00:00
Vishnu Nair
0aa41a85fe Merge SV transactions to VRI BlastBufferQueue
Currently SV with blast sync requests a sync transaction from VRI and
merges its transactions with VRI's sync transaction. This can break if
we are not able to set the request in time.

Instead this change will merge SV transaction from the renderthread to
the VRI BlastBufferQueue specifying the framenumber which the
transaction should be merged with. The transaction will be queued until
we submit a VRI buffer with the requested frame number.

Test: open bubbles with sv blast
Test: atest SurfaceViewSyncTest
Bug: 175594838
Change-Id: I87ba346d782f615bab2e8a692adb2b3c49ef4021
2020-12-28 10:10:56 -08:00
Chavi Weingarten
d2d9390ffd Merge "Handle multiple relayout calls with blast sync" 2020-12-28 17:41:18 +00:00
Ming-Shin Lu
d579c94480 Better IME transition while switching app with recents (3/N)
- Add hasImeWindowSurface in TaskSnapShot
- Add InsetsSourceControl#getAndClearSkipAnimationOnce for skiping
      IME showing animation once when starting window with IME surface

Bug: 166736352
Bug: 153145997
Test: manual as below steps
    0) Enabling developer options -> Quick settings developer tiles ->
       Window animation scale to slow down transition animation.
    1) Launch an app with focusing an editor to show soft-input
    2) Swipe out app task to back to launcher
    3) Using quick switch or taping shortcut to bring back the app task
    4) Verify that should be no IME showing animation happens during
       task transition.

Change-Id: I83ffc03119e01da71ad12f8ad8043cf0730dfd50
2020-12-28 22:15:12 +08:00
Adam Wright
68e25d8da0 Merge "Revert "Prefetching can be interupted by other service requests."" 2020-12-23 13:48:53 +00:00
TreeHugger Robot
a52a79f7dd Merge "Make IInputMethodManager to oneway (7/N)" 2020-12-23 04:40:21 +00:00
TreeHugger Robot
9df82ca4cc Merge "Make IInputMethodManager to oneway (6/N)" 2020-12-23 03:52:54 +00:00
Wilson Wu
4a820ccc41 Make IInputMethodManager to oneway (7/N)
1. Create InputMethodInfoList result callback and apply it to :
   -. getInputMethodList
   -. getEnabledInputMethodList

2. Apply IntResultCallback to getInputMethodWindowVisibleHeight

Bug: 163453493
Test: Manual test with keyboard
Test: atest CtsInputMethodTestCases
Change-Id: Iaa63e01453da4ff0e3f446eac036b3be3180cb73
2020-12-23 10:27:05 +08:00
Adam Wright
c3060eae38 Revert "Prefetching can be interupted by other service requests."
This reverts commit 103dd32a74.

Reason for revert: Looking for culprits for b/176078134

Change-Id: I1e2524411fcc91a2c212d4ee5a0f5b74cac0bda4
2020-12-22 16:06:09 +00:00
Wilson Wu
38fd020616 Make IInputMethodManager to oneway (6/N)
Create InputMethodSubtype and InputMethodSubtypeList
result callback and apply it to :

-. getLastInputMethodSubtype
-. getCurrentInputMethodSubtype
-. getEnabledInputMethodSubtypeList

Bug: 163453493
Test: Manual test with keyboard
Test: atest CtsInputMethodTestCases
Change-Id: I646ef4ae0570aae1812ea267f309441fdec6938d
2020-12-22 10:56:18 +08:00
chaviw
351e9cf9be Handle multiple relayout calls with blast sync
The issue is the following:
1. Call relayout from VRI. drawsNeededToReport = 1
2. SV also will need to be updated. drawsNeedToReport = 2
3. VRI is finished rendering, but SV is not. drawsNeedToReport = 1
4. VRI calls relayout again. drawsNeedToReport = 2
5. SV finishes drawing. drawsNeedToReport = 1

BBQ will get stuck since it's waiting indefinitey for a transaction
callback. The previous transaction can never get applied since we're
still waiting until drawsNeededToReport = 0.

This prevents situations like this from happening since it will not
allow a relayout to get called until the previous transaction has been
applied.

Test: Split screen with chrome
Bug: 167202096
Change-Id: I167a90ef00fa6677b3c55239e74eefb6a1384baf
2020-12-21 16:37:35 -08:00
Taran Singh
dc211bfac3 Prevent Fullscreen IME when app is in portrait.
When an app is running in portrait orientation, regardless of
what orientation display is in, IME shouldn't use fullscreen-mode.

Setting IME_FLAG_NO_FULLSCREEN in EditorInfo makes sure IME doesn't go
fullscreen.

Bug: 157870379
Test: Manually using steps in bug
Change-Id: I5a5e73e1dec776665f28a7e2eb091b555198001b
2020-12-21 05:57:47 -08:00
Kohsuke Yatoh
7bcdf29c37 Merge "Add RESULT_ATTR_DONT_SHOW_UI_FOR_SUGGESTIONS." 2020-12-18 04:15:37 +00:00
Vishnu Nair
81585a2419 Merge "Revert^4 Flip BLAST for SurfaceView" 2020-12-18 01:02:49 +00:00
TreeHugger Robot
6656f0fc5c Merge changes from topic "SensorManager"
* changes:
  Add feature for inputdevice sensor manager.
  Add motion sensor configuration for Sony DS4.
2020-12-17 20:26:17 +00:00
Vishnu Nair
0cbbd54be7 Revert^4 Flip BLAST for SurfaceView
Enable buffers to go through BLASTBufferQueue
in SurfaceView.

Bug: 168917217
Change-Id: If64f5232d5f92d19eff5099b634ee3356087dff8
Test: presubmit tests now include wm cts tests
Test: manual virtual display tests
Test: atest SurfaceViewBufferTests & manual tests
Test: GtsMediaTestCases CtsMediaTestCases CtsCameraTestCases
2020-12-17 18:29:03 +00:00
TreeHugger Robot
25d4114431 Merge "SyncPointerCapture (7/n): Clean up unused code from old Pointer Capture" 2020-12-17 18:06:02 +00:00
Mark Renouf
096eeb8983 Merge "Fixes use of elapsedRealtime vs uptimeMillis" 2020-12-17 17:20:37 +00:00
TreeHugger Robot
25c0d56368 Merge "Compare supported modes in DisplayInfo.equals()" 2020-12-17 14:19:11 +00:00
Vishnu Nair
eac041f608 Merge "Separate blast sync for surface view from blast adapter" 2020-12-17 01:22:59 +00:00
Vishnu Nair
be43f4ebf6 Separate blast sync for surface view from blast adapter
Allow enabling blast adapter for surfaceview without enabling
blast sync.

Bug: 175594838
Test: open bubbles with sv blast adapater enabled
Change-Id: I6bd95651c087d3ae38d5b14ac1011a9b87639223
2020-12-17 01:22:09 +00:00
Kohsuke Yatoh
e5f12abfec Add RESULT_ATTR_DONT_SHOW_UI_FOR_SUGGESTIONS.
Bug: 166304720
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I2f5796d899c79ea1cd6795c16f2011389ae7afea
2020-12-17 00:16:36 +00:00
Chris Ye
1d29b4c087 Add feature for inputdevice sensor manager.
Add support of sensor manager in InputDevice and allow user to obtain
SensorManager object to query supported sensor types and register sensor
event listeners.

Bug: 161634265
Test: atest InputDeviceSensorManagerTest

Change-Id: Ia7a04a0fcf7e026c49a4fb1a9009b132ff84cf7c
2020-12-16 15:41:32 -08:00
Qasid Sadiq
0bae984c08 Merge "Prefetching can be interupted by other service requests." 2020-12-16 20:27:40 +00:00
Prabir Pradhan
a26dd05602 SyncPointerCapture (7/n): Clean up unused code from old Pointer Capture
After the pipeline changes to Pointer Capture, this CL cleans up the
following:
- The old way of notifying windows of Pointer Capture
(IWindow::dispatchPointerCaptureChanged) is removed.
- Tracking Pointer Capture in WindowManagerService is removed.

Bug: 141749603
Test: manual, flash crosshatch, pointer capture works.
Change-Id: I5bbcef42fe8d0d93a64a4a411b1d493fcb800f92
2020-12-16 19:34:07 +00:00
Ana Krulec
dd34a21bb4 Merge "Plumbing through GPU context priority" 2020-12-16 19:28:03 +00:00
Prabir Pradhan
a90ec162c9 Merge "SyncPointerCapture (6/n): Move Pointer Capture to InputDispatcher" 2020-12-16 18:37:01 +00:00
Adrian Roos
4f8b633dda Merge "IME: Add IME owners to View(RootImpl)" am: aa8d926fbb am: f98a40b6f3 am: 7304f79c51
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1531631

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id4873ce6ba1a9e1c0f4daebf266707b0f0c0c5ff
2020-12-16 17:54:03 +00:00
Nikita Dubrovsky
9d3615f71d Merge "Hide ContentInfo.partition from the public API" 2020-12-16 17:41:41 +00:00
Adrian Roos
7304f79c51 Merge "IME: Add IME owners to View(RootImpl)" am: aa8d926fbb am: f98a40b6f3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1531631

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1185e6d0268f44c40758fbbd1cb15e0bbe9c904c
2020-12-16 17:23:58 +00:00
TreeHugger Robot
71a741594f Merge "Add InputConnection#performSpellCheck()." 2020-12-16 10:54:27 +00:00
Wilson Wu
0e75d9e4dd Merge "Make IInputMethodManager to oneway (5/N)" 2020-12-16 09:33:42 +00:00
Adrian Roos
7a4c6ec802 IME: Add IME owners to View(RootImpl)
Change-Id: Iedffc821be5eea3159a5c13014d0d30803a46c7d
2020-12-16 09:21:40 +00:00
Qasid Ahmad Sadiq
103dd32a74 Prefetching can be interupted by other service requests.
Slow prefetch requests would block user interactive requests, creating
noticeable sluggishness and unresponsiveness in accessibility services,
especially on the web.

Let's make it so a user interactive requests stops prefetching.
We can't interupt an API call, but we can stop in between API calls.

On the service side, we have to seprate the prefetch callbacks from the
find callback. And we have to make it asynchrnous. It does dispatch into
the main thread, so the AccessibilityCache can remain single threaded.

When the calls are interupted on the application side, returnPendingFindAccessibilityNodeInfosInPrefetch checks the find requests that are waiting in the queue, to see if they can be addressed by the prefetch results. If they can be, we don't have to call into potentially imperformance application code.

Bug:30969887
Test: Performance measurements, tried it out by hand to see if their are any bugs. CTSAccessibility*

Change-Id: Ia8f1152afa3987f262f37ed4583775acdd32db43
2020-12-16 00:13:55 -08:00