Commit Graph

16399 Commits

Author SHA1 Message Date
Nader Jawad
779a8514b7 Merge "Holepunch layers for SurfaceView" into sc-dev 2021-04-07 17:35:45 +00:00
Ady Abraham
db96662e30 Merge "DisplayManagerGlobal: suppress redundant onDisplayChanged events" into sc-dev 2021-04-07 16:45:53 +00:00
Nader Jawad
2dc632aee3 Holepunch layers for SurfaceView
Update RenderNodeDrawable to hole punch areas into
layers created for SurfaceView

Bug: 184297961
Test: Added CTS test to SurfaceViewTests
Change-Id: I1f03a4fe34c5a8b7411ebe728ea3d4195fcd1fac
2021-04-06 22:03:00 -07:00
TreeHugger Robot
7d8ae59fee Merge "Updates magnification button after an accessibility action is performed" into sc-dev 2021-04-07 03:25:32 +00:00
Jacky Kao
4563f9dfb5 Merge "Limitation the text location length of the A11y node" into sc-dev 2021-04-07 02:29:52 +00:00
mincheli
80a35549c8 Updates magnification button after an accessibility action is performed
To switch magnification mode, a user has to click the magnifcation
button UI. However magnification button UI is visible only when
there is an user touch interaction or the magnification shortcut
triggered event.
However some a11y services like switch-access or voice-access
can only interact with magnification UI by performing
accessibility actions. To make magnification button showing and
able to interact with a user, we also trigger updating
magnification button UI when an accessibility action is performed.

Bug: 179442890
Test: atest WindowMagnificationControllerTest;
atest WindowMagnificationTest;atest MagnificationControllerTest;atest WindowMagnificationManagerTest

Change-Id: I8d762096c9cb6a4421d024a7a1af99b3a48a3462
2021-04-07 01:16:24 +00:00
Ady Abraham
6f1cac9912 DisplayManagerGlobal: suppress redundant onDisplayChanged events
With Frame Rate Override enabled, an app could get an onDisplayChanged
events which seems redundant. An example would be:
1. Display changed refresh rate to 60Hz - onDisplayChanged was called
2. App's frame rate override changed to 60Hz - onDisplayChanged was called

To avoid sending these redundant events, DisplayManagerGlobal caches
the last DisplayInfo that was reported to the app and based on it it
decides whether to send the event or not.

Bug: 184588343
Test: atest SetFrameRateTest
Test: atest FrameRateOverrideHostTest
Change-Id: I97c7b2b9a799424998b1b717a4311d3d08b3178f
2021-04-06 15:33:19 -07:00
TreeHugger Robot
7c8aea622c Merge "Don't set mNextDrawUseBlastSync when hardware is not enabled" into sc-dev 2021-04-06 17:05:39 +00:00
TreeHugger Robot
4d2caded83 Merge "Add the IntRange and IntDef annotations for initial text API" into sc-dev 2021-04-06 15:10:46 +00:00
Steven Ng
32a1305cbd onDrawScrollIndicators returns early if the view isn't attached
Test: Install a test app that can reproduce the null pointer
      exception. Flash and install a build with this CL. Null
      pointer exception can no longer be observed.

Bug: 183386115
Change-Id: Iab155dfca20e0119cc401d111ace23e416e93b93
2021-04-06 09:10:23 +00:00
Tiger Huang
7c51474301 Don't set mNextDrawUseBlastSync when hardware is not enabled
Otherwise, it will make the ViewRootImpl pause forever. Because there
won't be any frame-drawing callback where we clear the flag.

Fix: 182797514
Test: steps in the bug
Change-Id: Iadd35f1b112626399c064a1cd7d7da323bb9e36c
2021-04-06 10:54:04 +08:00
Tiger Huang
2664c3863b Refine output of "dumpsys window displays/windows"
- Prints the window title instead of dumping the whole window in
  InsetsSourceProvider.
- Stops printing mFakeControl, because it is the same in each
  InsetsSourceProvider.
- Removes redundant blanks after '='.
- Refines indentation.
- Prints requested visibility while dumping WindowState instead of
  printing the raw mRequestedInsetsState.

