Commit Graph

15505 Commits

Author SHA1 Message Date
TreeHugger Robot
acd46f5672 Merge "IME API: InputConnection#getSurroudingText(int, int, int)" 2020-10-23 03:18:54 +00:00
Vishnu Nair
ce1a648484 Allow creating child surfaces from BlastBufferQueue
App such as Chrome create child surfaces and parent them to
surfaces provided by SurfaceView. When we enable the blast
adapter for SurfaceView, the IGBP returned to the app is
created in the client and SurfaceFlinger does not know about it.
When the app creates a child surface and provides the IGBP as the
parent surface identifier, SF fails to validate the IGBP and the
surface is not created. This can be avoid if the client creates the
child surface from the SV SurfaceControl but we still need to
support existing APIs.

To fix this, when we create a Surface from the adapter, pass in
the handle of the Blast SurfaceControl. When calling
ASurfaceControl_createFromWindow, use this handle to identify
the parent.

Bug: 168917217
Test: adb shell settings put global use_blast_adapter_sv 1 & launch chrome
Change-Id: I879b411c47e8558397516bd7b7278813e79e005f
2020-10-22 18:03:22 -07:00
Jeff DeCew
ddc2dcce49 Merge changes I6fd9aeec,I296e9d53
* changes:
  Minimize use of header in adjusting notification colors.
  Remove setExpanded from the NotificationHeaderView
2020-10-21 19:12:53 +00:00
Winson Chung
5c0e676957 Merge "Remove single task display path" 2020-10-21 17:09:17 +00:00
Winson Chung
d660f73a42 Remove single task display path
Test: atest TaskStackChangedListenerTest
Test: atest RecentTasksTest
Bug: 165794879
Change-Id: I4c86e58026be7bcbbd8a2568b396a281668b9385
2020-10-21 17:08:55 +00:00
Jeff Sharkey
1992cdb4de Merge changes from topic "oct16c"
* changes:
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStringsChecker.
  Apply fixes for EfficientCollections.
  Trivial refactor for consistent naming.
  Expand formatSimple() to support widths.
  Refinement of EfficientStringsChecker.
2020-10-21 15:27:15 +00:00
Tiger Huang
9e2c966d61 Merge "Don't dispatch legacy insets to client" 2020-10-21 15:23:27 +00:00
Jeff DeCew
858ad2ac33 Minimize use of header in adjusting notification colors.
Also adds support for 'inverted' icons.

Test: atest SystemUITests
Test: manual testing of numerous notification configurations
Change-Id: I6fd9aeec9f5971495d514add2bbb30b50db7d3c1
2020-10-21 10:32:19 -04:00
Jeff DeCew
73e65d4291 Remove setExpanded from the NotificationHeaderView
Test: atest SystemUITests
Change-Id: I296e9d530d2c0ba581828dee0dc2026df0e38c3c
2020-10-21 09:57:07 -04:00
Tiger Huang
2bf8c796c5 Don't dispatch legacy insets to client
The server won't dispatch the legacy content insets, stable insets, and
visible insets to the client. The insets would be computed from the
insets state by the client.

This CL also fixes the insets scaling issue in compatible mode.

Bug: 149813814
Fix: 169940916
Fix: 165412978
Test: atest WindowAddRemovePerfTest InsetsAnimationControlImplTest
            ActivityRecordTests DisplayPolicyLayoutTests
            InsetsPolicyTest InsetsStateControllerTest
Change-Id: I83570973f587a6abf887752494f750b46e3e484d
2020-10-21 20:20:21 +08:00
Galia Peycheva
224c843af0 Merge "Add background blur in WindowManager" 2020-10-21 09:09:04 +00:00
Lan Wei
02b50d4944 IME API: InputConnection#getSurroudingText(int, int, int)
Introduce a new class SurroundingText and a new API in InputConnection
to support retrieving surrounding text as an atomic request.

SurroundingText is the class for wrapping the text and sggestion info.
InputConnection#getSurroudingText() will return an SurroudingText object
if the protocol is supported.

Test: atest FrameworksCoreTests:SurroundingTextTest
Test: atest CtsInputMethodTestCases:BaseInputConnectionTest

