Commit Graph

12187 Commits

Author SHA1 Message Date
Peiyong Lin
dd4b22e66c Merge "[Color] Make setColorMode togglable." 2019-02-01 23:20:30 +00:00
Rob Carr
4d1a60d70f Merge "Prevent reallocation of Surface object in copyFrom" 2019-02-01 19:38:22 +00:00
Peiyong Lin
a94f3221da [Color] Make setColorMode togglable.
Previously setColorMode must be called before view is set, and has no effect
after that. The state of WCG on Android when this patch was written, was that
most hardware out there can not handle mixed color spaces composition well
which results in GPU composition. And this situation will remain true for a
long time.

Despite photography applications want to have WCG, it's a power cost especially
during video playback. In order to mitigate this fact and the desire to move
the ecosystem forward in WCG, we make setColorMode togglable such that in the
next app vsync, when color mode is changed we issue a surface update which
results in the old EGLSurface or VkSurface being destroyed and new EGLSurface
or VkSurface being created with the target color space being set. As a result,
applications can now togglable WCG on/off.

BUG: 120288123
Test: Build, flash and boot. Verify with SurfaceFlinger dumpsys on demo app.
Change-Id: I09bf8c380a01f4dde364873d37b248cedc6ccfd3
2019-01-31 21:34:50 -08:00
TreeHugger Robot
f973460248 Merge "Implement getting displayId from ActivityManager" 2019-02-01 01:41:31 +00:00
TreeHugger Robot
f995dbadd6 Merge "Move multiplier to ViewConfiguration" 2019-02-01 00:06:38 +00:00
Adam He
bb82c6a9f0 Implement getting displayId from ActivityManager
Change-Id: Ib8659062e5dd58b49c1e1fdee03f5f6a65e00971
Fixes: 121260224
Test: atest CtsContentCaptureServiceTestCases
2019-01-31 15:33:36 -08:00
TreeHugger Robot
6f68d49476 Merge "Expose FLAG_WINDOW_IS_PARTIALLY_OBSCURED" 2019-01-31 22:29:58 +00:00
TreeHugger Robot
77f932c922 Merge "Fixed ContentCaptureManager.isContentCaptureEnabled() when main session is disabled." 2019-01-31 22:14:31 +00:00
Siarhei Vishniakou
8b047dd850 Move multiplier to ViewConfiguration
We have defined the same constant twice. Let's move it to
ViewConfiguration to avoid redundancy.

Test: build only
Bug: 123368517
Change-Id: I2ac765a85ccd71584429edc693d3ef33b2515c9d
2019-01-31 13:36:07 -08:00
TreeHugger Robot
9853d60bd9 Merge "Rename preferCodeIntegrity to useEmbeddedDex" 2019-01-31 20:35:54 +00:00
Felipe Leme
609991d7d8 Fixed ContentCaptureManager.isContentCaptureEnabled() when main session is disabled.
Each ContentCaptureManager has a MainContentCaptureSession associated with, and the main session
has a mDisabled state that's set to true when it failed to start (for example, because there's no
service associated with the user). Both objects used to share a common AtomicBoolean for the
disabled state, but a recent refactoring split then in a way that the manager's mDisabled was never
updated.

Test: atest ChildlessActivityTest#testGetContentCapture_enabledWhenNoService
Test: atest CtsContentCaptureServiceTestCases # sanityCheck

Bug: 123579223
Bug: 123307965
Bug: 123658889

Change-Id: Ib1f08f23721f208b28d0f339f39b21262b55e30d
2019-01-31 19:43:25 +00:00
Daniel Solomon
b39aaa494b Merge "SurfaceControl: Add a hidden API to get display color primaries" 2019-01-31 18:28:56 +00:00
Aurimas Liutikas
83cbd348c3 Merge "Add View#getSourceLayoutResId()." 2019-01-31 18:23:02 +00:00
Siarhei Vishniakou
3a6a411282 Expose FLAG_WINDOW_IS_PARTIALLY_OBSCURED
Currently, Chrome is using this flag via reflection.
Let's allow developers to use this flag.

Fixes: 120487602
Test: presubmit only
Change-Id: Id28bd1f2cb862bb49f27758a4948f197bba124e2
2019-01-31 10:11:36 -08: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
Victor Hsieh
fa9df0b5db Rename preferCodeIntegrity to useEmbeddedDex
Also remove the restriction of extractNativeLibs.

Test: build, (new) CTS in progress
Bug: 112037137
Change-Id: If0ad13b0d63b288c2da3a82b911d8dad0db8c07a
2019-01-31 07:49:45 -08: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
Daniel Solomon
10e3b336bd SurfaceControl: Add a hidden API to get display color primaries
Add a hidden API, getDisplayNativePrimaries(), used to get the
coordinates of a display's native color primaries.
At this time, the implementation of this API supports only a single
internal panel.

Bug: 123104704
Change-Id: Ie8910f34a59fa6d50b526ddb5ce799d5de82857b
2019-01-30 10:39:47 -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
Robert Carr
d5686729f1 Prevent reallocation of Surface object in copyFrom
Previously when we sent the Surface to the client (as opposed to
the SurfaceControl) Surface::readFromParcel would take care of reusing
the object if the underlying IGBP had not changed. Now that we send
the SC and copy it in to the Surface, we need to add similar logic
in Surface::copyFrom.

Bug: 122588130, 122659537
Test: Manual
Change-Id: Id0c8e61a9aff9b3c37b2a783717c15df3b36f175
2019-01-29 23:32:20 +00: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