Commit Graph

16365 Commits

Author SHA1 Message Date
Nikita Dubrovsky
2bb75a4007 Merge "Rename getOnReceiveContentMimeTypes (drop "On")" into sc-dev 2021-03-31 21:06:21 +00: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
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
Joanne Chung
d99fcedeb3 Merge "Fix the wrong logic to check if the element in SparseArray" into sc-dev 2021-03-30 01:49:41 +00:00
chaviw
2e605fd668 Add throttling to generateDisplayHash
Calling generateDisplayHash can cause the system to slow down if there
are too many requests. Add throttling logic to prevent apps from calling
the API too frequently. The throttling time is based on a value sent
from ExtServices so it can be adjusted later

Test: DisplayHashManagerTest
Bug: 155825630
Change-Id: Id49d1c4113fc65d7b73a1e7b9fc73f50a8d7041f
2021-03-29 15:54:37 -05:00
Sally
1427156afc Eliminate potential deadlock in AccessibilityCache
The cache calls out with its lock to the app main thread when refreshing
nodes. This opens the door for a deadlock, and causes a slowdown for
non-main threads.

Bug: 180957109
Test: atest CtsAccessibilityServiceTestCases  CtsAccessibilityTestCases
CtsUiAutomationTestCases
FrameworksServicesTests:com.android.server.accessibility
FrameworksCoreTests:com.android.internal.accessibility
FrameworksCoreTests:android.view.accessibility

Change-Id: I27e4e64f778ae1c2a348e16cf8739f7a5596e0fc
2021-03-29 20:43:34 +00:00
Ahaan Ugale
9b2f82c8a6 Add OnDevice to TranslationManager method names.
Makes the API easier to evolve in case we add user-selectable
TranslationServices later, like we do for RecognitionService.

Also makes the create.. name consistent with
SpeechRecognizer#createOnDeviceSpeechRecognizer().

Bug: 176208267
Test: atest CtsTranslationTestCases
Change-Id: I1a66bd045202025b9c5f669018c989654bcaa1ad
2021-03-29 13:10:17 -07:00
Joanne Chung
67b4851291 Fix the wrong logic to check if the element in SparseArray
Bug: 178046780
Test: manual by using a sample app.
Change-Id: Iab7d8a946a32e3be6393e8bdd4d69670d85819f9
2021-03-30 00:46:37 +08:00
Joanne Chung
2e3ea6a2ab Merge "Add translation APIs for virtual views." into sc-dev 2021-03-29 15:28:23 +00:00
Galia Peycheva
ac0a54e91b Fix paragraphs in blur javadocs
Bug: 181149137
Test: m doc-comment-check-docs
Change-Id: I0f2e7cf5f1f5970060dc845b74b9c2e67d7248dd
2021-03-29 17:12:05 +02:00
Kriti Dang
7010f95cb2 Hdr format settings [Backend]
Adding new APIs in display manager to get the user disabled formats, to get the formats
supported by device and get formats reported by display.

Bug: 172905874
Test: N/A
Change-Id: I58a7714f03a3e165bbd22f2fa7a021ad90b41b39
Merged-In: I58a7714f03a3e165bbd22f2fa7a021ad90b41b39
(cherry picked from commit 25f1822005)
2021-03-29 13:21:14 +00:00
Joanne Chung
e1b23cd423 Add translation APIs for virtual views.
Bug: 178046780
Test: manual
Test: atest CtsTranslationTestCases
CTS-Coverage-Bug: 177960696

Change-Id: I99caed0d42b3a164a25c2707eba7057c42c19140
2021-03-29 20:36:40 +08:00
Kriti Dang
e713ee6c60 Merge changes from topic "cherrypick-Display settings HDR formats-mumvl547ah" into sc-dev
* changes:
  Handling Number Format Exception in DiscreteValueIntegerListValidator
  Hdr format settings [Backend]