BUG: 167947745
Change-Id: I2eb9ef5ba61a0e033007089da80f81548108621e
2020-10-21 13:22:36 +08:00
Jeff Sharkey
1c08f48253 Apply fixes for EfficientStringsChecker.
The recently-built Error Prone checker has found many instances where
we're always paying the cost of StringBuilder concatenation, even in
the typical cases where preconditions are successfully met.

Benchmarks have shown that even when replacing these with varargs
formatter strings, the default case is 20x faster.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If8c00bc73467bfb91ec16c162969c9d26ca53646
2020-10-20 22:00:16 -06:00
Jeff Sharkey
df8dc2b4a5 Apply fixes for EfficientCollections.
Drop-in replacements suggested for inefficient collections.  Also
annotate a handful of places where we're unable to update.

Bug: 155703208
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I48b600508df8160ac9b40fea7afca974b2c972f6
2020-10-20 21:57:00 -06:00
TreeHugger Robot
c60c76caf0 Merge "Minimize exposure of NotificationHeaderView; prefer NotificationViewWrapper." 2020-10-20 22:02:23 +00:00
TreeHugger Robot
fac9815386 Merge changes from topic "window_context"
* changes:
  Use WindowContext in GlobalScreenshot
  scrollCapture: Avoid crash if host window doesn't exist
  Refactor names of internal scrollcapture interfaces
2020-10-20 20:42:08 +00:00
Galia Peycheva
f30a6ab670 Add background blur in WindowManager
The CL adds background blur to the WindowManager LayoutParams as a
hidden API. The background blur is then passed on to the SurfaceControl
in WindowStateAnimator.prepareSurfaces.

Bug: 167166562
Test: m && flash && start app that requests background blur && verify it
works

Change-Id: I5dad3d8d5c75e1feff8fa035452dfe5c90efaa88
2020-10-20 17:26:18 +02:00
Jeff DeCew
8be7d6e3c4 Minimize exposure of NotificationHeaderView; prefer NotificationViewWrapper.
Test: atest SystemUITests
Test: manual testing with notify APK
Change-Id: I91ed49411f29f42ce6708fdb816ebe650a6d7e8b
2020-10-20 10:35:41 -04:00
Anton Hansson
c0e3a09690 Merge "Remove @TestApi from @SystemApi symbols" 2020-10-20 13:41:39 +00:00
TreeHugger Robot
8e85d0e23d Merge "Deprecated unused TRANSIT_DOCK_TASK_FROM_RECENTS transition." 2020-10-20 13:37:22 +00:00
Issei Suzuki
823b309139 Deprecated unused TRANSIT_DOCK_TASK_FROM_RECENTS transition.
Test: existing tests pass.
Change-Id: I1ad4893c2153ffec1e268643135df8304bcca738
2020-10-20 13:32:27 +02:00
Anton Hansson
586a3cf229 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-20 09:04:03 +01:00
Mark Renouf
749b6360a1 Refactor names of internal scrollcapture interfaces
Renames to better align with use and existing naming patterns.
Using 'connection' to avoid confusion as to control flow or
roles. (A connection is direct from SystemUI --> App process)

IScrollCaptureClient -> IScrollCaptureConnection
IScrollCaptureController -> IScrollCaptureCallbacks

Test: atest FrameworksCoreTests:ScrollCaptureConnectionTest \
          FrameworksCoreTests:ScrollCaptureTargetResolverTest \
          ScrollCaptureTest

Change-Id: I9afd33109f6718b61d172ce3e4b3bb5d71a2897e
2020-10-19 14:48:32 -04:00
Rob Carr
f82f0bc28e Merge "SurfaceView: Fix null check on RemoteAccessibilityController" 2020-10-19 17:40:55 +00:00
Jeff DeCew
d5b8710a9a Merge "Remove the old seamless chip" 2020-10-19 17:26:29 +00:00
Tiger Huang
e1833c6cfd Merge "Make the requested visibility always up-to-date" 2020-10-17 09:18:03 +00:00
Vishnu Nair
6e2fec6efd Merge "BLAST: Ensure buffers are submitted before reporting draw finished" 2020-10-16 23:03:51 +00:00
Robert Carr
0d587ee61a SurfaceView: Fix null check on RemoteAccessibilityController
ImporantForAccessibility can be called from the View constructor
in which case we may not have initialized RemoteAccessibilityController
yet.

