Commit Graph

15558 Commits

Author SHA1 Message Date
TreeHugger Robot
9da1385292 Merge "Remove preRender input" 2020-11-02 22:35:24 +00:00
Lucas Dupin
690a360fad Create cross window blur drawable
This introduces BackgroundBlurDrawable that does cross-window blurs
The drawable should not be created manually, it should be retrieved
from the ViewRootImpl

Test: manual
Bug: 159712515
Bug: 171916625
Change-Id: I697e93fc95ba3d0a7211b235b1c5d48a1968b939
2020-11-02 04:26:13 +00:00
Chavi Weingarten
77672d8cd1 Merge "Add uid to CaptureArgs." 2020-10-30 15:57:37 +00:00
Ben Lin
f2d1d26479 Merge "PiP: Move menu to SystemWindow." 2020-10-30 06:45:29 +00:00
Ben Lin
4ee2588a05 PiP: Move menu to SystemWindow.
This is the first step to move the menu to fullscreen, but not quite
yet.

This CL does:
- Move PipMenuView to be attached to SystemWindow, instead of child of
PiP leash
- Use SyncRtSurfaceTransactionApplier to ensure the menu moves along the
PIP leash at the same time when the menu is visible
- Remove setup/destroy code in PipTaskOrganizer with SurfaceViewHost
- Expose Window information to Accessibility services
- Refactor ShellRoot to take in a Layer type instead of windowType
instead

Bug: 161710689
Bug: 170151121
Bug: 169894316
Bug: 152738416
Test: Manual

Change-Id: I73c26f96784b35b9bb9a4bea452df55cf5913278
2020-10-30 01:47:34 +00:00
Lan Wei
a401308ab7 Merge "Avoid bad InputConnection call crashing the app" 2020-10-29 23:02:32 +00:00
chaviw
26fda2aa20 Add uid to CaptureArgs.
Expose uid to the CaptureArgs in Java and JNI. The implementation in
native is already merged.

Test: Builds
Bug: 155825630
Change-Id: I66e8870bfbf84a089387b73751cddbac253f9781
2020-10-29 09:59:59 -07:00
Chavi Weingarten
66a641e6a1 Merge "Screen capture protected content for animations" 2020-10-29 16:52:06 +00:00
Mathew Inwood
bb05958365 Merge "Add maxTargetSdk restriction to unused APIs." 2020-10-29 15:23:24 +00:00
Taran Singh
72de8ead9e Remove preRender input
Cleanup unused pre-render input. We've no plans to enable it.
It adds unnecessary complexity.

Bug: 159201509
Bug: 167948123
Bug: 118599175

Test: atest CtsInputMethodTestCases

Change-Id: I32fe3759b9aeb56c868f9abf42bab124b9b83374
2020-10-29 07:57:00 -07:00
Marin Shalamanov
e215ddf54a Merge "Add mModeSwitchingType to DisplayModeDirector" 2020-10-29 13:02:05 +00:00
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Tony Mak
86da4e19ba Merge "Use the flag FLAG_IMMUTABLE when creating the PendingIntent" 2020-10-29 10:33:40 +00:00
Lan Wei
1e72ef2893 Avoid bad InputConnection call crashing the app
Update InputConnection#getTextBeforeCursor(int, int) and
InputConnection#getTextAfterCursor(int, int) API to
specify that the paramter {@code n} must be non-negative.
If the IME using the API incorrectly, throw
IllegalArgumentException.

Also update these two APIs that return nullable result (no
behaivor change). For editor App, return null for bad case.

Test: atest BaseInputConnectionTest#testInvalidGetTextBeforeOrAfterCursorRequest
Test: atest InputConnectionWrapperTest#testInvalidGetTextBeforeOrAfterCursorRequest

BUG: 169114026

