Commit Graph

12147 Commits

Author SHA1 Message Date
Adam He
b278ec3836 Merge changes from topics "dsiable_settings_2", "disable_cc_settings"
* changes:
  Added new APIs to let ContentCaptureService enable / disable the feature.
  Added new APIs to let Settings enable / disable ContentCapture
2019-01-29 22:46:24 +00:00
TreeHugger Robot
06cb6f5252 Merge "Fixed ContentCaptureManager.getServiceComponentName()" 2019-01-29 22:10:36 +00:00
TreeHugger Robot
577c93bd2e Merge "Update IntentFactory to construct intents using RemoteActionTemplate... objects that are returned by the model" 2019-01-29 22:03:03 +00:00
Ashley Rose
0f3dd0ebc3 Merge "Run inspector annotation processor on framework" 2019-01-29 21:26:03 +00:00
Ashley Rose
b47ddd4a1d Run inspector annotation processor on framework
Test: m
Bug: 117616612
Change-Id: Ifb013cf576e57818493a52aefec9729ecca4ac08
2019-01-29 13:34:31 -05:00
TreeHugger Robot
c0e07d7389 Merge "Fixed NPE on MainContentCaptureSession.handleFlushIfNeeded" 2019-01-29 18:24:33 +00:00
TreeHugger Robot
1b306c4289 Merge "Foldables: Add IDisplayFoldListener" 2019-01-29 12:38:10 +00:00
Adrian Roos
962017e49b Foldables: Add IDisplayFoldListener
Include ag/5663399 to unregister display fold listener.

Bug: 123245311
Test: atest WmTests
Change-Id: I60776fddd4a671b7443cd33220271fed84503b27
2019-01-29 09:15:28 +00:00
Felipe Leme
bb0c2a2a33 Added new APIs to let ContentCaptureService enable / disable the feature.
Bug: 123286662
Test: atest ChildlessActivityTest#testSetContentCaptureFeatureEnabled_disabledByApi \
        ChildlessActivityTest#testSetContentCaptureFeatureEnabled_disabledThenReEnabledByApi
Test: atest CtsContentCaptureServiceTestCases # for sanity check

Change-Id: Ideefb4c8e122e5f3f55dd7de8085212b2d8ce073
2019-01-28 16:20:39 -08:00
Felipe Leme
91ddecac0a Added new APIs to let Settings enable / disable ContentCapture
Bug: 123286662
Test: atest ChildlessActivityTest#testSetContentCaptureFeatureEnabled_disabledBySettings \
        ChildlessActivityTest#testSetContentCaptureFeatureEnabled_disabledThenReEnabledBySettings\
        FrameworksCoreTests:SettingsBackupTest#secureSettingsBackedUpOrBlacklisted
Test: atest CtsContentCaptureServiceTestCases # for sanity check

Change-Id: I7cd2c36c1d7e23efb9acacf4f18cecd8838f5ac5
2019-01-28 16:20:30 -08:00
Felipe Leme
effa5f4383 Fixed ContentCaptureManager.getServiceComponentName()
Here's the current code:

mHandler.sendMessage(obtainMessage(ContentCaptureManager::handleGetComponentName, this, resultReceiver));
return resultReceiver.getParcelableResult();

That code posts a message to a handler, than blocks waiting for the result. It used to work fine,
but now it deadlocks because the handler is also running in the UI thread.

The solution is to not use the handler anymore, at least for these non-session related methods.

Test: atest BlankActivityTest#testGetServiceComponentName_onUi
Fixes: 123521559

Change-Id: I774dc6338f685d185447cd61da31bcc63b085996
2019-01-28 15:02:53 -08:00
Felipe Leme
3d570a490d Fixed NPE on MainContentCaptureSession.handleFlushIfNeeded
Test: atest CtsContentCaptureServiceTestCases
Bug: 122959591

Change-Id: Ia3b842326b5eee839693ffc71cbc3d464aabccc7
2019-01-28 13:04:35 -08:00
TreeHugger Robot
a17646d280 Merge "Removed userId from ContentCapture binder calls." 2019-01-28 21:03:45 +00:00
Felipe Leme
f2aa0d2214 Removed userId from ContentCapture binder calls.
It should be infered on the server side..

Bug: 123516968

Test: atest CtsContentCaptureServiceTestCases

Change-Id: If6ccf2fa86adb55f43c4b3ffa8b58661ef16dabb
2019-01-28 11:33:12 -08:00
Jorim Jaggi
c21eb7fe33 Merge "Reset visibility before creating leash" 2019-01-28 18:58:41 +00:00
Tarandeep Singh
e8d1eaa1dc Merge "Pipe IME state into insets (IME transitions 3/n)" 2019-01-28 18:14:34 +00:00
Yohei Yukawa
30026c854c Enable per-profile IME by default
With this CL, per-profile IME will be enabled by default.

Note that on debuggable builds (Build.IS_DEBUGGABLE == true),
developers can still disable per-profile IME mode as follows.

  adb root
  adb shell setprop persist.debug.per_profile_ime 0
  adb reboot

