Commit Graph

16565 Commits

Author SHA1 Message Date
TreeHugger Robot
ed17f3e2c7 Merge "Change clearEvents() to clear existing events rather than setting mEvents to null to remove possible NPE." into sc-dev 2021-04-30 00:29:02 +00:00
Taran Singh
2fef6def9a Merge "Add log for showSoftInput called from Insets API" into sc-dev 2021-04-29 22:41:26 +00:00
Adam He
1acd0739fa Change clearEvents() to clear existing events rather than setting
mEvents to null to remove possible NPE.

* clearEvents() needs to be called by destroy() which could cause race
condition on whether mEvents is null for other func calls.

Fixes: 185162720
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I7330e651bc890c8a86822158efcf17a61e927112
2021-04-29 13:56:58 -07:00
TreeHugger Robot
9936b8cbf1 Merge "Expose test APIs on ContentInfo and add CTS coverage" into sc-dev 2021-04-29 19:36:11 +00:00
TreeHugger Robot
d708154ede Merge "Rename Battery to BatteryState." into sc-dev 2021-04-29 16:30:16 +00:00
TreeHugger Robot
00ea5427b6 Merge "Fix pass null TranslationCapability to dispatchRequestTranslation()" into sc-dev 2021-04-29 10:29:56 +00:00
Joanne Chung
be4bdf0a11 Fix pass null TranslationCapability to dispatchRequestTranslation()
We only provide text-text capability now and when the UiTranslation
APIs are called, the model files should be ready. To simplify the call
flow, we hardcode the TranslationCapability now. If more capabilities
are supported, we will call the API to get the TranslationCapability.

Bug: 183589662
Test: atest CtsTranslationTestCases

Change-Id: Iea1baac7988402298b2577d03adf9d889f45ad53
2021-04-29 15:08:58 +08:00
TreeHugger Robot
f38abb5943 Merge "Add traces in ViewRootImpl handler" into sc-dev 2021-04-29 04:49:10 +00:00
Chris Ye
c9b9464ad8 Rename Battery to BatteryState.
Rename Battery to BatteryState, and rename the method hasBattery to
isPresent.
Return NaN in getCapacity() if capacity can not be read.

Bug: 180733860
Test: atest android.hardware.input.cts.tests

Change-Id: I8e855be0b263479c2744b817df5f591c9d1e4a64
2021-04-28 16:08:39 -07:00
Nikita Dubrovsky
b3a2e3f34c Expose test APIs on ContentInfo and add CTS coverage
Bug: 183643556
Test: atest CtsViewReceiveContentTestCases:ContentInfoTest
Change-Id: I65e8fbab27433584590366292ed79d230c1b95e5
2021-04-28 11:55:49 -07:00
Taran Singh
11472f70b4 Add log for showSoftInput called from Insets API
Add a debug log to identify calls to showSoftInput from Insets API.

Fix: 1865976
Test: manually using steps:
      1. Use an app like launcher that uses Insets API to show IME.
      2. dump using adb shell dumpsys input_method
      3. Verify log.
      4. use another app that shows IME using showSoftInput like gmail
      5. verify the log

Change-Id: I6ba0d3f7912855f31e033735557b44eeed3e6652
2021-04-28 18:30:25 +00:00
Jagadeesh Pakaravoor
525caa44ce Add traces in ViewRootImpl handler
Add traces to show what messages are currently being handled inside
ViewRootImpl's handler.

bug: 184951839
Test: presubmit
Change-Id: I00c04250b3ea00fb32473d9fa35390510e8692c5
2021-04-28 09:39:19 -07:00
Yohei Yukawa
1d14a33860 Merge "Make IInputMethodPrivilegedOperations to async (4/N)" into sc-dev 2021-04-28 15:45:58 +00:00
Wilson Wu
78a23141be Make IInputMethodPrivilegedOperations to async (4/N)
-. Remove VoidResultCallback of updateStatusIcon
   and let it be truly asynchronous.
-. Rename this method to updateStatusIconAsync.

