Commit Graph

12121 Commits

Author SHA1 Message Date
Evan Rosky
2bfd202ec5 Merge changes from topics "sf_task_id", "sf_metadata"
* changes:
  Add task-id to the task-level surface
  Add metadata store to surfaces
2019-01-25 23:15:36 +00:00
TreeHugger Robot
f53d972ed1 Merge "Post expensive ContentCapture calls to Choreographer's CALLBACK_COMMIT stage." 2019-01-25 19:56:08 +00:00
Felipe Leme
26cbd71896 Post expensive ContentCapture calls to Choreographer's CALLBACK_COMMIT stage.
onProvideContentCaptureStructure() doesn't take much for only 1 view, but it's called for all views
the first time the view hiearchy is laid off, which could acccumulative delay the
initial layout. Hence, we're postponing it to a later stage - it might still cost a
lost frame (or more), but that jank cost would only happen after the 1st layout.

Using this change, the impact on cold-dropcache-test dropped about 50% (from ~2ms to ~1ms).

Bug: 123307965
Bug: 121039624
Test: atest ContentCaptureSession
Test: atest google/perf/app-startup/benchmark-app-hermetic/cold-dropcache-test

Change-Id: I68b98b2894d23309af90d87cc99280f133557252
2019-01-25 09:47:27 -08:00
TreeHugger Robot
3abecb462b Merge "Rename PERSON_USER_LOCAL and PERSON_USER_REMOTE" 2019-01-25 17:16:38 +00:00
Tarandeep Singh
22f2b4ccd9 Animate Insets controller (IME transitions 2/n)
Add animations to InsetsController.show()/hide()

Bug: 118599175
Bug: 118118435
Test: atest InsetsControllerTest
Test: atest InsetSourceConsumerTest
Change-Id: Ife224de9762361e60ca4d11c0e39ad0376cf1e35
2019-01-25 15:01:27 +01:00
Tony Mak
91daa15eea Rename PERSON_USER_LOCAL and PERSON_USER_REMOTE
Test: atest TextClassificationManagerTest.java
Bug: 123223181

Change-Id: I077d06aabf96d824942b99dd6ab95fe8adc2641f
2019-01-25 12:07:50 +00:00
Tarandeep Singh
ed3e728055 Merge "Pre-render input method (IME transitions 1/n)" 2019-01-25 02:36:52 +00:00
Felipe Leme
4125342c5d Merge "Fixed View.getContentCaptureSession(ContentCaptureManager)." 2019-01-25 01:57:15 +00:00
TreeHugger Robot
a91b6af73a Merge changes I841d2621,I456f6695
* changes:
  Fix a couple of issues with insets
  Implement WindowInsets.isVisible
2019-01-25 00:26:53 +00:00
Tarandeep Singh
eadb1392f8 Pre-render input method (IME transitions 1/n)
Pre-render input method views and window when EditText receives focus.
This is a pre-requisite for implementing better IME transitions.

Strategy:
Once EditText receives focus, startInput is called. If optimization is
available, IME views and window (SoftInputWindow) are created and
rendered. Until user taps on EditText or showSoftInput() is called, IME
window remains invisible. This pre-rendered window is kept around until
EditorInfo changes or new connection is started (onStartInput).
IME window's visibility will be set using new Insets controller API
rather than conventional client-side dialog.show().

Behavior:
- This is just IME side preparation CL. No performance improvements yet.
- There should be no user perceptible behavior change.
- As long as IME developers were following official lifecycle, they
  shouldn't perceive any behavior change.

Availability:
This optimization, once fully implemented, will be available when:
 - Device is not "Low memory"
 - AND Master flag DebugFlags.FLAG_PRE_RENDER_IME_VIEWS is set.
 - ViewRootImpl.USE_NEW_INSETS_API is enabled

Bug: 118599175
Bug: 111084606
Test: atest CtsInputMethodTestCases
Test: atest CtsInputMethodServiceHostTestCases
Test: atest ActivityManagerMultiDisplayTests
Test: Tested with 4 IMEs and didn't preceive any behavior change.
Scenarios tested:
  1. With and without hardware keyboard
  2. Screen rotation w/ fullscreen mode.
  3. split-screen

Change-Id: I1a6300fe167eb205ee2b4214a6e270a52ebae062
2019-01-25 00:47:21 +01:00
Felipe Leme
902d63b542 Fixed View.getContentCaptureSession(ContentCaptureManager).
This method was meant to optimize the ContentCaptureManager lookup, but it was not recursively
callign itself....

With this change and using System.out / System.nanotime() to measure:

$ adb shell am start android.contentcaptureservice.cts/.BlankWithTitleActivity

16 calls, taking 260.051us before and 30.311us after

$ adb shell am start android.contentcaptureservice.cts/.LoginActivity

24 calls, taking 290.261us before and 41.403us after

