Commit Graph

16298 Commits

Author SHA1 Message Date
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
Adrian Roos
07f3583061 Merge "IME Insets: Remove obsolete applyImeVisibility call" into sc-dev 2021-03-22 08:38:04 +00:00
Siarhei Vishniakou
5054a9d009 Notify InputEventAssigner about every frame
InputEventAssigner does not currently get notified about all frames. In
the existing logic, only the cases for batched consumption would be
counted as 'choreographer callback'. This misses several cases, such as:

1) CALLBACK_INPUT was never scheduled, but a frame is produced
2) CALLBACK_INPUT was scheduled, but no events were consumed

However, it is critical that InputEventAssigner knows about all frames,
because it needs to reset the 'down' state for proper frame attribution.

At the same time, we refactor the logic in InputEventAssigner. In the
updated logic, we will specifically store the event id with ACTION_DOWN
only. In all other cases, we will use the current / latest input event.

In this CL, we reset the 'down' state after the input event id is
used for the current frame. A good proxy for that is the
ThreadedRenderer::draw call, which in turns
calls attachInfo.mViewRootImpl.getUpdatedFrameInfo().

Also, rename "onChoreographerCallback" since it's not exactly clear
which callback this is referring to. In the new logic, this callback
will happen from 'draw'/'onDraw' functions.

Bug: 167947340
Test: add LOG_ALWAYS_FATAL crashes in LatencyTracker for duplicate
'reportTimeline' calls. The crashes are gone after this CL.

Change-Id: I5fad6665d10e0594963209b138e9bd2bdf00ca38
2021-03-22 07:59:18 +00:00
wilsonshih
998666c46d Force enable hardware accelerated for starting window
Currently the hardware acclerated was disabled for starting window, we
will need to enable it to fix the reveal animation janky.
With software rendering, each frame would cost 20~30ms on redfin.

Test: atest KeyguardTests KeyguardLockedTests SplashscreenTests
Bug: 182708883
Bug: 173975965
Change-Id: I4df6891e0b24231b7fd3a1d2d630ca2b9eead79f
2021-03-22 14:54:52 +08:00
Tiger Huang
7901e98c45 Animations for visual immersive mode
The CL applies fade-in/fade-out animations for BEHAVIOR_DEFAULT while
changing the system bar visibility.

Fix: 168913586
Test: WindowInsetsTests
Change-Id: I6e9887baf2ba40b51c01bf2239915d381ba891a6
2021-03-22 12:21:48 +08:00
Adam He
2e43f72bf1 Merge "Implement TranslationCallback with support for partial responses." into sc-dev 2021-03-21 09:45:33 +00:00
Nikita Dubrovsky
1b2051e372 Merge "Integrate OnReceiveContentListener in View.onDragEvent" into sc-dev 2021-03-19 23:43:26 +00:00
Adam He
ff092aae1a Implement TranslationCallback with support for partial responses.
Translator#translate() is also updated to be asynchronous with callback
instead.

Bug: 178651352
Test: atest CtsTranslationTestCases
CTS-Coverage-Bug: 178651352
Change-Id: Ibe1f97994fe6ee593a3a3bbb452c075b49a7eb5a
2021-03-19 14:58:47 -07:00
Ady Abraham
97190e25e9 Merge changes from topic "eEarlyWakeup_remove" into sc-dev
* changes:
  rename ExplicitEarlyWakeup -> EarlyWakeup
  Remove ISurfaceComposer::eEarlyWakeup
2021-03-19 17:39:19 +00:00
Adrian Roos
142218b1f9 IME Insets: Remove obsolete applyImeVisibility call
Test: atest InsetsControllerTest ImeInsetsSourceConsumerTest
Bug: 167947407
Change-Id: I8abb210eb20a17f5dfd6d071c57838afb9deb263
2021-03-19 17:12:26 +00:00
Wilson Wu
69a14b8a8e Merge "Introduce InputMethodSessionWrapper for InputMethodManager" into sc-dev 2021-03-19 02:05:02 +00:00
Wilson Wu
17827d754a Introduce InputMethodSessionWrapper for InputMethodManager
To simplify InputMethodManager code logic, have a wrapper
class which encapsulates IPCs from InputMethodManager to
InputMethodService.

