Commit Graph

12099 Commits

Author SHA1 Message Date
TreeHugger Robot
e9c836ef7b Merge "Accelerate long press in View.java" 2019-01-24 17:37:49 +00:00
Jorim Jaggi
2ae39132cb Expose new methods targeted to IME only
Since we are not going to allow multiple types, it makes sense to
create a specialized method instead of exposing the general ones.

Test: CTS will be added once API is properly exposed
Bug: 111084606
Change-Id: Idcd3b17f46fbc05c9ac60fa2bba7dd6305d0529e
2019-01-24 17:06:55 +00:00
TreeHugger Robot
c54e78a084 Merge "Put the TextClassification action's intent in the extra." 2019-01-24 12:41:47 +00:00
TreeHugger Robot
43b9e11886 Merge "Change Transition" 2019-01-24 09:20:46 +00:00
TreeHugger Robot
945be95b6a Merge "Add IntEnumMapping" 2019-01-24 06:08:52 +00:00
TreeHugger Robot
e6af411b09 Merge "Deprecate InputMethodManager#setCurrentInputMethodSubtype()" 2019-01-24 05:58:06 +00:00
Jackal Guo
a275d99547 Merge "Support A11yInputFilter on multi-display" 2019-01-24 05:43:07 +00:00
TreeHugger Robot
99eff853a0 Merge "Explicit delay in View.java" 2019-01-24 04:14:00 +00:00
TreeHugger Robot
f879268e09 Merge "Implement onUserDataRemovalRequest" 2019-01-24 04:07:02 +00:00
TreeHugger Robot
c8c1a25637 Merge "New ContentCapture API: ContentCatpureContext.action" 2019-01-24 03:34:26 +00:00
Siarhei Vishniakou
33949862d4 Accelerate long press in View.java
If a force press is detected, the MotionEvent will have a classification
of CLASSIFICATION_DEEP_PRESS. When this type is detected, dispatch the long
press event immediately.

Bug: 62940136
Test: "force" press on home screen and see the logcat message about
accelerating the long press action, see the menu appear sooner than the
typical timeout for long press.

Change-Id: Ifcd953356f42248c1d3c6674877b84b3aaf01299
2019-01-24 02:29:04 +00:00
Evan Rosky
2289ba174d Change Transition
This adds a new transition classification for apps which are
switching between 2 visible states. The primary example of this
is windowing-mode change.

This new classification is mChangingApps in DisplayContent and
there is a transition type for TASK_CHANGE_WINDOWING_MODE.

The mode-change transition is scheduled when AppWindowToken
detects a windowing-mode change. It immediately creates
a snapshot and temporary leash to "freeze" the visuals of
the app until the animation starts (all transitioning apps
are ready).

The transition itself is a blend of fading, scaling, and
cropping based on whether the end-state is bigger than the
start state.

The RemoteAnimationTarget now includes a startBounds and an
extra "snapshot" leash for controlling the snapshot overlay
relative to the AppWindowToken. If either of those is
populated, the client of the RemoteAnimation can assume it
is animating a change and is responsible for transforming
the leash from the startBounds to its final state.

Bug: 113253723
Bug: 111762928
Test: go/wm-smoke + RemoteAnimationControllerTests
Change-Id: I8654656124b888950e55e31d88ce7a4101e935f8
2019-01-23 18:03:34 -08:00
Felipe Leme
e2c3e477d1 Merge "Added argument checking on ContentCaptureContext." 2019-01-24 00:39:06 +00:00
Yohei Yukawa
ff42b1b685 Deprecate InputMethodManager#setCurrentInputMethodSubtype()
InputMethodManager#setCurrentInputMethodSubtype(), which was
introduced in Android 4.0 ICS [1], was probably mistakenly exposed as
a public API, because it has required WRITE_SECURE_SETTINGS that
typical applications cannot have.

This CL marks InputMethodManager#setCurrentInputMethodSubtype()
deprecated.  There is no actual implementation change at this moment,
but developers should avoid relying on this API in general not only on
futuer versions of Android but also on existing devices.

 [1]: I55daa19ba924999def544bf841f00bf54852f3e1
      b66d287e30