Note that multi-client IME [1] is a completely different story,
because it was designed to be fully multi-user / multi-profile aware
since its begging.  Enabling multi-client mode means that per-profile
mode is always enabled, because that's the only mode that
MultiClientInputMethodManagerService supports.

 [1]: I41dfe854557b178d8af740bc2869c936fc88608b
      bae5bea23c

Fix: 63907246
Fix: 111083076
Test: atest CtsAdminTestCases CtsDevicePolicyManagerTestCases
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: Did multiple manual tests.
  * OTA scenario from older builds
  * Unlocking devices by typing password
  * App focus changes between personal apps and work apps
  * Direct-reply notifications from personal / work users
  * IME whitelist is only enforced to work IME settings
Change-Id: I854ce92b2bf3aab49f14f6cde444acf2182b9ad0
2019-01-28 10:10:22 -08:00
TreeHugger Robot
fce062c23a Merge "Correct SurfaceView background visibility." 2019-01-28 18:03:24 +00:00
Tarandeep Singh
2cbcd7ffbf Pipe IME state into insets (IME transitions 3/n)
Add a IME state changes callback that pipes IME state into the Inset
consumer.

Bug: 118599175
Bug: 118118435
Test: atest InsetControllerTest
Test: atest InsetSourceConsumerTest
Test: atest ImeInsetsSourceConsumerTest

Change-Id: Id878226418e19cdf0499a0094f1d5c47fea33125
2019-01-28 16:58:32 +01:00
Tony Mak
fc039c36ab Update IntentFactory to construct intents using RemoteActionTemplate...
objects that are returned by the model

1. TemplateIntentFactory is the intent generator. It reads from the
   templates that are returned from the model, and construct the
   intents accordingly. If template is missing, we fallback to use
   LegacyIntentFactory.
2. LegacyIntentFactory is the old(existing) intent generator.
3. Added a flag to allow us to switch between them.

Test: atest TemplateIntentFactoryTest.java
Test: atest LegacyIntentFactoryTest.java

Change-Id: I7bdcc73321f5a0160c5ff0edf1a2095119f4dcb1
2019-01-28 14:31:26 +00:00
Jorim Jaggi
d89efebc97 Reset visibility before creating leash
Otherwise we create the leash with visibility=shown before the
client can update it, creating a flicker.

Test: Open IME, go home, observe no flicker
Bug: 111084606
Change-Id: I38eadaef79c27036edf5a86b773f6695d463db5c
2019-01-28 13:10:48 +00:00
TreeHugger Robot
92fd290867 Merge "Add threshold flag for foreign language detection." 2019-01-28 13:04:35 +00:00
Abodunrinwa Toki
a77dba6a22 Add threshold flag for foreign language detection.
Required for feature tuning and experiments

Also
- Updates Javadoc as per API review request
- Updates TextClassificationConstants test

Bug: 120794314
Bug: 118296637
Bug: 34780395
Test: atest core/tests/coretests/src/android/view/textclassifier/TextClassificationConstantsTest.java
Test: (MANUAL)
      1. Install an app that handles Intent.ACTION_TRANSLATE
      2. Run adb shell settings put global text_classifier_constants system_textclassifier_enabled=false,lang_id_threshold_override=0
      3. Select foreign text
      4. Observe that a "Translate" option is shown in the selection toolbar

      1. Install an app that handles Intent.ACTION_TRANSLATE
      2. Run adb shell settings put global text_classifier_constants system_textclassifier_enabled=false,lang_id_threshold_override=2
      3. Select foreign text
      4. Observe that a "Translate" option is not shown in the selection toolbar

Change-Id: I02b6ca48669e66a24150b04bba2ebfcf9ebe6bfd
2019-01-28 11:27:01 +00:00
Peiyong Lin
b20446f6bd Merge "Add Display.getPreferredWideGamutColorSpace()." 2019-01-26 22:10:16 +00:00
Peiyong Lin
277eaff438 Add Display.getPreferredWideGamutColorSpace().
Add Display.getPreferredWideGamutColorSpace() to return the preferred wide
color space that the rendering and composition pipeline prefers.

BUG: 120904891
Test: atest android.display.cts.DisplayTest#testGetPreferredWideGamutColorSpace
Change-Id: I1bcd9db72689a734b2a7c097b99a01464810994a
2019-01-25 17:15:26 -08:00
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
Robert Carr
a2bd3b6955 Correct SurfaceView background visibility.
This corrects an error introduced in a recent refactoring. The background
SHOULD be visible when the SurfaceView is opaque, the idea being that the background
will provide for opacity even if the SurfaceView hasn't finished rendering.

Bug: 123421088
Test: Manual. SurfaceViewSyncTests. ASurfaceControlTest.
Change-Id: Ie0690e07474c30d9324e0b0f26db136e4d7a0fa2
2019-01-25 13:43:20 -08: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