Bug: 183587528
Test: atest CtsInputMethodTestCases
Change-Id: Ic7759354ec06a3293ea370ab7afe7422eb2d9356
2021-04-28 12:56:38 +08:00
TreeHugger Robot
2d41f53291 Merge "Changed createOnDeviceTranslator to be asynchronous with callback." into sc-dev 2021-04-27 21:40:44 +00:00
Adam He
50a637b1e5 Changed createOnDeviceTranslator to be asynchronous with callback.
Bug: 176208267
Test: atest CtsTranslationTestCases
Change-Id: Icedc953611e70dc208cbef54b4e459ebb0ccd5a9
2021-04-27 11:56:30 -07:00
TreeHugger Robot
89126b252c Merge "Add debug log for showSoftInput" into sc-dev 2021-04-27 18:02:04 +00:00
Marin Shalamanov
deb3ccf048 Merge "Update javadoc for setFrameRate" into sc-dev 2021-04-27 15:56:08 +00:00
Ming-Shin Lu
b7e4b7c279 Add debug log for showSoftInput
As CL[1] added the reason field in showSoftInput to expose where the
show request comes from.

Refine the original showSoftInput debug log from CL[2] to add the
reason for helping the issue clarification.

[1]: I390dc029e7bcc30c200926a9bfbbbd0268a1f714
[2]: I67a790f9d98d6131aaf04e4bb98d2a28873d3424

Bug: 182071625
Bug: 171827834
Test: adb logcat -s InputMethodManager:D
Change-Id: I73ab4e2b856669b6b6922ee451da1819e5ca18f4
2021-04-27 23:22:54 +08:00
Marin Shalamanov
c48e5da476 Update javadoc for setFrameRate
Explicitly state that when fps=0 the other two parameters
of setFrameRate are ignored.

Bug: 161776961
Test: n/a
Change-Id: If5ecbbf053aa59071f19f6c7ba9ae0af9f15451b
2021-04-27 14:31:27 +02:00
Wilson Wu
5577a28e2d Merge "Enable USE_REPORT_WINDOW_GAINED_FOCUS_ASYNC" into sc-dev 2021-04-27 06:32:17 +00:00
Ming-Shin Lu
20f2cdd39a Merge "Consolidate InputMethodManager#toggleSoftInput reliability" into sc-dev 2021-04-27 02:32:35 +00:00
TreeHugger Robot
ecfc497460 Merge "Async startInputOrWindowGainedFocus" into sc-dev 2021-04-26 19:06:26 +00:00
Ming-Shin Lu
2c8068c98a Consolidate InputMethodManager#toggleSoftInput reliability
As previously InputMethodManager#toggleSoftInput is designed to tell
InputMethodService directly through IInputMethodSession to toggle
soft-keyboard visibility, this could be happened some unexpected IME
visibility issues that when the app calling this method in the wrong
state like the app toggling IME visibility when the app is off-screen
but unexpectedly it ends up showing soft-keyboard when the IME is in
invisible state.

To minimize the app compatibility without changing the public API
surface and reducing unexpected IME visibilty been toggled behavior
especially happens when switching the apps, changed the internal IPC
protocols to call IMMS#showSoftInput or IMMS#hideSoftInput directly
according the previous IME consumer requested visibility state,
so that in IMMS side can validate to see if the token user is
still focused and ready to toggle the IME visibility to show or hide.

As the result, we deprecated toggleSoftInput and
toggleSoftInputFromWindow to state the reason as the above, and
recommand to use showSoftInput or hideSoftInputFromWindow instead,
so that framework side no longer has to call {InputMethodSessionWrapper,
InputMethodSessionImpl}#toggleSoftInput.

Bug: 182071625
Test: m checkapi doc-comment-check-docs
Test: atest KeyboardVisibilityControlTest#testToggleSoftInput
Change-Id: I390dc029e7bcc30c200926a9bfbbbd0268a1f714
2021-04-27 01:34:12 +08:00
Ahaan Ugale
2434a92049 Merge "Translate: API for content padding." into sc-dev 2021-04-26 15:17:26 +00:00
Joanne Chung
5d1ebc4f96 Merge "API feedback: TranslationCapability APIs refinement." into sc-dev 2021-04-26 15:07:58 +00:00
Galia Peycheva
57ef720249 Merge "Use global setting instead of forceWindowBlurDisabled" into sc-dev 2021-04-26 11:42:49 +00:00
Joanne Chung
2fcdb2cf9f API feedback: TranslationCapability APIs refinement.
- updates APIs naming and uses Consumer<TranslationCapability>
  instead of PendingIntent
- Implements the propagating capability updates in the client side

Bug: 176208267
Test: manual.
Test: atest CtsTranslationTestCases