Fix: 123249820
Test: make -j checkbuild
Change-Id: Ia31df87ad2182484d7335503c5d87cb93540fd17
2019-01-23 15:47:35 -08:00
TreeHugger Robot
62ab6f0a62 Merge "Deprecate InputMethodManager#setAdditionalInputMethodSubtypes()" 2019-01-23 23:36:05 +00:00
TreeHugger Robot
a4a3eb210a Merge "Moar Content capture improvements:" 2019-01-23 23:21:23 +00:00
Siarhei Vishniakou
bacad70109 Explicit delay in View.java
Currently, the checkForLongClick function receives an argument that
later gets subtracted from some default value, but it is confusing to
use such a function. The natural computation is to provide the time
delay directly.
Minor refactor of View.java here to simplify the math.

Bug: none
Test: none
Change-Id: Ic237e8edac5bd2c7608215f20706a4a67a194b4b
2019-01-23 14:25:22 -08:00
TreeHugger Robot
a68b803912 Merge "New APIs for Augmented Autofill whitelisting, plus some spring cleaning..." 2019-01-23 21:22:12 +00:00
Ashley Rose
a61e7cd00d Add IntEnumMapping
It's just a wapper for SparseArray, but the builder makes it easier to
work with in code-gen, and provide an immutability guarantee.

Test: atest android.view.inspector.cts
Bug: 123295401
Change-Id: I479d7d3c5ebf4f7e3d82aa05f4e566db844d43ba
2019-01-23 15:20:42 -05:00
TreeHugger Robot
e0b050e1c3 Merge "Changed the virtual ids on ContentCapture to be long." 2019-01-23 20:04:51 +00:00
Felipe Leme
be002d89ec Moar Content capture improvements:
- Drop Content Capture events when the session is disabled, otherwise sessions
  on this state might never finish.
- Fixed PII leak.
- Created helper class for common stuff.
- Improved logging.

Test: manually chenged VERBOSE to true, restarted system_server, and watched logcat - without
      this change, launcher's session would never die because it kept re-scheduling flush
      requests.
Test: atest CtsContentCaptureServiceTestCases
Bug: 122959591

Change-Id: Idcc1bbb12763d1cf98149164c68c2712834d5112
2019-01-23 11:32:36 -08:00
Abodunrinwa Toki
385b10c15e Put the TextClassification action's intent in the extra.
Bug: 122964462
Test: atest core/tests/coretests/src/android/view/textclassifier/TextClassifierTest.java
Change-Id: I0d34013ec2ce56c08b8d6e04fe551c1ad7010cff
2019-01-23 19:01:15 +00:00
John Reck
99f46cae08 Merge "Add continuous SKP capture test api" 2019-01-23 17:57:42 +00:00
Yohei Yukawa
fd8f72188c Client-side reimplementation of IMM#setCurrentInputMethodSubtype()
This is a preparation to mark
InputMethodManager#setCurrentInputMethodSubtype() deprecated.

InputMethodManager#setCurrentInputMethodSubtype(), which was
introduced in Android 4.0 ICS [1], was probably mistakenly exposed as
a public API, because it has required WRITE_SECURE_SETTINGS that
typical applications cannot have.

Keeping maintaining InputMethodManager#setCurrentInputMethodSubtype()
is not that simple because now we are about to enable per-profile IME
mode, where this method needs to have a more clear spec about what
"Current" means.

An ideal solution is just removing this method, because if the caller
already has WRITE_SECURE_SETTINGS permission, they can just directly
update Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE to achieve the
same goal.  However, given that this has been a public API, it would
probably make sense to provide a fallback implementation like I did
for null IME token in InputMethodManager#setInputMethod() [2].

Either way, InputMethodManager#setCurrentInputMethodSubtype() will be
marked as deprecated in a subsequent CL.

 [1]: I55daa19ba924999def544bf841f00bf54852f3e1
      b66d287e30
 [2]: I42dd0325b01c527009bf85566ca8ba0766b2294e
      0c1ebffdb3

Bug: 123249820
Test: manually done with a test app that has WRITE_SECURE_SETTINGS
Change-Id: I76da83c57cffc6b73defccfd4a1b5734c958a97e
2019-01-23 09:00:24 -08:00
Felipe Leme
0143d0cc7c New ContentCapture API: ContentCatpureContext.action
Test: atest CtsContentCaptureServiceTestCases:android.contentcaptureservice.cts.ContentCaptureContextTest
Fixes: 121374600

