Commit Graph

16731 Commits

Author SHA1 Message Date
Joanne Chung
8b95d38fa4 Merge "Bug fix: Move the implementation out from View.onTranslationResponse." into sc-dev 2021-06-24 02:08:40 +00:00
Lucas Dupin
26308cd40f Merge "Disable blurs when in battery saver" into sc-dev 2021-06-23 18:40:42 +00:00
Ahaan Ugale
5d42257561 Merge changes from topics "cc-composing-update", "cc-merge-equals" into sc-dev
* changes:
  ContentCapture: Don't ignore events with changed composing/selection span
  ContentCapture: Notify when Composing region changes.
2021-06-23 05:05:19 +00:00
Lucas Dupin
b5a1455663 Disable blurs when in battery saver
Test: manual
Test: atest NotificationShadeDepthControllerTest
Fixes: 191814337
Change-Id: If751578550b3397d659d3f9f97f6ee4573389a6c
2021-06-22 16:45:35 -07:00
Matt Casey
184c61395e Merge "Fix mPositionInWindow to not use global coords" into sc-dev 2021-06-22 12:44:33 +00:00
Adrian Roos
e53e6f5c10 Merge "Insets Animations: Always dispatch onEnd when cancelled" into sc-dev 2021-06-22 10:29:08 +00:00
Arthur Hung
4c74c4e33f Merge "Update transform hint from relayout window (1/2)" into sc-dev 2021-06-22 03:27:26 +00:00
TreeHugger Robot
e4724a8e8f Merge "Added a hidden modelState to indicate model was deleted from device but available still." into sc-dev 2021-06-21 23:19:26 +00:00
Adam He
8b25ff8c9f Added a hidden modelState to indicate model was deleted from device but available
still.

Bug: 191518728
Test: atest CtsTranslationTestCases
Change-Id: I16ee0c2514052f9a8d6589646098c043d67a6703
2021-06-21 13:25:20 -07:00
Adrian Roos
29721a1319 Insets Animations: Always dispatch onEnd when cancelled
Previously, we only dispatched onEnd if onStart was already dispatched. However,
some animations might get cancelled after onPrepare but before onStart. In that
case, it is rather tricky for apps to actually cancel the animation.

Now we always dispatch onEnd if onPrepare has been dispatched already.

Fixes: 177983907
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I3fa142110bd5593679f87561c138ed3318034fca
2021-06-21 21:34:51 +02:00
Ahaan Ugale
01315b1089 ContentCapture: Don't ignore events with changed composing/selection span
Currently, if the view has a TEXT_CHANGED event in the buffer with the
same text, the new event is ignored, even if the Composing or Selection
span is changed.

Bug: 184311217
Test: manual - move cursor quickly and check flushed event
Test: atest android.contentcaptureservice.cts.LoginActivityTest
Change-Id: I4de28576b138225f4e64ed93bcb0b9dd3ed0095c
2021-06-21 14:51:57 +00:00
TreeHugger Robot
6ea5a55ac5 Merge "Fix potential null error in clearEvents." into sc-dev 2021-06-21 02:31:00 +00:00
TreeHugger Robot
dc86e26f54 Merge "Removing remaining references of ActivityView in fw/base" into sc-dev 2021-06-19 01:23:12 +00:00
Adam He
e33b1bf4e9 Fix potential null error in clearEvents.
* This is follow up from previous patch to fix an unresolved
comment.

* We're still changing the clearEvents mechanic to not null the list but
actually clear the list of events. We also change when the
flush->clearEvents call happen during the destroy process so it occurs
on the handlerThread when each session does its own cleanup.

Bug: 185162720
Test: atest CtsContentCaptureServiceTestCases
Change-Id: Ide5490903deec8c4bc8aae5dc76b1fadca29dbd0
2021-06-18 14:38:55 -07:00
Matt Casey
03e826d6b1 Fix mPositionInWindow to not use global coords
Got the wrong number when the window isn't at 0,0.

Bug: 183045126
Test: Examined logs to observe the window's insets didn't affect
      position in window.
Change-Id: Id3190a7422a56cbefc64d30a9961674b4822fcc3
2021-06-18 14:16:18 -04:00
Huihong Luo
34f42fdecd Fix z-order for webview surface control
Set the root surface control transparent, and set the z order of the newly created child surface control to -1.
A new callback is needed to update root surface control in sync from Java side.

