Commit Graph

15522 Commits

Author SHA1 Message Date
Winson Chung
7d601af2cc 3/ Ensure that drag shadow canvas matches activity hw acceleration
- When an activity is hw accelerated it may be drawing content
  backed by a hw buffer, so the drag shadow canvas should match

Bug: 169894807
Test: atest DragDropTest
Change-Id: I35e07d9b3119df674c9e62a83765657ccbe074da
2020-10-27 00:00:52 +00:00
Jeff DeCew
90b22b366b Merge changes I80173501,I6fbacf86,I4995288d,Ie21b0d9d
* changes:
  Split NotificationHeaderView's text content into NotificationTopLineView
  Fix QS Horizontal Margin
  Remove unused gravity customization
  Remove unused flag in NotificationHeaderView
2020-10-26 14:23:00 +00:00
TreeHugger Robot
813ea77a6a Merge "Remove legacy insets from View.AttachInfo" 2020-10-26 12:20:28 +00:00
Winson Chung
fb314e008e Merge "1/ Add basic infra for global drag handling in the Shell" 2020-10-23 23:59:19 +00:00
TreeHugger Robot
bd40f7973a Merge "Increase the timeout in SystemTextClassifier to 1 minute" 2020-10-23 23:00:56 +00:00
Tony Mak
a19833565b Increase the timeout in SystemTextClassifier to 1 minute
TetxClassifier APIs are supposed to call on a worker thread
(@WorkerThread), so there is no reason to enforce a short timeout like
2s.

We are seeing timeouts in some emulator tests.
SuggestConversationActions takes around 3s on the emulator.
I can imagine this can also happen on slow device or the input is
sufficiently long.

Also
- Fixed a bug that forgot to call callback.onFailure() when the caller
is not allowed to see the request.
- mOnServiceFailure should be @NonNull. It is important to invoke
callback.onFailure() to notify the client that the request has just
failed. Currently, there is only callsite that creates the
PendingRequest object and it is not null.

Test: atest -p external/libtextclassifier  --all-abi
Test: atest TextClassifierServiceSwapTest

Fixes: 171543321

Change-Id: I24ca3e8d116073650ecf588593fc1e4beba86a45
2020-10-23 22:05:32 +01:00
Winson Chung
c932060175 1/ Add basic infra for global drag handling in the Shell
- Add private window flag INTERCEPT_GLOBAL_DRAG_AND_DROP (protected by
  MANAGE_ACTIVITY_STACKS permission) to be considered as a part of the
  normal flow for global drag and drops even if the window is not
  visible.  In addition, the window with the flag receives the clip
  data on DRAG_STARTED and the drag surface on DROP.  If the window
  consumes the drop, then it will relinquish cleanup of the drag surface
  from the system.
- Add MIMETYPE_APPLICATION_ACTIVITY for an app to report that they are
  starting a global drag of an activity. The associated data must
  include an intent with the pending intent and user to launch the
  activity for.
- Add a test drag handler on the shell end to receive the drag, setup a
  drag layout, and just launch the intent (for now).

Bug: 169894807
Test: atest DragDropControllerTest
Test: atest DragDropTest

Change-Id: I7f5cdca3cf515b693a8f1e507e90e22a670b5fa6
Merged-In: I7f5cdca3cf515b693a8f1e507e90e22a670b5fa6
Signed-off-by: Winson Chung <winsonc@google.com>
2020-10-23 20:00:19 +00:00
Issei Suzuki
1e2b859350 Merge "Replace old app transition type to new transition type (1/N)" 2020-10-23 17:19:28 +00:00
Hongwei Wang
8aaed30dca Merge "Enter PiP directly if the transition is handled in Launcher" 2020-10-23 16:09:31 +00:00
Jeff DeCew
085a9fc9d4 Split NotificationHeaderView's text content into NotificationTopLineView
Test: atest SystemUITests
Test: manual testing of various notification types
Change-Id: I80173501b2c5902bab83c2f620daabbd943fc473
2020-10-23 10:55:16 -04:00
Jeff DeCew
be586c8abf Remove unused gravity customization
Test: atest SystemUITests
Change-Id: I4995288d5844a2a5da782a46149def8d902a89cc
2020-10-23 10:55:15 -04:00
Jeff DeCew
4a0393e0d9 Remove unused flag in NotificationHeaderView
Test: SystemUITests
Change-Id: Ie21b0d9d113c8356279b4ae1b1dc7787c1a95d02
2020-10-23 10:55:15 -04:00
Jeff DeCew
39743908c3 Merge "Remove Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL flag" 2020-10-23 14:42:44 +00:00
Hongwei Wang
0065703423 Enter PiP directly if the transition is handled in Launcher
Added also a AIDL method Launcher would issue when the entering pip
animation is completed on Launcher side and WM should update the task
surface when doing cleanup.

Bug: 143965596
Test: see ag/12838262
Change-Id: I5396f9637b4760df014f63b46543d4f399229bba
2020-10-22 22:36:40 -07:00
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
Issei Suzuki
aa5118f23d Replace old app transition type to new transition type (1/N)
- Rename TransitionType to TransitionOldType, and define a new
  TransitionType.
- Calls prepareAppTransition which takes a new TransitionType when app
  transition related event happens.

The TransitionOldType and related logic will eventually removed. Until
migration finishes, we keep both.

Bug: 166736358
Test: Pass existing tests, since no new logic is enabled.

Change-Id: I984f68d5ecfae56fbfe7d91babbfddcf34378f6c
2020-10-22 19:49:12 +02:00
Jeff DeCew
c2eb050354 Remove Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL flag
Fixes: 160886843
Test: SystemUITests
Change-Id: I88a10b370d9022bbc226eabce3b41293e55c7f96
2020-10-22 09:25:17 -04: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
33933fa9cf Remove legacy insets from View.AttachInfo
The fields aren't used by anyone.

Bug: 149813814
Test: Build
Change-Id: I610375edcc212ce1f3a8045ef275648fe6939c5a
2020-10-21 15:24:37 +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