Change-Id: If66b874b01579834be1ad43570687f1ea46b656d
2019-01-23 08:58:03 -08:00
Felipe Leme
b67e949bcf Added argument checking on ContentCaptureContext.
Bug: 111276913
Test: atest CtsContentCaptureServiceTestCases:android.contentcaptureservice.cts.ContentCaptureContextTest

Change-Id: I819ebec57611a9ced29c1a1a6f40893be9d35b22
2019-01-23 08:57:54 -08:00
TreeHugger Robot
a3382a4fef Merge "Deprecate InputMethodService#onViewClicked()" 2019-01-23 16:04:52 +00:00
Jorim Jaggi
f72ad8d08a Merge "Fix tests" 2019-01-23 14:35:27 +00:00
Jorim Jaggi
fae3e276b1 Fix tests
Test: atest InsetsAnimationControlImplTest
Bug: 118118435
Change-Id: I92f5a91b24d3441c092c9dab55d9340b7da3ab14
2019-01-23 14:35:05 +00:00
TreeHugger Robot
9c6e668b47 Merge "Process DEEP_PRESS in GestureDetector" 2019-01-23 08:51:08 +00:00
Yohei Yukawa
0eb8d16d90 Deprecate InputMethodService#onViewClicked()
This CL marks InputMethodService#onViewClicked() deprecated.  There is
no actual implementation change at this moment, but developers should
avoid relying on this callback in general not only on futuer versions
of Android but also on existing devices.

Since this API was implemented in Android 4.0 ICS [1] it never worked
well for WebView and any other UI libraries that expose themselves as
a giant "Canvas", which can host their own UI hierarchy and sub focus
state.

If IME developers want consistent and reliable user interaction across
devices and applicactions, implementing IMEs' own UI on top of
CursorAnchorInfo API would be a good choice.

If IME developers just want to be notified an existing input
connection is interrupted, they can just monitor
InputMethodService#onFinishInput().

 [1]: Ia71ad325e50a20e9e1001def662ef992bb50a9d0
      863fcd6217

Fix: 123245358
Test: make -j checkbuild
Change-Id: I37a6c6d82d4a424f0df84633b09bca4881efbf02
2019-01-22 21:47:57 -08:00
Felipe Leme
559e21d7c6 New APIs for Augmented Autofill whitelisting, plus some spring cleaning...
Test: m update-api # they're not implemented yet
Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.augmented.AugmentedLoginActivityTest # for sanity checking

Bug: 123100824
Bug: 111330312
Bug: 123233342

Change-Id: I9f6b9067f743b7590cc8b32b42b8fff230f9a3d8
2019-01-22 21:32:57 -08:00
Yohei Yukawa
2988d2db5c Unimplement VrManager#setVrInputMethod()
A system API VrManager#setVrInputMethod(), which was originally
introduced in Android P [1], has hever been used actually.  To avoid
unnecessary maintenance burden in the Android Framework, this CL makes
VrManager#setVrInputMethod() no-op.

For those who want to develop VR Keyboard, they should be able to use
Android P build to see if it actually works and it's actually what
they want.  In the future, if we can have a working prototype, we can
revisit here to see if we want to restore the framework implementation
or not.

Note that with this CL IMEs that have android:isVrOnly="true" will
always be ignored.

There should be no user/developer visible behavior change because this
is about an unused system API.

 [1]: I1db7981b5198e7e203d4578cae7e5b6d20037d0d
      89a6c48a8b

Bug: 72522822
Fix: 122058241
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:InputMethodInfoTest
Test: atest FrameworksServicesTests:InputMethodManagerServiceTests
Change-Id: I5464ff74b92ff4a0d30002d643bd3c89925f0f0c
2019-01-22 21:29:09 -08:00
Rob Carr
302d36b6a8 Merge changes from topic "public-sc"
* changes:
  Unhide parts of SurfaceControl API in SDK.
  Replace SurfaceView background with boundless color layer.
  SurfaceControl: Accept instance rather than handle for reparent
2019-01-23 04:57:59 +00:00
Jackal Guo
8b729932db Support A11yInputFilter on multi-display
In order to support multi-display, some event handlers need to be
plural. Based on the characteristic of each event handler, only
the event handler that needs to deal with concurrent events from
different display needs multi-instance.