Fix: 184237588
Test: check the output of "dumpsys window -a"
Change-Id: I3e0ac2335c29b7f2449b890b4070c62d77ff7f7f
2021-04-05 17:35:57 +08:00
Hongming Jin
06a5b97f6a Merge "Add trace for AccessibilityInteractionClient callback interfaces." into sc-dev 2021-04-02 23:15:18 +00:00
John Reck
24acd37203 Merge "HDR info listener" into sc-dev 2021-04-02 20:21:51 +00:00
Hongming Jin
c49cac7386 Add trace for AccessibilityInteractionClient callback interfaces.
In an effort to reduce unnecessary String operations and Binder calls
from AccessibilityInteractionClient, also add channels to propagate
tracing state to AccessibilityInteractionClient through
AccessibilityManager.

Bug: 157601519
Test: adb shell cmd accessibility start-trace
      adb shell cmd accessibility stop-trace
Change-Id: Idfe220bc64a9c83679201b9a9a36b1c492f9d6cc
2021-04-02 12:15:14 -07:00
Siarhei Vishniakou
d2766d013f Check mInputEventReceiver before sending timeline
Previously, it was possible to receive a FrameMetrics callback after the view was already detached from window. In that situation, the mInputEventReceiver is set to null and the object is disposed.

But InputMetricsListener used to store another reference to mInputEventReceiver. So it's own object was never set to null. We would then try to send the timeline to native input receiver, and crash because the native object has already be deleted by the earlier dispose() call.

So the sequence of events was:

dispatchDetachedFromWindow
mInputEventReceiver.dispose()
native input receiver is deleted
InputMetricsListener::onFrameMetricsAvailable
mInputEventReceiver.reportTimeline
try to access a native object using a null pointer
crash

A few options to fix this were investigated:

1) Unregister the observer when mAttachInfo.mThreadedRenderer is set to null.

This is good to do, but it's not sufficient. The problem is that the native call to RenderProxy 'removeObserver' is not serviced immediately, but is posted to be completed sometime in the future. Therefore, the crash would not be fixed by it.
Still, we should always register the observer for the active threadedRenderer, which is done in this CL.

2) Keep a weak reference to mInputEventReceiver inside InputMetricsListener. This would allow InputMetricsListener to check on the status of mInputEventReceiver. When it's disposed, it would be also set to null, so the weak reference resolution would fail.

Unfortunately, 'mInputEventReceiver' is not the only reference to the object of WindowInputEventReceiver. It turns out that the receiver is also stored inside the queued events (see class QueuedInputEvent { private InputEventReceiver mReceiver }). From reviewing ag/153113, it should be OK to remove the receiver from QueuedInputEvent and simply keep track of whether the event is synthesized or not.
But, that change would be too significant to make in this CL. Also, weak references have performance impact, so this may not be desirable anyways.

3) Do not store mInputEventReceiver in InputMetricsListener
The chosen option is to simply use the variable mInputEventReceiver from the outer class. If the receiver is null, we don't notify about the metrics.

This reverts commit d187cc7627.

Reason for revert: fixing this properly instead

Bug: 184255546
Bug: 169866723
Test: settings -> privacy -> permission manager -> body sensors -> show system (only click once) -> google play services -> deny -> deny anyway
Repeat the above 20 times. Observe that there's no crash of the activity.

Change-Id: I5cf36ef068f7964572ab1a1475ff8ac53ae6beb5
2021-04-02 02:32:06 +00:00
TreeHugger Robot
fb3f0fb6cc Merge "Do not report timeline temporarily" into sc-dev 2021-04-01 19:46:38 +00:00
Rob Carr
194d95b130 Merge "ViewRootImpl remove blur defer transacion" into sc-dev 2021-04-01 17:55:06 +00:00
Siarhei Vishniakou
d187cc7627 Do not report timeline temporarily
While we are working on a proper fix for the issue, let's turn off
timeline reporting to avoid hitting this path.

Bug: 184255546
Test: manual
Change-Id: Ie8b6c6222a0a8d7b8d3fd96f25d5f59b96de2255
2021-04-01 17:13:19 +00:00
Treehugger Robot
274a76464c Merge "Update OWNERS for OnReceiveContentListener and ContentInfo" am: 2990dccc16 am: 736e5ea3a5 am: 838aff1230
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1661118

Change-Id: I23fa0b898d4298509a2d37c7edc6be7ab06e6dc3
2021-04-01 15:49:07 +00:00
Daniel Sandler
ad4a5023ce Merge "Custom haptic composition for assistant launched via button." into sc-dev 2021-04-01 15:41:57 +00:00
Treehugger Robot
838aff1230 Merge "Update OWNERS for OnReceiveContentListener and ContentInfo" am: 2990dccc16 am: 736e5ea3a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1661118