Bug: 167948374
Test: atest CtsInputMethodTestCases

Change-Id: Ifb4f86098011fe74cf4159446106d6c15c30fa30
2021-03-19 09:50:42 +08:00
Nikita Dubrovsky
4b7b90e791 Integrate OnReceiveContentListener in View.onDragEvent
OnReceiveContentListener was already integrated with drag-and-drop
in TextView. The change extends support to all subclasses of View.

If an OnReceiveContentListener is set on the view, the default
implementation of View.onDragEvent will now return true for an
ACTION_DRAG_STARTED event and will call
View.performReceiveContent for an ACTION_DROP event.

Bug: 182617122
Test: atest CtsWindowManagerDeviceTestCases:CrossAppDragAndDropTests
Test: atest CtsViewTestCases:ViewOnReceiveContentTest
Test: atest CtsWidgetTestCases:TextViewOnReceiveContentTest
Test: Manually using ReceiveContentDemo
Change-Id: I98fb703220ebd1953b20dcab60d22847cc5000d8
2021-03-18 13:53:49 -07:00
TreeHugger Robot
c95396e1c8 Merge "Add Executor param to TSM#newSpellCheckerSession()." into sc-dev 2021-03-18 19:28:07 +00:00
TreeHugger Robot
df786ca150 Merge "Return an empty list instead of null." into sc-dev 2021-03-18 18:34:16 +00:00
Kohsuke Yatoh
da1e7e569f Return an empty list instead of null.
TextServicesManager#getEnabledSpellCheckerInfos() was introduced in
  commit 4c7423735e
as #getEnabledSpellCheckersList().
Then, the following commit added SuppressLint("NullableCollections"):
  commit d7f33cd648

As this API has been introduced recently in Android S timeframe, I think
it's better to fix the API behavior before it's finalized.

Bug: 180625329
Test: m checkapi
Change-Id: I33d3c86a0c19c0082299e383e50d3860b072e79d
2021-03-18 15:56:33 +00:00
Tiger Huang
1c7a274367 Merge "Let insets can still be controlled if its window bounds is moved" into sc-dev 2021-03-18 15:27:57 +00:00
Shawn Lin
730ab07d11 Merge "[Reland] Add nav bar case to RemoteAnimationTarget of non-app window" into sc-dev 2021-03-18 13:32:36 +00:00
TreeHugger Robot
c49aefef55 Merge changes from topic "aff_inline_tooltip-sc-dev" into sc-dev
* changes:
  Implement inline suggestion tooltip
  Add interface for the inline suggestion tooltip
2021-03-18 04:32:15 +00:00
TYM Tsai
d66c967c71 Implement inline suggestion tooltip
In the InlineSuggestionFactory, it will filter the tooltips by the
field let only the first one can pass to the IME and drop others.
When the IME inflates the inline suggestion, if there is a tooltip of
the suggestion view, inflates the tooltip view at the same time. It
will create the InlineTooltipUi that will be a popup window and
contains the surface view of the tooltip.

Bug: 172024354
Test: atest CtsAutoFillServiceTestCases:InlineTooltipTest
Change-Id: I6f20dcad6d03432017e684964eca52dff2609205
2021-03-18 09:30:45 +08:00
Ady Abraham
0a1bc33851 Remove ISurfaceComposer::eEarlyWakeup
The flag is deprecated.

Bug: 159125966
Test: build
Change-Id: Idc68ac200944a8ba9ce966faa5c9ffb2b5e5a5ea
2021-03-18 01:24:40 +00:00
TYM Tsai
2901b78aaa Add interface for the inline suggestion tooltip
The inline suggestion tooltip is used to show some descriptions for a
specific inline suggestion to let the user easily understand the
suggestion and promo the suggestion. Or educates the user how to
operate the inline strip.

The patch defines some APIs to enable the suggestion provider to
conveniently provide tooltips for the user.

Bug: 172024354
Test: atest CtsAutoFillServiceTestCases:InlineTooltipTest
Change-Id: I5b0fc481b7352da2804f0e4f4633f1698a69109b
2021-03-18 09:12:23 +08:00
TreeHugger Robot
3a9304b2be Merge changes I72acc40f,I0a0ce22f into sc-dev
* changes:
  Fix UiTranslationManager ErrorProne error.
  Revert "Revert "Add UiTranslationStateCallback.""
