Commit Graph

12171 Commits

Author SHA1 Message Date
Aurimas Liutikas
83cbd348c3 Merge "Add View#getSourceLayoutResId()." 2019-01-31 18:23:02 +00:00
Jorim Jaggi
9c9b866e1f Merge "Revert "Make WindowContainer surfaces container layers by default."" 2019-01-31 17:26:23 +00:00
Jorim Jaggi
f6ef18334b Revert "Make WindowContainer surfaces container layers by default."
This reverts commit 139c77763b.

Reason: Device gets put into GL comp pretty much all the time,
trashing performance and battery.

Bug: 123686354
Bug: 122561221
Change-Id: Icf658f331c407d03e844557cc2531c034aa38083
Exempt-From-Owner-Approval: Simple revert
2019-01-31 17:26:06 +00:00
Peiyong Lin
a0baea28b7 Merge "Replace createHardwareBitmap with wrapHardwareBuffer." 2019-01-31 15:37:56 +00:00
TreeHugger Robot
6e6b31adc8 Merge "Log translate action's views and clicks." 2019-01-31 01:36:40 +00:00
Abodunrinwa Toki
520b2f8122 Log translate action's views and clicks.
This logs a "view" event for the translate action *once* for each
selection session that involves a foreign language. It logs a "click"
action when the translate action is clicked.

The logged action index will give an indication of whether the translate
action was the primary action (index 0) and thus immediately visible to the
user or whether it was one of the secondary actions (index > 0) and
possibly in the selection toolbar's overflow.

Bug: 123414932
Bug: 120837847
Test: atest core/tests/coretests/src/android/view/textclassifier
Test: atest cts/tests/tests/view/src/android/view/textclassifier
Test: atest android.widget.TextViewTest
Test: atest android.widget.cts.TextViewTest
Test: (MANUAL):
      1. Ensure device has an app that supports Intent.ACTION_TRANSLATE
      2. Run the following command on the shell: adb logcat -c "TCEventTronLogger"
      3. Select some foreign lanugage text in a TextView
      4. Click on "Translate" item on the toolbar
      5. Observe that the device logs a "view" and a "click" event
      6. Repeat 3
      7. Click on a different menu item, e.g. "Copy"
      8. Observe that the device logs only a "view" event

Change-Id: I36f32459c577cf8f8bcf1e65960c4e6d7ffa5e01
2019-01-31 01:22:17 +00:00
Peiyong Lin
9d4274005e Replace createHardwareBitmap with wrapHardwareBuffer.
The bitmap.createHardwareBitmap doesn't take a ColorSpace as input, as a result
the returned bitmap is always in SRGB color space. Given that we want to remove
the assumption of SRGB color space, we replace the usage of
createHardwareBitmap with wrapHardwareBuffer which takes an extra argument
ColorSpace. As a result, we will be able to also fix SurfaceControl and various
other places that use screenshot in follow up patches.

BUG: 120904891
Test: CtsUiRenderingTestCases
Change-Id: I57fc0c85d68df43b0e69f9a1ebac00d2ba39554d
2019-01-30 15:22:54 -08:00
Aurimas Liutikas
aae06631e1 Add View#getSourceLayoutResId().
Add ability for developers to check which layout file did a given
View was inflated from.

Bug: 111439551
Test: atest CtsViewTestCases:android.view.cts.ViewSourceLayoutTest
Change-Id: I0f2981648629d74fd576687a54a31b00cd636976
2019-01-30 13:36:04 -08:00
TreeHugger Robot
260d75ff71 Merge "Revise javadoc of EXTRA_FROM_TEXT_CLASSIFIER" 2019-01-30 16:36:18 +00:00
TreeHugger Robot
447919d2e5 Merge "[layout precompilation] Add testing hook for precompiled layouts" 2019-01-30 16:18:27 +00:00
Tony Mak
63abbe234d Revise javadoc of EXTRA_FROM_TEXT_CLASSIFIER
Test: make

FIXES: 123223220

Change-Id: I4e79cab261a3540cc94d2cf19950f5cba22e06fe
2019-01-30 14:41:22 +00:00
TreeHugger Robot
3186185050 Merge "Made ContentCapture's UserDataRemovalRequest getters public." 2019-01-30 11:32:37 +00:00
Tiger Huang
54caefd531 Merge "Let the activity embedded in ActivityView can be directly touched" 2019-01-30 10:36:02 +00:00
Felipe Leme
6f6bdae72d Made ContentCapture's UserDataRemovalRequest getters public.
Test: m update-api
Test: atest CtsContentCaptureServiceTestCases

Fixes: 123597549

Change-Id: Ibb35f860e97bb4b7f6aa564a7b2cfccbc9e041d4
2019-01-30 01:08:23 -08:00
Rhed Jao
098876f547 Merge "Improve clear a11y forcus for A11yManagerService" 2019-01-30 08:01:13 +00:00
TreeHugger Robot
0e8ceab66b Merge "Null check before writing RemoteAnimationTarget proto" 2019-01-30 05:59:19 +00:00
TreeHugger Robot
fdf4384585 Merge "Removed unused flag from notifyTextChanged()." 2019-01-30 05:40:33 +00:00
Evan Rosky
baca819d26 Null check before writing RemoteAnimationTarget proto
Change-related variables are null when not changing, thus
we need to check for that before trying to write them to proto

Bug: 123538318
Test: ActivityLifecycleTopResumedStateTests#testTopPositionLostOnFinish
      passes

Change-Id: I643c48621602b5203f7f64a9af0578273f115dbe
2019-01-29 18:44:28 -08:00
Chavi Weingarten
e82defc28e Merge "Make WindowContainer surfaces container layers by default." 2019-01-30 01:12:39 +00:00
Felipe Leme
35ea763042 Removed unused flag from notifyTextChanged().
(and also fixed typo on hidden constant)

Test: m update-api
Test: atest CtsContentCaptureServiceTestCases
Fixes: 123598012

Change-Id: I63ccb60cf8eebe6b5ef6d7961dbb0ac8be088eda
2019-01-29 16:32:56 -08:00
Eric Holk
25aa4edaa8 [layout precompilation] Add testing hook for precompiled layouts
We want to be able to control at a fine grained level whether precompiled
layouts are enabled so we can compare inflation results with and without. This
changes adds a @TestApi method that supports this.

Bug: 111895153
Change-Id: Ib6b62d79a9ca7aefefff8639752aa5838e491038
2019-01-29 22:52:39 +00:00
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
Tiger Huang
04dc4cc64b Let the activity embedded in ActivityView can be directly touched
The goal is to eliminate the latency caused by forwarding the event.

In this CL, we put an input portal window behind an ActivityView, and
subtract the touchable region of the the ActivityView, so that the user
can touch through the portal window, and let the touch arrive on the
embedded activity.

Bug: 120675821
Test: Manual test with ActivityViewTest
Test: atest CtsActivityManagerDeviceTestCases:ActivityViewTest
Change-Id: I6776387b65cf6a7d2ea60cb00ffdd38be22081ac
2019-01-30 00:52:51 +08: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
chaviw
139c77763b Make WindowContainer surfaces container layers by default.
WindowContainers surfaces will never have a buffer so change them to be
container layers to avoid confusion on the buffer count in
SurfaceFlinger.

Also restrict SurfaceControl Builder to set a single surface type to
avoid confusion.

Test: go/wm-smoke
Bug: 122561221
Change-Id: I26b5810675ef3a3cc1a33533b6afcb0d0489d5ba
2019-01-28 17:51:43 -08: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