Change-Id: I595fe6c41cd4f1229818d30aa780cc328a97c265
2021-04-01 15:02:29 +00:00
Lan Wei
071d81e623 Add the IntRange and IntDef annotations for initial text API
Add the IntRange and IntDef annotations on the getInitialText{Before,After}Cursor API.

BUG: 184017538
Test: atest FrameworksCoreTests:EditorInfoTest
Test: atest CtsInputMethodTestCases:EditorInfoTest
Change-Id: Ifebeeac6863600363ebcf6c73263874604ea3428
2021-04-01 17:56:42 +08:00
Winson Chung
db41d72646 Merge "Expose the full task info with the remote animation target" into sc-dev 2021-04-01 03:56:55 +00:00
Saho Kobayashi
f80bd0f769 Merge "Correctly handle TargetAccessibilityFocus flag" into sc-dev 2021-04-01 03:36:48 +00:00
Jacky Kao
bd462745f5 Limitation the text location length of the A11y node
This issue caused by the input location length is too large to make
the OOM crash when constructing the rectangle array.

Due to the constructed rectangle array needs to send back to services
through the binder transaction, so limiting the text location length
to avoid the binder transaction failure or the OOM crash.

Bug: 159355942
Test: a11y CTS & unit tests
Change-Id: I3b48b8999967347475b830d94d641b45259152ae
2021-04-01 11:13:47 +08:00
TreeHugger Robot
c5547caafb Merge "Allow to report finsh/pause state if Activity isn't resume." into sc-dev 2021-04-01 02:00:35 +00:00
Robert Carr
a3cbeeae20 ViewRootImpl remove blur defer transacion
Only the BLAST one is active now.

Bug: 168505645
Test: Existing tests pass
Change-Id: I83e26eb0c15733e063b802d79b3e4ecfa702d3ca
2021-03-31 17:28:29 -07:00
Nikita Dubrovsky
2bb75a4007 Merge "Rename getOnReceiveContentMimeTypes (drop "On")" into sc-dev 2021-03-31 21:06:21 +00:00
Nikita Dubrovsky
79ce1a0010 Update OWNERS for OnReceiveContentListener and ContentInfo
Bug: 152068298
Change-Id: I0d70b3493523f61561b4946274af3bed40bacfb3
Test: Presubmit
2021-03-31 18:50:52 +00:00
John Reck
35aa049bc4 HDR info listener
Bug: 182312559
Test: SilkFX listener is called

Change-Id: I2c93f6ab51263a905c17a7afabb845317d33419d
2021-03-31 14:29:03 -04:00
Winson Chung
56dc281990 Expose the full task info with the remote animation target
- Allows launcher to get the associated launch cookies for
  the task

Bug: 129067201
Test: Manual, check the task info for the animation targets

Change-Id: I4b9d974af1732d0ec7b19681f4772b692f614e5e
2021-03-31 09:59:03 -07:00
Galia Peycheva
dd5ed95ebd Merge "Fix paragraphs in blur javadocs" into sc-dev 2021-03-31 14:33:58 +00:00
Marin Shalamanov
d15b4b5473 Merge "setFrameRate: Make shouldBeSeamless an enum" into sc-dev 2021-03-31 14:30:23 +00:00
TreeHugger Robot
b2ee6ea14d Merge "Send input timeline from app to InputDispatcher" into sc-dev 2021-03-31 10:11:49 +00:00
Joanne Chung
72cf07d1cc Merge "Bug fix: allow to create ViewTranslationRequest for virtual AutofillId." into sc-dev 2021-03-31 03:41:39 +00:00
Yohei Yukawa
12e4fde793 Merge "Avoid IME restart for configChanges" into sc-dev 2021-03-31 02:28:22 +00:00
Rob Carr
2b434b28b0 Merge "Expose API for using SurfaceControl with ViewRootImpl" into sc-dev 2021-03-31 01:35:49 +00:00
Sally Yuen
ccaee1da1b Merge "Eliminate potential deadlock in AccessibilityCache" into sc-dev 2021-03-30 22:37:52 +00:00
Taran Singh
71ab752fc5 Avoid IME restart for configChanges
Handle onConfigurationChanged() in order to prevent restarting
InputMethodService everytime. We introduce a new API attribute
"configChanges" in InputMethod(attrs.xml) which when declared
by IME, will be responsible for handling mentioned
configuration changes.