2021-03-17 22:36:49 +00:00
Ahaan Ugale
50f76874d9 Fix UiTranslationManager ErrorProne error.
"Must store Binder.clearCallingIdentity() token as final variable.."

Restoring identity isn't really needed here, but it's better to have to
be defensive -- in case we do add something later for which the calling
identity needs to be restored.

Bug: 177500482
Bug: 182896753
Test: mmma frameworks/base/ RUN_ERROR_PRONE=true
Change-Id: I72acc40f8776d46b3f875cde1759fe03a25e222b
2021-03-17 07:56:13 +00:00
Ahaan Ugale
93b9882eb8 Revert "Revert "Add UiTranslationStateCallback.""
This reverts commit 7c8010211d.

Reason for revert: Original change broke the build. This is a clean
revert. The next change in the relation chain here fixes the error.

Bug: 177500482
Bug: 182896753
Test: mmma frameworks/base/ RUN_ERROR_PRONE=true
CTS-Coverage-Bug: 182853869
Change-Id: I0a0ce22feb2e54769103f8f4eecbffe425099412
2021-03-17 07:55:59 +00:00
shawnlin
8da5fa2d48 [Reland] Add nav bar case to RemoteAnimationTarget of non-app window
1. Only send navigation bar target when:
   - It is the transition of launching an app
   - In gesture navigation bar mode
   - The navigation bar is not controlled by fixed rotation or recents

2. Add a windowType field to RemoteAnimationTarget so that the remote
   clients could use this to find the non-app window they want.

3. Handle the onAnimationFinish() callback for non-app adapters.

Bug: 139273001
Test: atest RemoteAnimationControllerTest
Change-Id: I0612163502bdda01c4bdbae3b0ecda47efedad51
2021-03-17 10:08:23 +08:00
John Reck
c415157f45 Merge "Extend setBrightness to pass SDR & HDR info" into sc-dev 2021-03-17 02:01:53 +00:00
Rob Carr
e410f1ffd5 Merge "SurfaceView: Remove deferred transaction" into sc-dev 2021-03-16 20:46:32 +00:00
John Reck
62604e4d29 Extend setBrightness to pass SDR & HDR info
Test: builds & boots
Bug: 182312559

Change-Id: Ic8dd38c3a182efb0687c891379db91a36301f05e
2021-03-16 16:23:28 -04:00
Vishnu Nair
947fee291d Remove legacy disable triple buffering config
The config changes the dequeue limit of BQ (setMaxDequeuedBufferCount) from 2 to 1,  decreasing the default size of the queue from (3 to 2).
Some of the motivations behind this change include:
- not applicable in most scenarios since producers in the system override this
- breaks async mode, not well tested in other scenarios
- simplifying some of the implementation and removes a configuration/flag.

Clients can still manually call setMaxDequeuedBufferCount if they wish.

Test: presubmit
Fixes: 182314340
Change-Id: I724218d14ad106a4b7af69f7eacf97fae3c93923
2021-03-16 10:05:52 -07:00
Tiger Huang
7faf533fb3 Let insets can still be controlled if its window bounds is moved
Insets source window can be moved by the display area policy so that
the window would not on the edge of the display. This makes the window
cannot provide insets to the display frame. The default animation uses
the display frame to compute insets, so the moved types cannot be
animated properly.

This CL adds an insets hint to InsetsSourceControl. It is the insets
computed from its owning window bounds. With the insets hint, the insets
animation can be played regardless of the display frame.

This CL also fixes an issue that the insets animation would be played in
the wrong direction by the fixed-rotation window.

Bug: 175775686
Fix: 181939099
Fix: 163018915
Test: atest ImeInsetsSourceConsumerTest InsetsAnimationControlImplTest
            InsetsControllerTest InsetsSourceConsumerTest
            DisplayImeControllerTest
      WindowInsetsTests (manual)
Change-Id: Ic6a8a215bd9b3a3b1af18e425dabe803c9be323e
2021-03-16 23:33:31 +08:00
Ahaan Ugale
65509f464f Merge "Add UiTranslationStateCallback." into sc-dev 2021-03-16 05:44:45 +00:00
Ahaan Ugale
30704c1b85 Add UiTranslationStateCallback.
This is primarily intended for Input Methods, so they can offer
complementary translation experiences to the UI Translation.

