Commit Graph

16340 Commits

Author SHA1 Message Date
Ahaan Ugale
342ddee557 Merge "Add OnDevice to TranslationManager method names." into sc-dev 2021-03-30 06:13:22 +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
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
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
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
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
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
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
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
Philip Junker
dfcb12b34c Add IntDef for system sound effect constants
Test: m -j86 offline-sdk-docs
Test: atest android.view.cts.SoundEffectConstantsTest
Test: atest android.view.SoundEffectConstantsTest
Bug: 182945031
Change-Id: I8a496144e61e584f633a3950274fbdf0fe146e11
2021-03-24 14:24:55 +01:00
Charles Chen
1e76f995bf Merge "Move WindowContext module to window package" into sc-dev 2021-03-24 07:45:41 +00:00
Charles Chen
c7b8393108 Merge "Fix the sample code in WindowMetrics javaDoc" into sc-dev 2021-03-24 07:38:54 +00:00
Charles Chen
e62af88758 Fix the sample code in WindowMetrics javaDoc
WindowInsets#getInsetsIgnoringVisibility was wrongly written as
WindowInsets#getInsetsIgnoreVisibility

fixes: 183372217
Test: build & run
Change-Id: Ied3c73fe6bd51993b0ac8fe3befe919daedb35ad
2021-03-24 06:36:30 +00:00
Joanne Chung
afe90e57e2 Merge "Safe delete the deprecated APIs." into sc-dev 2021-03-24 06:32:35 +00:00
TreeHugger Robot
25546c3867 Merge "Allow extending the SurfacePackage lifetime" into sc-dev 2021-03-24 04:54:02 +00:00
Charles Chen
f48ece4875 Move WindowContext module to window package
In this way, we can clarify the owners and it is easier to maintain.
Also refactor to move WindowContext creation logic to ContextImpl.

Test: atest WindowContext WindowContextTests WindowContextPolicyTests
Bug: 159767464
Bug: 152193787

Change-Id: I78432aa18aa97e001f5a9a04321109e456fd137b
2021-03-24 11:26:50 +08:00
TreeHugger Robot
16f767310a Merge "Rethrow RemoteException from IInputMethodManager#startInputOrWindowGainedFocus()" into sc-dev 2021-03-23 20:49:38 +00:00
Tiger Huang
a7e33a41e5 Re-land: Make window stable while resizing
When the frame size and the frame position of the window are changed at
the same time, setPosition to the surface will be applied first, and
the client will draw on the new-size buffer later, which makes the
window flicker.

This CL uses applyWithNextDraw to make the new surface position can be
applied while the new frame is drawn. applyWithNextDraw is applied only
when
- the window doesn't have a move animation. So if a window needs to make
  resizing stable, it may need PRIVATE_FLAG_NO_MOVE_ANIMATION.
- it is visible, e.g., the surface is shown, and the window is OK to
  display -- for better performance.

If applyWithNextDraw is used while the window frame is changed to an
empty rectangle, e.g., Rect(10, 10 - 1000, 10), mNextDrawUseBlastSync
will stay true forever, because we don't draw while the dirty area is
empty, and ViewRootImpl would lose the only chance to clear the flag.
performTraversals will never be executed.

This CL makes mNextDrawUseBlastSync can be cleared in that case.

Bug: 182729646
Fix: 176874720
Test: steps in the bug
Change-Id: I81b0574ee8db7e4d9053639f56e04858d9feae90
2021-03-24 04:19:48 +08:00
Robert Carr
ad17626e0e SurfaceView: Restore transaction application in useBLAST=false
We may still have useBLAST=false when we are detached from
the ViewRoot, the recent CL to remove defer transaction
code mistakenly removed this code.

Bug: 183427823
Test: Existing tests pass
Change-Id: I7ef68ca9da053fd9b488a6da6101572ec05ab9a3
2021-03-23 12:52:39 -07:00
Vishnu Nair
39534b9445 Allow extending the SurfacePackage lifetime
Caller may need to keep the SurfacePackage alive after attaching it
to a SurfaceView. We allow this by creating a copy of the
SurfaceControl inside the SurfacePackage. Since the native layer
handle is ref counted, this will keep the encapsulated Surface hierarchy
alive after it has been released by SurfaceView.

Bug: 182838860
Test: atest SurfaceControlViewHostTests
Change-Id: I49e228b561d7aca23691d683747edc5365fc4206
2021-03-23 10:42:15 -07:00
Yohei Yukawa
71aca864c2 Rethrow RemoteException from IInputMethodManager#startInputOrWindowGainedFocus()
This is a relatively safe code clean up as a follow up of our recent
CL [1], which introduced InputMethodSessionWrapper for better
readability and maintainability.

Before that CL, it wasn't obvious that our try/catch block in

  InputMethodMnager#startInputInner()

was actually taking care of not only RemoteException from

  IInputMethodSession#displayCompletions()

but also from RemoteException from

  IInputMethodManager#startInputOrWindowGainedFocus()

Now that the former is taken care inside InputMethodSessionWrapper,
this CL tries to further simplify and clean up it.

One potential behavior change is that with this CL the calling app
starts crashing when Binder driver throws RemoteException while
calling one-way Binder IPC

  IInputMethodManager#startInputOrWindowGainedFocus()