Bug: 186750329
Test: use latest APKs from Webview team, play a video, mini toolbar should be visible
Change-Id: I0b37ee8f83fd2b41ff4f2856dbadd31ff6170baf
2021-06-18 10:14:22 -07:00
Joanne Chung
a9da1722cc Bug fix: Move the implementation out from View.onTranslationResponse.
Keep onTranslationResponse() only to save TranslationResponse. We can
move set TransformationMethod logic to TextViewTranslationCallback.
With the current implementation, if the developers overrides
onTranslationResponse(), they don't have a chance to use the TextView
default ViewTranslationCallback implementation because they don't set
the TranslationTransformation, they must implement their solution. If
we move logic to TextViewViewTranslationCallback and the developers
only overrides onTranslationResponse(), they still have a chance to
use the default TextViewViewTranslationCallback if the developers set
the TranslationResponse for View.

Bug: 178353965
Test: manual to make sure translation still works.
Test: atest CtsTranslationTestCases

Change-Id: Iada7f3efbbc7705ecf962c78e275ed942816707f
2021-06-17 22:12:27 +08:00
Arthur Hung
8e0fedbdb1 Update transform hint from relayout window (1/2)
The transform hint is used to prevent allocating a buffer of a different
size when a window is rotated. We return the fixed rotation transform
and pass it to BLASTBufferQueue so the producer can choose to consume
the hint and allocate the buffer with the same size.

Bug: 188893403
Bug: 177029197
Test: atest WmTests
Test: gfxbenchmark
Test: atest libsurfaceflinger_unittest SurfaceFlinger_test
Change-Id: If631984cf6b4b74ccdf19547fd6a63e759ed5732
2021-06-17 12:21:45 +00:00
Ahaan Ugale
fb12492de7 ContentCapture: Notify when Composing region changes.
Sending the notification from the InputConnection layer reduces the
number of events that are handled (merged) by ContentCapture. We are
also able to handle composing span being removed; at the TextView layer,
we cannot do that as we don't know if the composing span will be added
back, which happens on typing).

Bug: 184311217
Test: manual - append chars, delete chars, replace text, move cursor to
 composing text, move cursor to remove composing span, drag cursor
Test: atest android.contentcaptureservice.cts.LoginActivityTest
Change-Id: I0e9d153cf7ba2734f38cb1b6044eb7b670fb34ad
2021-06-16 10:47:59 -07:00
TreeHugger Robot
8f74aa34ee Merge "ContentCaptureEvent: Log composing and selection indices" into sc-dev 2021-06-16 08:46:41 +00:00
TreeHugger Robot
949b4d2940 Merge "ContentCapture: DEBUG flag to log raw text" into sc-dev 2021-06-16 06:32:35 +00:00
Ahaan Ugale
d224da0ed4 ContentCaptureEvent: Log composing and selection indices
Bug: 184311217
Test: manual
Change-Id: I808021473fe55bf2f0676c005bc0c077146a6785
2021-06-15 22:21:26 -07:00
Siarhei Vishniakou
5d552869af Merge "Remove FLAG_INPUTFILTER_TRUSTED in MotionEventInjector" into sc-dev 2021-06-15 21:50:35 +00:00
TreeHugger Robot
cac7ab9c5c Merge "Make inline suggestions tooltip is not magnified" into sc-dev 2021-06-15 21:22:09 +00:00
Antonio Kantek
ec6b2bbd6e Removing remaining references of ActivityView in fw/base
Bug: 179161778
Bug: 191165536
Test: atest CarServiceTest
Change-Id: Ic45091d565e1654c9177183f065e605b0ab0b56d
2021-06-15 11:23:12 -07:00
TYM Tsai
b8fe7ce3bb Make some NoCopySpans can pass to ContentCaptureService
The selection and composing spans are not parcelable. This patch makes
Content Capture can pass those metadata to the service.