Test: a11y CTS & unit tests
Test: atest SystemUITests
Change-Id: I76379fb82aad09ee20609d81bd5b1dda15931905
2019-01-23 12:53:35 +08:00
Siarhei Vishniakou
07f440adfe Process DEEP_PRESS in GestureDetector
GestureDetector can now send the long press event sooner,
if a force touch has been detected by the system.
At the same time, we need to inhibit any scrolling action whenever the
CLASSIFICATION_AMBIGUOUS_GESTURE is set.

Bug: 62940136
Test: used HeatMapDemo app to register GestureDetector
and print out messages. Also observed the CLASSIFICATION_DEEP_PRESS
to ensure events are correlated.

Change-Id: I82ac1cc43d35df69a7a9649c628b995074394be6
2019-01-22 17:54:01 -08:00
Felipe Leme
a75333c876 Changed the virtual ids on ContentCapture to be long.
WebView will use the node addresses as the id, and these address are 64 bits.

Fixes: 123234726
Test: atest ContentCaptureSessionTest ViewNodeTest ContentCaptureSessionTest \
            CtsContentCaptureServiceTestCases \
	    CtsAutoFillServiceTestCases:VirtualContainerActivityTest \
	    CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest
Test: m update-api
Test: manual verification with Webview, as CtsAutoFillServiceTestCases:WebViewActivityTest is broken

Change-Id: Iaf3008ed2dd530e596489cb144da678a4dac48ca
2019-01-22 17:14:51 -08:00
TreeHugger Robot
9a8406418d Merge "Added trace points for ContentCapture." 2019-01-22 23:05:27 +00:00
Yohei Yukawa
92c15b1baf Deprecate InputMethodManager#setAdditionalInputMethodSubtypes()
This CL marks InputMethodManager#setAdditionalInputMethodSubtypes()
deprecated.  There is no actual implementation change at this moment,
but developers should be informed that this API may stop working in a
future version of Android.  IME developers should start migration
right now.

Since this feature was implemented in Android 4.0 ICS [1], there have
been many tricky bugs and documented/undocumented pitfalls.  For IMEs
that have already implemented features like customizable/downloadable
keyboard layouts/languages, most likely re-implementing IMEs' own
language switching mechanism then exposing only one unified IME
subtype to the system would be a better long term choice.

 [1]: Ic7869cfaa5361531e08d58d7dfa5ba0feab0613e
      ee5e77cafe

Fix: 121220151
Test: make -j checkbuild
Change-Id: I781abde2d6d97b8420b29b80e14b9cce97482754
2019-01-22 13:26:45 -08:00
John Reck
5cca8f250c Add continuous SKP capture test api
Bug: 122856066
Test: PictureCaptureDemo
Change-Id: Iaf3a4bc1c8a2c18c7dff635c5f1cf726b331f8bf
2019-01-22 13:13:06 -08:00
Adam He
3d0409b00f Implement onUserDataRemovalRequest
Change-Id: I7c818d42000b6155f9dcaad85b7f9f761741a484
Fixes: 121289354
Test: atest CtsContentCaptureServiceTestCases # still passing
Test: manual verification
2019-01-22 12:02:48 -08:00
Robert Carr
76907eeaa6 Unhide parts of SurfaceControl API in SDK.
In parity with the recently exposed NDK APIs. In addition removing @hide
we make a few changes to prepare the APIs for being public.
1. Use a hidden singleton SurfaceSession
2. Expose a Surface constructor for ANativeWindow inter-op
3. Mark SurfaceControl final
4. Implement setGeometry as public version of setPosition/matrix/crop.
5. Add a visibility toggle method (as opposed to show/hide methods) for
   parity with NDK.

Bug: 111297488
Test: android.view.cts.SurfaceControlTests
Change-Id: Iac043658a360a48086ef4701a6a8ba2396878e81
2019-01-22 09:01:05 -08:00
Robert Carr
18a82199b7 Replace SurfaceView background with boundless color layer.
In preparation for making SurfaceControl final, as part of API
publication.

Bug: 111297488
Test: Manual
Change-Id: I08a9a86b5341e146a62e39dfd876a48d965bce41
2019-01-22 07:55:10 -08:00
Robert Carr
10584fa98a SurfaceControl: Accept instance rather than handle for reparent
In preparation for public API.