Change-Id: I171c908b529e2ef300e4bbd55c1565b33a25c1e5
2021-04-26 18:10:49 +08:00
Wilson Wu
58e49e3c7e Enable USE_REPORT_WINDOW_GAINED_FOCUS_ASYNC
We had CL[1] to construct an async mechanism if it
only report the focus gain in InputMethodManager.
And using a USE_REPORT_WINDOW_GAINED_FOCUS_ASYNC flag
to switch that new flow.

Flip this flag to enable this mechanism. If it need
to get back to previous sync behavior, we can revert
this change instead of CL[1].

[1]: Ic584203c1221fbae17f5e2d8f09e3992df061646

Bug: 185928120
Test: atest CtsInputMethodTestCases
Change-Id: I2d9600973b34c9d4818e96a8cef771b8a33a07ef
2021-04-26 17:38:23 +08:00
Wilson Wu
5e2d9f271d Async startInputOrWindowGainedFocus
We ignore the result if startInputReason is
WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION or
WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION
in startInputOrWindowGainedFocus.

Introduce USE_REPORT_WINDOW_GAINED_FOCUS_ASYNC
flag to control following behavior:

-. Don't wait the result if it only report the
   focus gain. Have another IPC for this case
   to prevent the UI thread be blocked.

-. Throw the exception to the client side if it
   happened.

Bug: 185928120
Test: atest CtsInputMethodTestCases
Change-Id: Ic584203c1221fbae17f5e2d8f09e3992df061646
2021-04-26 17:13:03 +08:00
Ahaan Ugale
8dc9a795e0 Translate: API for content padding.
This allows controlling the content padding behavior needed with some
apps for compatibility reasons.
(see I9d7db5d2bc200e4042baf3267796f00cfc298f19)

The flag is currently the only property in the new UiTranslationSpec
value type, but more properties can be added in the future (such as
animation specifications).

Bug: 179693024
Test: manual
CTS-Coverage-Bug: 182990474
Change-Id: I11052cddb59c928b22ad9ad16e3c9b092da4b907
2021-04-26 01:14:02 -07:00
Santos Cordon
e5dae0ddc5 Add listener for brightness-specific changes.
Add FLAG to registerDisplayListener method to receive
brightness-specific changes.

getBrightnessInfo() method added to
android.view.Display to get brightness value, min, max
and highBrightnessMode status.

Bug: 168210311
Bug: 171023136
Test: atest com.android.server.display
Change-Id: I581e86e039cc7cf1bbca4cf7af03daa41dbddfe0
2021-04-23 22:18:55 +01:00
Caitlin Cassidy
efaeb0c564 Merge "[Ongoing Call Chip] Don't show the chip on lockscreen." into sc-dev 2021-04-23 14:01:58 +00:00
Galia Peycheva
85bb3e4da0 Use global setting instead of forceWindowBlurDisabled
This CL removes the existing TestApi
WindowManager#setForceCrossWindowBlurDisabled and replaces it
with Settings.Global#ENABLE_WINDOW_BLURS.

Bug: 14186649
Test: m && atest BlurTests
Change-Id: Ia15b7932ea973a9ed195c507558cdc71f194b366
2021-04-23 11:13:43 +02:00
Louis Chang
1637653a78 Merge "Try fixing the flakiness of TaplTestsQuickstep#testSwitchToOverview" into sc-dev 2021-04-23 08:34:36 +00:00
Hongwei Wang
b899f626b6 Merge "Apply PictureInPictureSurfaceTransaction upon reparent" into sc-dev 2021-04-23 05:17:12 +00:00
TreeHugger Robot
60a6502567 Merge "Fix SurfaceView callback timings" into sc-dev 2021-04-23 03:47:30 +00:00
TreeHugger Robot
efc7e4c0f0 Merge "Add api to propagating translation capability updates." into sc-dev 2021-04-23 00:39:27 +00:00
Adam He
e5c140a59d Add api to propagating translation capability updates.
This change adda the apia in the TranslationService that allows to
update the TranslationCapability to the registered clients. This
change doesn't contain the register part in the TranslationManager,
the change will be done on the next change.

Bug: 176208267
Test: atest CtsTranslationTestCases
Test: manual verification
CTS-Coverage-Bug: 182990474

Change-Id: Iec7b3dc30f99985415162394d0e64d8e825ea5d9
2021-04-22 14:54:21 -07:00
Vishnu Nair
8685ce1dee Fix SurfaceView callback timings
In R we consolidated SetWindowStopped to use ViewRootImpl
surface changed callbacks. This affected the timings of when
the app would get SurfaceView SurfaceHolder callbacks. The
callbacks would be invoked in ViewRootImpl traversal before
the measure pass. If the app tried to add to the view hierarchy
in the callback, the view would not measure and layout the
new view properly.