2021-03-28 12:25:32 +00:00
Nikita Dubrovsky
f3ebaed6e4 Rename getOnReceiveContentMimeTypes (drop "On")
Bug: 179143943
Test: Presubmit
Change-Id: Ib2109f0a45c25ae6c4507a9199bf8b34fc394af5
2021-03-26 10:48:58 -07:00
Joanne Chung
f51da99ac1 Implement dispatchRequestTranslation for getting translation information.
This change doesn't contain the virtual view part and the API, it
will be done in the next change.

Bug: 178046780
Test: manual
Test: atest CtsTranslationTestCases
CTS-Coverage-Bug: 177960696

Change-Id: Idba66a882a90168ecdd93423c0d5d054ab040dad
2021-03-25 22:31:54 -07:00
John Reck
a17f3e5bab Merge "Add me to view/ OWNERS" am: 6b92593081 am: 4e2fbda63d am: a6a1843a92
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652977

Change-Id: I290444ced438951812bfdf07151c793ed7f570bc
2021-03-25 19:46:48 +00:00
Hongwei Wang
de204a5721 Apply the whole auto pip transaction in recents animation
Take the full transaction details passed from Launcher, including
position / windowCrop / scale / roundRadius and apply them in
RecentsAnimationController.TaskAnimationAdapter#onCleanup to make sure
the final state of autoEnterPip transition can be carried over.

Note: there are still several frames off when entering PiP from
landscape with autoEnterPip being enabled.

Bug: 179720719
Test: manually using the ApiDemos app
Change-Id: Ibfff75e09943960cfcd816d6c52a80d7a8af8fe8
2021-03-25 12:07:20 -07:00
John Reck
a6a1843a92 Merge "Add me to view/ OWNERS" am: 6b92593081 am: 4e2fbda63d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652977

Change-Id: Ic8869e13f04f9344ced962d13b18ec0c11a2a443
2021-03-25 19:01:50 +00:00
Nikita Dubrovsky
1dad2faa7f Merge "Update some autofill var names for clarity" into sc-dev 2021-03-25 17:03:27 +00:00
Nikita Dubrovsky
10646dff7e OnReceiveContentListener: Handle IME insertion permissions release
For content insertion from the IME, the platform currently assumes
that it can automatically revoke URI permissions (via
InputContentUriTokenHandler.finalize) any time after the
InputContentInfo instance is garbage collected and
InputContentInfo.releasePermission() has not been called explicitly.
This can cause permissions to be revoked before the receiving code
has had a chance to read the content when using
OnReceiveContentListener, since we did not keep a reference to
InputContentInfo.

This change does the following:
* Sets the InputContentInfo instance in the ContentInfo payload passed
to OnReceiveContentListener.
* Exposes a hidden API on ContentInfo to allow system features to
proactively release permissions for sources that allow this (IME and
drag-and-drop).
* Updates notifications direct-reply code to proactively release
permissions as soon as they are no longer needed.

Bug: 183643556
Test: Manual
Change-Id: I1cbc55d53804810a3cd4b6b97c197f4dd2d7d8e6
2021-03-25 09:37:21 -07:00
Joanne Chung
b6a9530dc1 Merge "Update View translation APIs." into sc-dev 2021-03-25 14:31:40 +00:00
Kriti Dang
b4775b02a7 Hdr format settings [Backend]
Added new APIs to DisplayManager to set the user disabled HDR formats,
and get/set if user disabled formats should be ignored or not.
These new settings are stored in Settings.Global.
Modified the implementation of Display#getHdrCapabilities to not return
the formats disabled by user.

Bug: 172905874
Test: atest CtsDisplayTestCases
Change-Id: I4841af251ee0e4938614b154d0c5239814ea7cd9
Merged-In: I4841af251ee0e4938614b154d0c5239814ea7cd9
2021-03-25 12:41:35 +00:00
Adrian Roos
c33d71d602 Merge "Fix unexpected IME show because of stale requestedVisibleAwaitingControl" into sc-dev 2021-03-25 10:37:09 +00:00
shawnlin
2f2956062d Fixed rounded corner javadoc rendering issue.
Bug: 183190634
Test: 1. make doc-comment-check-docs
      2. unzip doc-comment-check-docs-docs.zip in
         $ANDROID_BUILD_TOP/out/target/common/docs
      3. open RoundedCorner.html in reference/android/view/