Note that Completable.getResult(value) has already been rethrowing an
Exception when InputMethodManagerService explicitly throws an
exception since we rewrote the logic with our hand-written Completable
[2], which is indeed more likely to happpen.  Thus hopefully having
the same behavior for errors from Binder driver would be acceptable
and make it easier for us to detect something unexpected is happening.

Other than that, there should be no observable behavior change.

 [1]: Ifb4f86098011fe74cf4159446106d6c15c30fa30
      17827d754a
 [2]: If4b40244a2e0e3b11c38c1da9340ba8e5166ad64
      b9590fa1e1

Bug: 167948374
Test: atest CtsInputMethodTestCases
Test: atest CtsInputMethodTestCases --instant
Change-Id: I2cc879ba4a02cc9cf0f97c8380fe33c358e3d120
2021-03-23 09:57:45 -07:00
Joanne Chung
dd0224162c Add API to get the PendingIntent for translation settings Activity
Bug: 176208267

Test: manual test with sample app
Test: atest CtsTranslationTestCases

Change-Id: I00416cf9cb63d522b9d8a448be3533b89b753aa0
2021-03-23 23:51:46 +08:00
Joanne Chung
bab1efaded Safe delete the deprecated APIs.
Keep the implementation and Add @Deprecated and @remove for the
deprecated APIs. Use this way can make sure the client doesn't
crash if not updated but when app recompiles would be forced to move
to the new APIs.

Bug: 177789967
Test: Use the app that uses old APIs doesn't crash. When app would
like to recompile cannot see the old APIs.

Change-Id: I700470eaca2df030e50de964be5be2173c89259f
2021-03-23 13:03:19 +00:00
Adam He
476e44e1f9 Merge "Add API for TranslationContext" into sc-dev 2021-03-23 05:12:29 +00:00
Wei Sheng Shih
964eafdccc Merge changes Id0cf1b23,I4df6891e,I759de2e1 into sc-dev
* changes:
  Add trace for tracking the performance of new starting window
  Force enable hardware accelerated for starting window
  Pre-draw AdaptiveIconDrawable and cache it before doFrame
2021-03-23 03:15:07 +00:00
Jeff DeCew
2a12cfadb4 Merge "New MediaStyle template:" into sc-dev 2021-03-23 02:14:06 +00:00
TreeHugger Robot
ad97628537 Merge "Update the fallback logic in BaseInputConnection#getSurroundingText()" into sc-dev 2021-03-23 01:42:32 +00:00
TreeHugger Robot
e289502447 Merge "Remove legacy disable triple buffering config" into sc-dev 2021-03-22 19:39:44 +00:00
Adam He
7c3a6e37a2 Add API for TranslationContext
* TranslationContext holds source/dest specs, replacing spec pairs in
methods.
* TranslationCapability holds information on the translation models, as well
as a helper method to generate a TranslationContext for creating
translators.
* TCapability is meant to hold information about the translation models, and
provide information/flag on what the translator can support, versus the
TContext which will indicate exactly which supported flags should be
used and activated by the models.
* Added TM.getTranslationCapabilities, and add/remove TCapabilityUpdateListener

Bug: 176208267
Test: atest CtsTranslationTestCases
Change-Id: I2ab7a3eadcbbc9e13f8f33bf9c51cda69f30fdb7
2021-03-22 11:38:50 -07:00
Siarhei Vishniakou
e1c0d2a844 Merge "Notify InputEventAssigner about every frame" into sc-dev 2021-03-22 17:58:12 +00:00
Jeff DeCew
ff165814e1 New MediaStyle template:
* Remove all media-specific color extraction and colorization logic
* Remove all 'large icon' gradienting logic
* Simplify base (headerless) style to use a LinearLayout instead of tweaking margins
* Make compact media layout a tweak of the base (headerless) layout
* Make big_media layout a tweak of the big_base layout
* Fix an unnecessary swooping animation that happened on expand
* Ensure RTL layout also works

Fixes: 172652345
Test: manual testing w/ updated notify2
Change-Id: I11c1494c0ac32aaf3e9d2010560cc8f1d8c50037
2021-03-22 11:13:08 -04:00
Ming-Shin Lu
5a810c8403 Don't skip IME animation when backed to Task has no editor focus
When the dialer app previously shows IME, if the user swipe out the
dialer task to launcher or switching task and then navigating back
to dialer task, will see IME surface will fade-out because the
editor view has been cleared the focus.

The issue happens when user taping editText to show keyboard and
the IME show animaion will be skipped.

It could be related the CL[1] that we skip the animation once
when the task snapshot has the IME surface, but we should not
skip IME show animation if the launching task has been cleared
the editor focus.

[1]: I83ffc03119e01da71ad12f8ad8043cf0730dfd50

Fix: 183347520
Bug: 166736352
Test: manual as steps in commit message
Test: atest ImeInsetsSourceConsumerTest#\
      testImeGetAndClearSkipAnimationOnce_expectNoSkip
Change-Id: Ib140801f1ce03b5566e756914f96dacba3ad8892
2021-03-22 18:52:21 +08:00
Adrian Roos
07f3583061 Merge "IME Insets: Remove obsolete applyImeVisibility call" into sc-dev 2021-03-22 08:38:04 +00:00