Change-Id: I95169735198f8363c981a61e20234dfebfd645b1
2020-10-29 16:51:49 +08:00
Hongwei Wang
286c33a5c5 Merge "Revert "Add maxTargetSdk restriction to unused APIs."" 2020-10-28 23:58:21 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Jeff DeCew
8287008096 Merge changes I78412489,I57a12287,Ieca42376
* changes:
  NotificationTopLineView supports layout_height="wrap_content"
  Respect the gravity of the NotificationTopLineView.
  Remove the smart reply container from the base template; I believe they are never used
2020-10-28 20:09:54 +00:00
Jeff DeCew
7995e6d7b5 NotificationTopLineView supports layout_height="wrap_content"
Test: atest SystemUITests
Test: manually tested within my branch which does this
Change-Id: I78412489be7723697d8dc3106dbb4d67fd72a3a0
2020-10-28 16:04:42 -04:00
Jeff DeCew
9863a144cf Respect the gravity of the NotificationTopLineView.
Test: atest SystemUITests
Test: manually tested within my branch with new templates
Change-Id: I57a12287f1ce712914f985cc0de4df7613c18164
2020-10-28 16:04:41 -04:00
Nikita Dubrovsky
909bb8a045 Merge "Use a separate code path for rich content in augmented autofill" 2020-10-28 18:43:30 +00:00
Louis Chang
34a8fd02af Merge "Deprecate MANAGE_ACTIVITY_STACKS permission" 2020-10-28 13:33:14 +00:00
Mathew Inwood
ee5d369323 Merge "Add maxTargetSdk restriction to unused APIs." 2020-10-28 09:39:20 +00:00
Sean Stout
54755995ac Merge "Introduce DisplayGroup" 2020-10-28 04:30:04 +00:00
Sean Stout
a9f63583d0 Introduce DisplayGroup
A DisplayGroup is a collection of LogicalDisplays which are tied
together for certain behaviors and operations. This CL simply introduces
the class, however in the future it will be used for multi-display power
state work.

Bug: 138328918
Test: manual - build and deploy
Change-Id: I3d736b2758a3363678afc962872fcbe7f4e96806
2020-10-27 18:38:55 -07:00
Louis Chang
5510ecdfa9 Deprecate MANAGE_ACTIVITY_STACKS permission
Adding MANAGE_ACTIVITY_TASKS permission as the replacement, but
still grant the deprecated MANAGE_ACTIVITY_STACKS permission for
app compatibility.

Bug: 157876448
Test: presubmit

Change-Id: I894ee66e058b1024a731d3be4b33b69626451f08
2020-10-28 09:20:00 +08:00
Nikita Dubrovsky
00d2ce0b6f Use a separate code path for rich content in augmented autofill
Image suggestions (and other rich content) are not handled the same way
as primitive autofill values. These suggestions are also only applicable
to augmented autofill. Therefore, instead of reusing AutofillType and
AutofillValue, we use a separate code path to insert rich content. A
follow-on change will remove AUTOFILL_TYPE_RICH_CONTENT and the
corresponding code on AutofillValue.

Bug: 168837034
Test: Manual and unit tests
  atest CtsAutoFillServiceTestCases:DatasetTest
  atest CtsAutoFillServiceTestCases:InlineAugmentedAuthTest
  atest CtsAutoFillServiceTestCases:InlineAugmentedLoginActivityTest
Change-Id: I4fa3baf2b545908fc25f3a6e28a7addc7004786b
2020-10-27 16:16:06 -07:00
TreeHugger Robot
6cac0b0fb2 Merge "Remove batched consumption from onStop" 2020-10-27 19:08:56 +00:00
TreeHugger Robot
1086c93f77 Merge "Removing taking unrelated locks from holdLock" 2020-10-27 17:46:12 +00:00
Tony Mak
96466fe9be Use the flag FLAG_IMMUTABLE when creating the PendingIntent
Context:
https://groups.google.com/a/google.com/g/android-chatty-eng/c/XKA8rSVwjIg/m/1rQvD1uoCAAJ

Bug: 169718669

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

Change-Id: Ia5edd762007b6464b9c9bf4a148311ccbb38d25f
2020-10-27 17:40:40 +00:00
Siarhei Vishniakou
3d34eeb8d0 Remove batched consumption from onStop
This patch reverts the earlier patch, ag/11959351, because the correct
solution is aosp/1459888.