Bug: 184311217
Test: atest CtsContentCaptureServiceTestCases
Test: atest FrameworksCoreTests:ContentCaptureEventTest
Change-Id: I455ee61998bfb19476f84c69b1a671113b6b6a98
2021-06-16 01:22:39 +08:00
Ahaan Ugale
0f163f5557 ContentCapture: DEBUG flag to log raw text
Bug: 184311217
Test: manual
Change-Id: I9a60bcf95574583c14f5962a3dde603abea85498
2021-06-15 09:05:16 -07:00
Huihong Luo
eee7cc8764 Merge "Fix NullPointerException on ThreadedRenderer" into sc-dev 2021-06-14 16:48:31 +00:00
TreeHugger Robot
2828678bd4 Merge "Clear the ViewTranslationResponse on finishing UiTranslation." into sc-dev 2021-06-14 01:12:59 +00:00
Huihong Luo
1c3d52c130 Fix NullPointerException on ThreadedRenderer
The variable, mAttachInfo.mThreadedRenderer, might be null.

Bug: 188614814
Test: run x86_64 cts test: CtsInputMethodTestCases
Change-Id: I5c441d8948dd357992ad5ef94d03deff547baa37
2021-06-11 11:20:32 -07:00
John Reck
760051854e Improve picture capture debug path
* Fixes hardware bitmap capture
* Fixes mutable bitmap capture (no flickering)
* Adds basic single-frame LRU cache to avoid
  repeated readbacks of GPU resources
* Does up-front readback of GPU resources
* Moves serialization off RenderThread again thanks
  to up-front readback avoiding needing GPU access
  off-thread
* Reduces RAM usage & improves performance by serializing
  directly to output stream instead of first copying to
  a byte[]

Bug: 174223722
Test: PictureCaptureDemo mirrors the content
Change-Id: If7ec208b61d5b917e82087cc312880fc5a38c943
2021-06-11 01:52:14 +00:00
Tiger Huang
50ae7cbf1b Merge "Defer dispatching insets to app if its window frame will be changed soon" into sc-dev 2021-06-10 07:55:53 +00:00
Ahaan Ugale
f922300a2d Clear the ViewTranslationResponse on finishing UiTranslation.
Stored state should be cleared here.

This fixes a bug where the views cannot be re-translated after
UiTranslationManager#finishTranslation was called. Some of the state was
cleared, so the translations cannot be re-shown. And that state cannot
be recreated because we find the same ViewTranslationResponse stored and
do not recreate the other state.

Fix: 189892928
Test: manual - translate an app, go to the home screen (triggers
 finish), go back to the app and re-translate
Test: atest CtsTranslationTestCases
Change-Id: Ic81fbce7ee09eb72352071c8bdd94a2731826009
2021-06-09 13:53:38 -07:00
TreeHugger Robot
789fe38968 Merge "Remove tracing for notifyContentCapture" into sc-dev 2021-06-09 19:14:05 +00:00
TYM Tsai
0a496a2aa0 Make inline suggestions tooltip is not magnified
Because the tooltip is part of suggestions on keyboard, it should be the
same as keyboard that is not magnified by the accessibility magnifier
when the magnifier is full screen mode.

Bug: 183462449
Test: Manual
Test: atest CtsAutoFillServiceTestCases
Change-Id: I3cfd84357b556a85c2788776d3966cf94d4a981d
2021-06-10 02:16:19 +08:00
TreeHugger Robot
3009984d65 Merge "Make ContentCapture event contains parcelable span" into sc-dev 2021-06-09 16:48:55 +00:00
Mark Renouf
886b1a3d7c ScrollCaptureTarget: enforce argument nullability in ctor
Bug: 180419562
Test: atest ScrollCaptureTargetTest
Change-Id: I390269c8cfc0ce57c5cf9b58ad0cbf75a0281b00
2021-06-09 16:48:26 +00:00
TYM Tsai
b8fc743699 Make ContentCapture event contains parcelable span
The spans were removed by ag/13819626. Adds them back into the
ContentCaptureEvent. And removes unnecessary Map data because we
can get it via travel events. The total of events is not large.

Bug: 190035037
Bug: 184311217
Test: atest CtsContentCaptureServiceTestCases
Test: atest FrameworksCoreTests:ContentCaptureEventTest
Change-Id: I5fa1f7a6b51fd050a63731543cca98972c294b22
2021-06-09 16:48:23 +00:00
Tiger Huang
7be2a4c964 Defer dispatching insets to app if its window frame will be changed soon
If the frames of insets source window and the frame of an app window
are changed in the same layout pass, we should dispatch the insets
calculated from the new insets source frames and the new app window
frame. So when the app frame is not up-to-date, we defer dispatching
insets to the app.

Fix: 160732586
Test: Add logs to check if we dispatch the correct insets to apps while
      rotating the display.