But it could also be useful to the applications being translated too, so
it's added to UiTranslationManager.

The states are intentionally different from the ones in the View API -
these are about the UI Translation feature lifecycle, whereas the View
states are about the display states (shown/hidden).

Bug: 177500482
Test: manual - with a sample IME
CTS-Coverage-Bug: 182853869
Change-Id: I8255e18c29a229c8ea3b89098b76124ee8955bdc
2021-03-16 03:28:00 +00:00
Mark Renouf
400a505d4d Splits up internal binder api for scroll capture
Splits the connection callback out from the session
callbacks.

Use ListenableFuture at the ScrollCaptureClient layer
to safely chain together futures, provide a better
exception handling/reporting path, and allow for
cancellation of background tasks.

Bug: 180671218
Test: atest ScrollCaptureClientTest ScrollCaptureConnectionTest
Test: atest ScrollCaptureFrameworkSmokeTest
Change-Id: Ibc8536d12a5554f62b3d7e1f4f717d3589ec45e0
2021-03-16 02:07:53 +00:00
Kohsuke Yatoh
72121457f2 Add Executor param to TSM#newSpellCheckerSession().
SpellCheckerSessionListener callback methods will be called on
the provided executor.

This CL also adds more description for 'bundle' parameter.

Bug: 179804789
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I43f9f04fc335ad45d2580f4711b19aee214bc7dd
2021-03-15 16:20:29 -07:00
Hongwei Wang
f4dfb7c4a3 Settle auto PiP transaction in WindowContainerTransaction
At the end of autoEnterPip transition, followings happen in sequence
- Transition finishes in Launcher side, which operates on the
  animation leash
- RecentsAnimationController.TaskAnimationAdapter#onCleanup has the final
  chance to set the Task leash
- PipTaskOrganizer gets onTaskAppeared callback and commits Task into
  pinned mode

What's been changed here
- Transition in Launcher no longer in charge of settle the final transaction
- RecentsAnimationController.TaskAnimationAdapter#onCleanup sets the
  Task leash to be in sync with the final state in Launcher side
- PipTaskOrganizer commits the final leash transaction together with
  WindowContainerTransaction that enters PiP

Known issue: transition from landscape is not polished

Video: http://rcll/aaaaaabFQoRHlzixHdtY/hT5SXvaCy28P4UtfuoKiDw
Bug: 181342797
Test: see video
Change-Id: Ieabd6991ea5174099714ec22970198bebde1e336
2021-03-15 10:40:13 -07:00
Oli Lan
fe4a8f58fb Merge "Add text classification results to clip description and clip data." into sc-dev 2021-03-15 17:26:35 +00:00
Kholoud Mohamed
e519be1e33 Merge "Expose getInputMethodListAsUser as a testAPI" into sc-dev 2021-03-15 10:25:13 +00:00
Shawn Lin
2632176829 Merge "Fixed RoundedCorner bugs" into sc-dev 2021-03-15 04:26:55 +00:00
Nikita Dubrovsky
00a7febee9 Merge "Update logic for drag-and-drop URI permissions for editable TextViews" into sc-dev 2021-03-15 03:55:42 +00:00
Kohsuke Yatoh
5ed3cb20b3 Merge "InputMethodInfo attr to suppress spell checker." into sc-dev 2021-03-14 20:12:31 +00:00
Galia Peycheva
7eef5e4c7a Merge "Add executor to window blur api" into sc-dev 2021-03-13 23:12:08 +00:00
Kohsuke Yatoh
6b22120e8f InputMethodInfo attr to suppress spell checker.
If InputMethodService declares suppressesSpellChecker="true", the system
SpellCheckerService will be disabled.

With TextView, when IMSs are switched while the user is editing,
SuggestionSpans that were previously added will not be removed even if
the next IMS declares suppressesSpellChecker="true".
This is because we don't know if the SuggestionSpans were from Spell
Checker, App, or IMS.

Bug: 153473490
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: Ia22b8758111087818beea8c07b1c173f1a94b8e4
2021-03-13 10:07:54 -08:00