This CL re-introduces [1] with fix: Use new Configuration instance for
IMS#mLastKnownConfig and also handle followup comments.

[1] Ib94fddadb0dae648cf73a4c1642e51edebd19f50

Note: this change has no impact for devices not using DisplayAreas.

Bug: 167948419
Test: atest InputMethodServiceTest
    Manually:
      1. Patch Ie91e7a8e06b80864ef9409031e8543858552d70d to use dual
         display area.
      2. Open applications with editors on both display areas.
      3. Attach a debug point for IMS#onConfigurationChanged().
      4. Make sure IMS#resetStateForNewConfiguration() is not called
         when IME moves between these two identical DisplayAreas
    Also verify that bug 182604598 don't happen.

Change-Id: I43b6b80cdb35410554412ee1d3b0917ee3198272
2021-03-30 20:03:55 +00:00
Hongwei Wang
660008c5c2 Merge "Apply the whole auto pip transaction in recents animation" into sc-dev 2021-03-30 19:26:17 +00:00
Joanne Chung
8c8a14d4df Bug fix: allow to create ViewTranslationRequest for virtual AutofillId.
1. We provide virtual child list to View#onCreateTranslationRequests
but we don't provide a method to allow developers to create
ViewTranslationRequest for virtual AutofillId. Add a builder
constructor to allow developer to use it for virtual AutofillId.
2. Fix some comments in ag/13982294(e1b23cd)

Bug: 177789967
Test: manual on sample app
Test: atest CtsTranslationTestCases

Change-Id: I63e914b888b23cdb7a5169fc6931be93625ca8e4
2021-03-31 01:02:01 +08:00
Ahaan Ugale
43dbb54918 Add a showInInputMethodPicker attr.
An app that provided an IME and is deprecating that functionality may
want to still keep it's IME around temporarily, to prevent breaking
clients that hardcode the component name when switching to the IME.
Such an IME may want to not be presented as an option in the Input
Method picker. They can now set showInInputMethodPicker=false for
this.

Fix: 175480153
Test: manual - Test IME with showInInputMethodPicker=false isn't
 shown in the IME picker.
Test: [new tests]
 atest android.view.inputmethod.cts.InputMethodManagerTest
Test: atest CtsInputMethodTestCases
Change-Id: I18dda0525168f9195606840239507b9daba65be7
2021-03-30 08:37:32 -07:00
Joanne Chung
8aef79f2b5 Allow to report finsh/pause state if Activity isn't resume.
Currently, we only report the ui translation state if the Activity is
resumed. But in the real use case, the developer may call
finishTranslation when the Activity moves to background or lock screen
is shown. We should allow the finish/pause state can be updated for
these cases.

Bug: 183980346
Test: manual. Use sample app, press home and call APIs.
Test: atest CtsTranslationTestCases
Change-Id: I4a5cfab9d272e4d5dc23b2f679b4fbeb4a6c9d20
2021-03-30 22:55:02 +08:00
Nikita Dubrovsky
85826befae Merge "OnReceiveContentListener: Handle IME insertion permissions release" into sc-dev 2021-03-30 14:10:21 +00:00
Chavi Weingarten
c312f0f79a Merge "Add throttling to generateDisplayHash" into sc-dev 2021-03-30 14:10:00 +00:00
Shawn Lin
ab7faf6754 Merge "Fixed rounded corner javadoc rendering issue." into sc-dev 2021-03-30 13:44:58 +00:00
Ahaan Ugale
342ddee557 Merge "Add OnDevice to TranslationManager method names." into sc-dev 2021-03-30 06:13:22 +00:00
Robert Carr
ee90cd4871 Expose API for using SurfaceControl with ViewRootImpl
This API is appropriately called "ViewRoot". So far we just expose
an API surface to reparent SurfaceControl to the ViewRoot (but without
exposing the ViewRoot's SurfaceControl, to encourage developers not
to shoot themselves in the foot) and to synchronize with the drawing
of the ViewRoot SurfaceControl.

Bug: 173463039
Test: ViewRootSyncTests
Change-Id: I8ce0ed4b3efe50cdb3b71ae0f05ce25438d42368
2021-03-30 04:10:05 +00:00
Ming-Shin Lu
a8e90c7cbc Merge "Don't skip IME animation when backed to Task has no editor focus" into sc-dev 2021-03-30 03:10:21 +00:00