Change-Id: Ic9e71d8eabde51067b740b35404ae7c9b68228d7
2021-06-09 15:52:39 +08:00
Shawn Lin
ecb653c2bb Merge "Add a method in RecentsAnimationController to animate the nav bar" into sc-dev 2021-06-09 01:39:49 +00:00
Philip Cuadra
ef671105e1 Remove tracing for notifyContentCapture
These traces get expensive in aggregate due to an increased number of
notifyContentCapture events.  Remove them.

Bug 188836620
Test:  Confirmed no notifyContentCapture trace points in systrace

Change-Id: I5d77bd9048b2e8cd267187f866dc095792a3f455
2021-06-08 13:34:21 -07:00
shawnlin
7d77609543 Add a method in RecentsAnimationController to animate the nav bar
There is no transition for app launch from recent in live tile so we
have to add a method for Launcher to trigger the nav bar animation for
this case.

Bug: 189278432
Test: manual - launch app from recent in live tile mode

Change-Id: Ia63964491449e6f634350cbc8599cdec42d76d06
2021-06-08 21:44:12 +08:00
Joanne Chung
1e5e988de4 Merge "Dump the last Activity information when dumpsys translation" into sc-dev 2021-06-08 13:11:29 +00:00
Joanne Chung
94b6e6515c Dump the last Activity information when dumpsys translation
When bugreport dumps Activity information, it will dump translation
related information. But it adds -v parameter, the bugreport will
only dump visible task's top Activity. If message apps go to the
background, we cannot find our expected information. We try to let
translation dumpsys to dump the last Activity information if the
Activity isn't destroyed yet, e.g. go to background.

Bug: 187889345
Test: open chat app and back home then dumpsys translation. Let
Activity destroyed and make sure no Activity dump.

Change-Id: Ie5b935696a74ca3f298c5e6e5994fa659389e198
2021-06-08 12:17:27 +08:00
Lucas Dupin
0e92d34215 Merge "Deal with blur sysprop as a boolean" into sc-dev 2021-06-07 23:51:32 +00:00
Sally Yuen
00d32f2d61 Merge "Add AccessibilityManager#removeClient" into sc-dev 2021-06-04 22:33:10 +00:00
Siarhei Vishniakou
1214444260 Remove FLAG_INPUTFILTER_TRUSTED in MotionEventInjector
All input events coming into inputfilter from
InputDispatcher will now have FLAG_INPUTFILTER_TRUSTED set by default.
It is now up to the inputfilter (a11y) to remove this flag when appropriate.
One such case is where an unknown a11y service is injecting the events.

From auditing the a11y code, the only such place is MotionEventInjector.

Therefore, label all events coming out of MotionEventInjector as
"untrusted" by removing this new flag INPUTFILTER_TRUSTED.

Separately, a11y should be distinguishable from regularly injected input
events. To tell apart the events injected by a11y, add a new flag,
FLAG_INJECTED_FROM_ACCESSIBILITY. This flag requests InputDispatcher to
apply the device id = -2 for the injected events.

Test: atest CtsInputTestCases:android.input.cts.GamepadWithAccessibilityTest
Test: atest MotionEventInjectorTest
Bug: 175069843
Change-Id: I12d4a7bd6fbab8af202f5ae88b6be97ff9e1754c
2021-06-04 21:15:43 +00:00
Sally
4a41eca71b Add AccessibilityManager#removeClient
Whenever an app makes a Text toast, this gets routed through systemUI
starting from R. Two A11yManagerClients are registered with
A11yManagerService for every toast. Since clients aren't removed until
the process is killed, there are a bunch of clients from systemui
hanging around and potentially cause the system to crash.

We add a way here to explicitly unregister a client

Test: build and flash,
atest android.view.accessibility.AccessibilityManagerTest
Bug: 189010828

Change-Id: I3f71bac475b4539c7be5b328adeb0be35a0b5543
2021-06-04 20:28:26 +00:00
Lucas Dupin
315faf1258 Deal with blur sysprop as a boolean
Bug: 185580298
Test: manual
Change-Id: I828a582d4a63c32172d4954ea4b8d070ec1441c7
2021-06-03 19:35:31 -07:00
Antonio Kantek
1de80b1d70 Merge "Deleting DisplayContent#reparentDisplayContent and related code" into sc-dev 2021-06-02 23:23:41 +00:00