Change-Id: Iff8d10db2fd3aaa26035e75c6acb342e5dc07a10
2021-03-25 18:26:02 +08:00
Philip Junker
451405eb17 Merge "Add IntDef for system sound effect constants" into sc-dev 2021-03-25 09:31:09 +00:00
TYM Tsai
8fe0541d85 Merge "Update the content capture text changed event merge logic" into sc-dev 2021-03-25 09:19:16 +00:00
Joanne Chung
a749f2aadb Update View translation APIs.
This change doesn't contain the virtual view part and the API
dispatchTranslationRequests, it will be done in another change.

Bug: 178046780
Test: manual
Test: atest CtsTranslationTestCases
CTS-Coverage-Bug: 177960696

Change-Id: I65fe1db19c9dff21c0caca425fbb7d08559e730b
2021-03-25 15:28:13 +08:00
Tiger Huang
5905279553 Merge "Re-land: Make window stable while resizing" into sc-dev 2021-03-25 06:24:43 +00:00
Feng Cao
c8def0695b Update the content capture text changed event merge logic
* This is only applicable when two consecutive CC events are
  both TYPE_VIEW_TEXT_CHANGED event for the same view
* Before this change: we would merge if both events have
  non-empty text. However, if the user types fast, CC will
  not send the updates for individual word. Moreover, if the
  user adds a word and then delete it fast, CC may not capture
  the word since it'd be merged away.
* After this change, we change the criteria to consider whether
  the current text has a ComposingSpan if it's a Spannable.
  The logic is described in the code comment.

Bug: 181906241
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I08d447f557f7e48ef34c5a6241c497db3ce4c5fc
2021-03-25 13:36:28 +08:00
Evan Rosky
660eb72df8 Merge "Add reporting to monitor apps incorrectly using getRaw" into sc-dev 2021-03-25 02:10:05 +00:00
John Reck
b9682da963 Add me to view/ OWNERS
Test: none
Change-Id: I254a8cc3cdf073f5c4487ebf96fbbfafa8c83134
2021-03-24 20:37:42 -04:00
Nikita Dubrovsky
0cdc945201 Update some autofill var names for clarity
Renamed "componentName" to "clientActivity" and "uid" to "clientUid" to
avoid ambiguity.

Bug: 178978545
Test: Presubmit
Change-Id: I66246168bd71f577b9494e91b3a5df086c491cb1
2021-03-24 13:46:34 -07:00
Marin Shalamanov
511f9145ba setFrameRate: Make shouldBeSeamless an enum
Change the shouldBeSeamless parameter to an enum
in order to make the API easier to understand.

This changes
 - SurfaceControl.setFrameRate
 - Surface.setFrameRate
 - ANativeWindow_setFrameRateWithChangeStrategy
 - ASurfaceTransaction_setFrameRateWithChangeStrategy

Bug: 179116474
Test: atest SetFrameRateTest
Change-Id: I55265399238e2c95fbb90fd33a4c2513d1fc5cec
2021-03-24 21:34:04 +01:00
Evan Rosky
8b82086722 Add reporting to monitor apps incorrectly using getRaw
getRawX/Y are implementation specific and are always display
relative. If any apps are using this, they should stop unless
the app is specifically trying to handle raw events.

Usage of getRaw will break under: multi-window, size-compat,
letterbox, display-areas, and independent window rotation.

Bug: 179274888
Test: adb shell dumpsys platform_compat
Change-Id: I2d87d0a62d7a28e15811dda7f9d16996e8159f69
2021-03-24 12:17:02 -07:00
Rob Carr
f803a76fc9 Merge "SurfaceView: Restore transaction application in useBLAST=false" into sc-dev 2021-03-24 19:04:34 +00:00