Bug: 171015133
Test: Existing tests pass. Repro from bug.
Change-Id: Iedc29a9d4270ebe600648d6ce5e17c864a662396
2020-10-16 13:12:48 -07:00
Jeff DeCew
e12ff8a21c Remove the old seamless chip
Test: manual - play audio, use the real seamless chip
Change-Id: I0cc93c222dd6ae7bc3a823f27967d98fb39e8cd9
2020-10-16 15:15:34 -04:00
John Reck
44ca28c5c9 Remove some dead code
Simplify state by deleting unused & always true stuff

Test: builds
Change-Id: Idf679aff5e809e567dac21a127cb9d6ace894f0e
2020-10-16 13:53:05 +00:00
Tiger Huang
bf015c77b4 Make the requested visibility always up-to-date
The new logic sends the requested visibility to server even when the
client doesn't have a control. This makes the requested visibility
reliable at the server side.

This CL also changes getRequestedState to getRequestedVisibility in
WindowState, because the frames in getRequestedState are not reliable.

Fix: 161247175
Fix: 166819574
Test: atest DisplayPolicyLayoutTests DisplayPolicyTests InsetsPolicyTest
            InsetsSourceProviderTest InsetsStateControllerTest
            WindowStateTests InsetsAnimationControlImplTest
            InsetsControllerTest WindowAddRemovePerfTest
            ActivityRecordTests
Change-Id: I7d32dacaa1302bab61386f5bd69aaa7dde953ebe
2020-10-16 16:38:08 +08:00
Vishnu Nair
9bce5e0c04 BLAST: Ensure buffers are submitted before reporting draw finished
If blast sync is not enabled abut we need to report draw finished
for the next frame, call setNextTransaction. Blast buffer queue
will process any queued up buffers and ensure the buffer is
submitted before reporting draw finished.

Test: Test no flickers with blast enabled in splitscreen
Change-Id: If7a36eb0a9a2914dd37adfd20abcbe2b5074b16a
2020-10-15 11:48:42 -07:00
Roman Kalukiewicz
24403f7ef2 Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00
Nikita Dubrovsky
4e34109f32 Merge changes I6e6f1600,Id45cee90
* changes:
  Add SOURCE_APP to OnReceiveContentCallback.Payload
  Removed duplicate javadocs from OnReceiveContentCallback.Payload fields
2020-10-15 14:47:20 +00:00
TreeHugger Robot
17c77995a7 Merge "Support ignoring app orientation request per display" 2020-10-15 02:58:43 +00:00
TreeHugger Robot
ba3b589faf Merge "Changed logic about how to check if VRI replaced its surface." 2020-10-15 02:44:09 +00:00
Wale Ogunwale
db900f8a46 Support ignoring app orientation request per display
For products that don't want the app orientation request to change the
display's rotation, but still want the rotation to change based on
sensor readings. Apps requesting a different orientation will be
letterboxed.

Bug: 170725334
Test: adb shell cmd window set-ignore-orienation-request 1
Change-Id: I53bea137ff37b70417ed8f68ade97d9de1f284ae
2020-10-14 17:33:58 -07:00
chaviw
7b5c08e5e6 Ensure thread safety with render thread and UI Thread.
There were a few places that were not thread safe.

1. finishBLASTSync is called from the Render Thread. It
was updating mSurfaceChangedTransaction, which send to WMS on the
UI Thread. Instead, create a new local Transaction object to allow the
Render Thread to merge the mRtBLASTSyncTransaction into it. Then on the
UI thread, merge the temporary transaction into mSurfaceChangedTransaction

2. finishBLASTSync was getting called if the draw was unable to run
asynchronously. This would mean it would get executed on the UI Thread,
possibly causing a race. Instead, remove since there should be nothing
on the blast sync transaction, mRtNextFrameReportedConsumeWithBlast
would never have been set, and mSendNextFrameToWm is set to false
beforehand.

Test: YT with and without Blast
Change-Id: I72e70fea258a933f51aaaf78c7056a0d3fbac8b3
2020-10-14 17:17:43 -07:00
chaviw
25c129cc6a Changed logic about how to check if VRI replaced its surface.
SurfaceView checks if VRI hasn't changed its surface when deciding
whether to call updateRelativeZ in updateSurface. This is to give
surfaceReplaced a chance to send the updateRelativeZ in the same
transaction as swapping the surfaces.