Bug: 123307965
Bug: 121039624
Test: atest ContentCaptureSession
Test: manual verification using system.out for timing
Change-Id: Ida5015ed117cae8ab4484a55f74cbc20fdc6df7f
2019-01-24 14:42:33 -08:00
Evan Rosky
1af8494f70 Merge "Add per-display RemoteAnimation overrides and flag to disable snapshots" 2019-01-24 21:46:37 +00:00
TreeHugger Robot
9a6f30ee6d Merge "Add g/setScore and g/setEntityTypes to TextClassifierEvent" 2019-01-24 21:23:13 +00:00
TreeHugger Robot
f111bf5525 Merge "Removed CloseGuard check from ContentCaptureSession." 2019-01-24 20:43:49 +00:00
TreeHugger Robot
748dfe2b1b Merge "Make getLocalTextClassifier public" 2019-01-24 20:24:10 +00:00
Evan Rosky
966759f60a Add per-display RemoteAnimation overrides and flag to disable snapshots
This CL adds a display-level fallback for remoteanimation overrides
and a property to RemoteAnimationAdapter specifying whether it needs
a snapshot for change transitions or not.

During a mode-change, this check for an override and then asks it
whether it needs a snapshot before creating one.

Bug: 113252739
Test: Added AppChangeTransitionTests
Change-Id: I47c933bd08fe512dc6cf029607819e2c908ab4cd
2019-01-24 11:18:42 -08:00
TreeHugger Robot
e9c836ef7b Merge "Accelerate long press in View.java" 2019-01-24 17:37:49 +00:00
Felipe Leme
4d63c3ee8a Removed CloseGuard check from ContentCaptureSession.
It's crashing some apps using fragments.

Test: atest CtsContentCaptureServiceTestCases
Bug: 123343114
Fixes: 123346127

Change-Id: Ieeb27fbe553584c3e9ce298d5accade2e8fb2495
2019-01-24 09:26:25 -08: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
Tony Mak
03a1d0338d Add g/setScore and g/setEntityTypes to TextClassifierEvent
1. Add get/setScore, so we can see how do scores affect the CTR and
eventually tune the threshold based on it.

2. Convert get/setEntity to get/setEntityTypes.
   Some events like TYPE_ACTIONS_GENERATED and TYPE_ACTIONS_SHOWN
   will need to have a list of entity types. Also, as TRON does not
   support a field of list type. And thus workaround this by having
   3 separate fields in TRON.

4. The result id of action is too easy to clash now as only messages
   are taking into account. Use timestamp and the person object as
   the input to the hash now.

5. Changes in TRON:
   a) We will put conversation_action / language detection, etc to
      category. And we will put the views to subtype.
   b) As suggested by the TRON team, we should not reuse existing fields
   in the clients directly. But we should rather introduce new fields,
   and map them to existing fields in the server. So, TRON team could
   suppress just the new logging if it goes wrong and not affect
   existing loggings.

Test: atest TextClassifierEventTest.java
Tests: atest TextClassifierEventTronLoggerTest.java

BUG: 120803809

Change-Id: I2e71436b323a200beec57ea7c1a8bcc96c9c552f
2019-01-24 15:12:00 +00:00
TreeHugger Robot
c54e78a084 Merge "Put the TextClassification action's intent in the extra." 2019-01-24 12:41:47 +00:00
Jorim Jaggi
90990794e5 Implement WindowInsets.isVisible
Test: WindowInsetsTest
Test: CTS will be added in the future
Bug: 118118435
Change-Id: I456f6695a5ec54b730f69e419f1d4c7e47df6cbd
2019-01-24 12:54:24 +01: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
Evan Rosky
9020c0736a Add task-id to the task-level surface
This can be used by alternate front-ends to associate
surfaces with tasks.

Bug: 122925737
Test: phone boots and surfaces still fling
Change-Id: Ic4cdd9742aa987c59f472b9db78b3c0eb6183e9a
2019-01-23 10:26:06 -08:00
Evan Rosky
485df208f3 Add metadata store to surfaces
This adds a key/value metadata storage mechanism to
surfaces that allows the windowmanager to pass information
to the surfaceflinger frontend.

This then moves the existing metadata (window type and
ownerUID) into this metadata structure.

Bug: 122925737
Test: Phone boots and surfaces fling.
Change-Id: I59739ec5198d815e03811ef659628e45d09721a1
2019-01-23 10:26:02 -08: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
Tony Mak
31ff1351f1 Make getLocalTextClassifier public
As suggested by security review, the javadoc should mention that
the requests will be sent to a textclassifier package if system
textclassifier is in use. Make getLocalTextClassifier public so that
developers can use it instead if they want to keep the data local.

BUG: 119631517
Test: atest TextClassificationManagerTest.java
Change-Id: I703c0a26c501c6eacf7c9efc7c21aca835e99fdb
2019-01-23 15:20:36 +00:00
Jorim Jaggi
f72ad8d08a Merge "Fix tests" 2019-01-23 14:35:27 +00:00