Bug: 111297488
Test: Builds.
Change-Id: I80da54d92989ec0afe9fcdde324847f0de0c5083
2019-01-22 07:55:10 -08:00
Jorim Jaggi
3ebfb65077 Merge "Introduce new window insets launch flag" 2019-01-22 11:56:44 +00:00
Yohei Yukawa
716897ce2e Harden caller verification in IMMS#startInputOrWindowGainedFocus()
Previously, privileged processes (w/ INTERACT_ACROSS_USERS_FULL) that
run as user X are automatically allowed to connect to the current IME
even when it runs as a different user Y.

However, as explained in my previous CL [1], there are many text
operations that are already fully multiuser-aware hence need to be
connected to the right user's services.

If EditorInfo#targetInputMethodUser [2] is not correctly set when it
should have been, it's highly likely that the IME client would need to
call TextView#setTextOperationUser() [3] as I did for System UI [1].

To detect such problems as early as possible, with this CL
IMMS#startInputOrWindowGainedFocus() no longer resolves null
EditorInfo#targetInputMethodUser as the current IME user for
privileged processes that have INTERACT_ACROSS_USERS_FULL permission.

If this CL broke some IME use case, most likely the IME client app
would need to be fixed.

 [1]: Ibabe13e5b85e5bb91f9f8af6ec07c395c25c4393
      7276946b92
 [2]: Ia7ea944438d69669ccdf9111b34ba400e786a602
      0f5eade4a4
 [3]: I6d11e4d6a84570bc2991a8552349e8b216b0d139
      401e3d4c84

Bug: 34886274
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: per-profile mode still works.
Test: Manually tested multi-user scenario as follows
  1. Build and flash an AOSP build
  2. Create a secondary user then switch to it.
  3. make -j SoftKeyboard
  4. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  5. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  6. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
  7. make -j EditTextVariations
  8. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  9. adb shell am start \
     -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 10. Tap the menu icon on the EditTextVariations then click "Direct Reply"
 11. Tap reply icon on "Message from UserHandle{10}".
 12. Make sure that SoftKeyboard Sample IME is shown.
 13. Type "ggggg" then hit the space key.
 14. Make sure that red underline is drawn under "ggggg"
 15. Make sure that AndroidSpellCheckerService runs as user 10.
 16. Set up a text screenlock.
 17. Turn off the display.
 18. Turn on the display.
 19. Make sure that SoftKeyboard Sample IME is shown.
Change-Id: Ieb94ed14698ee2669adc5fb2ea0e93c7d0e09e8b
2019-01-22 00:00:53 -08:00
Jorim Jaggi
73f3e8ad3e Introduce new window insets launch flag
Instead of turning off the new window insets system fully on or
off, we introduce three modes:

0: Old system
1: New system for IME only
2: New system for IME + system bars

This allows us to launch the feature in IME only mode, in order to
avoid a lot of compatibility fallout around system bars.

Test: adb shell setprop persist.wm.new_insets 0/1/2
Bug: 118118435
Change-Id: Iaa49e62930b2539770cd313567dde4b102216097
2019-01-21 23:13:05 +01:00
Yohei Yukawa
17ace29a10 Deprecate SuggestionSpan#ACTION_SUGGESTION_PICKED
This CL deprecates SuggestionSpan#ACTION_SUGGESTION_PICKED and related
constants [1].

There are multiple security concerns, open questions about
compatibility, and maintainance challanges in this protocol.

IME developers can implement their own suggestion picker UI on top of
CursorAnchorInfo API to achieve safer, should give more flexible UI
options, better security, and better compatibility.

 [1]: Ia539de0acf66053e0349daec459d75e36805f6bf
      f9f0100862

Fix: 123160396
Test: make -j checkbuild
Change-Id: I6d39e838ae47488055162cd44b5f553f68869b17
2019-01-21 09:24:26 -08:00
TreeHugger Robot
9f6cfc3371 Merge "Fix CTS" 2019-01-21 15:32:52 +00:00
Jorim Jaggi
9b30a74edb Fix CTS
Test: WindowInsetsTest
Change-Id: Ic2754959375c8f3e07390d9562880713113eb2cf
Fixes: 123045035
2019-01-21 15:25:16 +01:00