However, SV was only checking generation id, which may not have changed
when using a blast layer. Instead, VRI will increment the sequence id
when the surface has been replaced. SV can check that value and only
do an immediate updateRelativeZ when the sequence id has not changed.

Test: Blast + Split + SV with no flicker
Change-Id: Icdf9f1fbe12fe77052030aa37d808517c5a6cd38
2020-10-14 17:13:59 -07:00
Rob Carr
ae00abf8ed Merge changes I0333ab33,I7ae7b27f,If20185ce
* changes:
  SurfaceView Cleanup (3/n): Extract RemoteAccessibilityController
  SurfaceView Cleanup (2/n): Cleanup visible = mVisible
  SurfaceView Cleanup (1/n): Breakup updateSurface()
2020-10-14 23:46:51 +00:00
Chavi Weingarten
c843f827df Merge "Removed separate SurfaceControl for Blast" 2020-10-14 23:42:46 +00:00
Mark Goldstein
dc6a578af9 Doc: Fix typo the right way. Supersedes cl/318172931 am: d5726423ca am: 6c0854d8a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12828332

Change-Id: I736a936f1830e8a6b3044526c0b4939dc36edb91
2020-10-14 22:00:58 +00:00
Mark Goldstein
d5726423ca Doc: Fix typo the right way. Supersedes cl/318172931
Bug: 170764224

Change-Id: Iaef1aa4fd3143e6e9019d06834001b3bfa3d887d

Exempt-from-owner-approval: Docs-only typo fix
2020-10-14 20:38:09 +00:00
Robert Carr
60370aadc8 SurfaceView Cleanup (3/n): Extract RemoteAccessibilityController
We extract the SurfaceControlViewHost accessibility logic from
SurfaceView. This is serving both cleaning up the code in SurfaceView
a little, while also serving the goal of one day using this
accessibility code from other components.

Test: Existing tests pass
Change-Id: I0333ab339e54e3766fffab25df92f00bdb9723dc
2020-10-14 19:02:17 +00:00
Robert Carr
5a37207192 SurfaceView Cleanup (2/n): Cleanup visible = mVisible
Since visible=mVisible we don't really need this visible variable
we clean it up to avoid confusion.

Test: Existing tests pass
Change-Id: I7ae7b27f71744c90004f77467f6fd5e79d2f557c
2020-10-13 23:09:33 -07:00
Robert Carr
f45cfa2333 SurfaceView Cleanup (1/n): Breakup updateSurface()
This has become a mega function, the number of variables
and levels of indentation is increasingly difficult to read.
This is a simple abstraction of one large chunk.

Test: Existing tests pass
Change-Id: If20185ce640802173ccd53c84b1947b011f379ad
2020-10-13 23:09:28 -07:00
Robert Carr
b3bb920676 SurfaceControl: Remove setOverrideScalingMode
There are no callers.

Bug: 161937501
Test: Existing tests pass
Change-Id: Ib668e9092c60e3b5615cef2369b97ec1e4e6b87b
2020-10-13 18:44:27 -07:00
Robert Carr
7675809673 ScreenRotationAnimation: Use Surface#setScalingMode
We are the last user of SurfaceControl#setOverrideScalingMode
in ScreenRotationAnimation we have no need to call it since we
are the BufferProducer and we can just use Surface#setScalingMode

Bug: 161937501
Test: Existing tests pass
Change-Id: I049145a91fedbbca5f009648f1537b0380c5e771
2020-10-13 18:44:19 -07:00
chaviw
4a10b38ad4 Removed separate SurfaceControl for Blast
If Blast was enabled, WindowStateAnimator would create a container layer
and then a blast layer as a child. This caused some issues with
reparentChildren and relative Z, so instead of trying to continously fix
those issues, just use one layer. If blast is enabled, it will create a
single SurfaceControl with type blast. Otherwise, it will create a
BufferQueueLayer.

This means that we have to be careful with setting any properties on
the layer since the blast adapter could also be modifying the layer.
This is in the right direction since we will move all transactions for
the layer to the client, eventually.

Test: YT and Chrome with and without Blast
Change-Id: I43efc37663696ba8e54d341a03531f0048ee6a14
2020-10-13 17:48:57 -07:00
Kyunglyul Hyun
5045b3bb65 Merge "Add @JavaOnlyStableParcelable to KeyEvent" 2020-10-14 00:00:40 +00:00