To fix this, move the ViewRootImp SurfaceChangedCallback
after the measure pass.

Test: app in bug can add a view from SurfaceHolder.Callback#surfaceCreated
Fixes: 181529599
Change-Id: I06923113f7fc8e90242060c34f1d309d53b5a87b
2021-04-22 14:18:37 -07:00
Hongwei Wang
0df585fb8d Apply PictureInPictureSurfaceTransaction upon reparent
When autoEnterPip from Task with multiple activities, besides passing
the mLastRecentsAnimationBounds we should also try to pass the last
PictureInPictureSurfaceTransaction to the new Task and apply both.

Changed also
- deprecate the last recents animation bounds and use the transaction only
- reset the transform once applied to the original task

Known issue: original task appears transparent in overview once.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/hNZ0H62PqgVDEUGh1TVMiT
Bug: 184789412
Bug: 185509920
Test: manual with ApiDemos, see Video
Change-Id: I7fb77e41e1963e14ecaf53bd135d6b4cb24493c9
2021-04-22 11:14:44 -07:00
Caitlin Cassidy
eb457d50b7 [Ongoing Call Chip] Don't show the chip on lockscreen.
Also moves the #initNotificationIconArea call to be within
CollapsedStatusBarFragment, rather than requiring StatusBar to call it.
This makes our unit tests better because now we don't need to call it
manually.

Also fix a bug in #onDozingChanged that was passing disabled1 in for
disabled2.

Test: atest and manual
Bug: 183229367
Fixes: 185897059
Change-Id: I0a65f9e90e66680f0b602b89f89ec0a4900e9df8
2021-04-22 15:18:12 +00:00
Louis Chang
a262436fe1 Try fixing the flakiness of TaplTestsQuickstep#testSwitchToOverview
The new configuration did not reported to the NexusLauncher activity
when the device rotated to landscape. It seems that the configuration
object of the ActivityClientRecord was unexpectedly updated somewhere,
so the configuration handling was skipped and not reporting to the
activity.

Copy the configuration from mPendingMergedConfiguration vs. directly
assigning the given configuration object reference.

Bug: 185820525
Test: atest NexusLauncherTests:TaplTestsQuickstep
Change-Id: I6768fe86e5c977c32a975562ec058c82d4f9c2fc
2021-04-22 18:22:10 +08:00
Nikita Iashchenko
9623adb4b8 Merge "Remove usage of optimized reflection getters" am: 9d0bfe1b0a am: f10f3736ea am: e5400b4085
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682029

Change-Id: Id5e445360ec59029c82f9bc96c55dd1599a0029e
2021-04-22 10:09:50 +00:00
Nikita Iashchenko
e5400b4085 Merge "Remove usage of optimized reflection getters" am: 9d0bfe1b0a am: f10f3736ea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682029

Change-Id: I870f7eee1c5f113b00aa560e4951084be8daf3d5
2021-04-22 09:43:59 +00:00
Nikita Iashchenko
9d0bfe1b0a Merge "Remove usage of optimized reflection getters" 2021-04-22 09:10:01 +00:00
Wilson Wu
3e0705d6e8 Merge "Prevent addtional removeSurface calls" into sc-dev 2021-04-22 07:41:49 +00:00
Wilson Wu
08f5b9c846 Prevent addtional removeSurface calls
The surface may not be cleared by its owner when
it lose control last time. We had CL[1] to clean
up the surface if we don't plan to show.

Add new checking condition for last control, so
once we have control we only remove the surface
if last control was null.

[1]: I4910c2a06cc67b0470477b245fc1de54b75f10f9

Bug: 185557884
Test: atest InsetsSourceConsumerTest
Change-Id: I1a4f05f9b4cf6fa121554ff0abc9fdc418b95276
2021-04-22 12:46:35 +08:00
Tiger Huang
755cd83f49 Merge "Stop processing if the new control equals the current one" into sc-dev 2021-04-22 04:23:38 +00:00
Treehugger Robot
1bff978184 Merge "Fix grammatical error in LayoutAnimationController documentation." am: 84fdb3b19f am: 07a7231bc8 am: 1c166fa20d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1680106

Change-Id: I7be25e32f785c30b21d8b286be38c8907524b9dd
2021-04-21 23:50:20 +00:00