When batched input is available, the Choreographer::CALLBACK_INPUT is
scheduled by ViewRootImpl. The callback always runs, even if onStop has
been called. So the earlier patch was invalid.

In practice, what happened was that the batched input was not getting
consumed after FOCUS event was received in the receiver. This was fixed
in aosp/1459888.

The consumption mechanism is complex, so I added a doc explaining how it
works, for future readers.

The newly added test, IncompleteMotionTest, ensures that this regression
does not happen again.

Test: atest IncompleteMotionTest
Bug: 160561987
Change-Id: Ic0a453ebbce1f847de8e9cb87bdffdaf72c12637
2020-10-27 17:12:17 +00:00
Nikita Dubrovsky
e160845809 Merge "Add View.onReceiveContent() and View.getOnReceiveContentMimeTypes()" 2020-10-27 16:51:24 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
vadimt
22676d6118 Removing taking unrelated locks from holdLock
Test: running tests with the lock contention stress mode
Bug: 168630376
Change-Id: I5665eb7100d2fcbb93c7ade6cc30b0d8519246bb
2020-10-26 18:44:08 -07:00
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
Nikita Dubrovsky
82a414a184 Add View.onReceiveContent() and View.getOnReceiveContentMimeTypes()
Added View.onReceiveContent() which will invoke the callback if one
is set.

Added View.getOnReceiveContentMimeTypes() to return the MIME types
that the view can receive, removing the getSupportedMimeTypes()
method from the callback interface.

Changed the code to pass MIME types as a String[] instead of a
Set<String> in order to:
* Avoid repeated conversion from Set to array in
onCreateInputConnection.
* Avoid misleading users of the API into using contains() to compare
MIME types (ClipDescription.compareMimeTypes should be used in order to
correctly handle wilcards such as "image/*").

Bug: 170191676
Bug: 152068298
Test: atest CtsViewTestCases:ViewTest
Test: atest CtsViewTestCases:ViewOnReceiveContentTest
Test: atest CtsWidgetTestCases:TextViewOnReceiveContentCallbackTest
Test: atest FrameworksCoreTests:TextViewOnReceiveContentCallbackTest
Test: atest FrameworksCoreTests:AutofillValueTest
Change-Id: Id0c7f8f5fd3c7c44827a62dba1b2b205433e7540
2020-10-26 12:12:01 -07: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
Marin Shalamanov
a6d8306da9 Add mModeSwitchingType to DisplayModeDirector
Add mModeSwitchingType to DisplayModeDirector which describes
the allow mode switching type for SurfaceFlinger. This value
is piped to SurfaceFlinger via allowGroupSwitching in
DesiredDisplayModeSpecs.

The value for mModeSwitchingType defaults to
SWITCHING_TYPE_WITHIN_GROUPS, which is the current beheviour in
SurfaceFlinger and it'll be later updated from user settings.

Bug: 161776333
Test: not yet
Change-Id: I851eaee7f86083d97204cf3553e728350c942dfe
2020-10-26 13:01:00 +01: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
chaviw
b6a288ca36 Screen capture protected content for animations
Allow capturing protected (DRM) content for animations since the content
will only be rendered back into a protected context. The three
animations are ScreenRotation, SurfaceFreezer, and ColorFade.

For each case, use the setAllowProtected when capturing the content.
ScreenRotation and SurfaceFreezer render the content back on screen
using a SurfaceControl. The Layer automatically gets marked as secure
in SurfaceFlinger since the GraphicBuffer queued is marked as protected.

For ColorFade, the content is rendered with a GL context so we need to
recreate the context with the protected value set.

Test: ColorFade, ScreenRotation, FreeForm with DRM and not DRM content
Fixes: 146180867
Change-Id: I1255d3dd439bcf7b8e4cc4d4a2ce1083b70cb9f1
2020-10-23 10:31:33 -07: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