Commit Graph

12216 Commits

Author SHA1 Message Date
TreeHugger Robot
250bd27338 Merge "Don't allow reflection on ScaleGestureDetector#mSpanSlop." 2019-02-05 21:06:16 +00:00
Ashley Rose
2879c9c95f Merge "@InspectableProperty coverage for android.widget" 2019-02-05 21:03:00 +00:00
Mathieu Chartier
c9dcaeb4a5 Merge "Add view inflation device config property" 2019-02-05 20:26:07 +00:00
TreeHugger Robot
f264eebd8e Merge "Removed the Augmented Autofill blacklist APIs." 2019-02-05 19:32:11 +00:00
Louis Pullen-Freilich
c9d007d7c9 Merge "Makes View#setTransitionVisibility public and dark-greylists mViewFlags" 2019-02-05 19:31:11 +00:00
Yohei Yukawa
d20eef826c Query right user's system IMEs in AppRestrictionsHelper
It turns out that AppRestrictionsHelper#addSystemImes() has always
queried for the owner user's system IMEs despite the fact that it's
trying to query system IMEs for a restricted profile user.  This
behavior has not changed since its beginning [1].

Most likely people would not have noticed this though, because:

* Settings app does not show a menu item to create a restricted user
   on phone devices.
 * Even if it's available, most people do not use restricted users.
 * Even if someone created a restrected user, most likely the owner
   user and the restrected user share the same set of system IMEs,
   which are defined as "pre-installed" IMEs.

Anyway, AppRestrictionsHelper#addSystemImes() will start using a newly
introduced @hide API IMM#getEnabledInputMethodListAsUser() so that it
can query for the right user's system IMEs, instead of querying owner
user's ones.

 [1]: Ifced841ad3bfbde33d2403356216dd1749b7fa9a
      a7a93784d1f9798d37cb618def1a558f8d626f0f

Bug: 122164939
Test: atest SettingsLibTests:AppRestrictionsHelperTest
Test: manually done as follows.
  1. Build aosp_taimen-userdebug and flash it.
  2. adb shell pm create-user --restricted test_profile
  3. adb shell am start -a android.settings.USER_SETTINGS
  4. Click the gear icon next to the "test_profile" user.
  5. By adding a log, make sure that IMMS#getInputMethodList()
     gets called with userId = 10.
Change-Id: I5b50b5fe143c74c87b331bda3e5bcc4d6248436e
2019-02-05 10:45:32 -08:00
TreeHugger Robot
7e968348cf Merge "Make ContentCapture calls directly from the UI thread." 2019-02-05 17:12:22 +00:00
Louis Pullen-Freilich
76ff3e0184 Makes View#setTransitionVisibility public and dark-greylists mViewFlags
Developers should use setTransitionVisibility instead of using
reflection to change the visibility in mViewFlags directly.

Bug: b/123768691
Test: CTS test in topic
Change-Id: I04d76100c53238b92cdc1575bc20af2a6b4410fe
2019-02-05 16:08:07 +00:00
Yohei Yukawa
1fb13c59de Query right user's enabled IMEs in KeyguardPasswordView
This CL fixes a regression introduced by my previous CL [1], which
enabled InputMethodManager#getEnabledInputMethodList() to return the
result based on the caller's user ID, not based on the current IME
user, even when it gets called from background users.

Since Keyguard always runs as user 0 currently, it is now Keyguard's
responsibility for querying enabled IMEs with an explicit user ID.  To
do so this CL adds a @hide API IMM#getEnabledInputMethodListAsUser()
and lets KeyguardPasswordView use it.

 [1]: I192a0f5a1375170d17a4c08af94f23966dbaea8b
      7f8ee4b9dd

Bug: 122164939
Fix: 123904896
Test: Manually verified as follows.
  1. Build aosp_taimen-userdebug and flash it.
  2. make -j SoftKeyboard
  3. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  4. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  5. adb shell pm create-user test_user
  6. adb shell am switch-user 10
  7. adb shell locksettings set-password aaaa
  8. adb shell wm dismiss-keyguard
  9. Make sure that the IME switcher icon is not shown at the right
     end of the password field.
Change-Id: I6e7d7353c2b5b1da5d460ae005fb2585f85fb1c4
2019-02-05 07:55:28 -08:00
Yohei Yukawa
629271aa85 Improve API documents of some IME query APIs
This is a follow up CL to my previous CL [1], which enabled following
IME query APIs to return the result based on the caller's user ID, not
based on the current IME user, even when they get called from
background users.

 * InputMethodManager#getInputMethodList()
 * InputMethodManager#getEnabledInputMethodList()
 * InputMethodManager#getEnabledInputMethodSubtypeList()

This CL just clarifies it in the API documents.

This is purely a document fix.  There should be no behavior change.

 [1]: I192a0f5a1375170d17a4c08af94f23966dbaea8b
      7f8ee4b9dd

Bug: 13002424
Bug: 122164939
Test: make -j checkbuild
Change-Id: I55f51e211a8a47c01469e2d93b04c5c864f0b9ea
2019-02-05 07:50:36 -08:00
Felipe Leme
aba2ef4af2 Merge "Made ContentCapture APIs available for testing." 2019-02-05 15:20:04 +00:00
Felipe Leme
0a64976a09 Merge "Refactored how initial content capture events are sent." 2019-02-05 15:15:17 +00:00
Jakub Gielzak
79bceebe32 Restrict reflection access to mLayoutParams
Users should rely on the getter / setter. The setter additionally
guarantees internal state correctness.

Bug: 123768937
Test: n/a

Change-Id: Ia2dcbe9db3fdeab8aeac9b80dcfaaa0932724dc2
2019-02-05 12:51:52 +00:00
Felipe Leme
19652c0c27 Made ContentCapture APIs available for testing.
Test: atest CtsContentCaptureServiceTestCases
Test: m update-api

Bug: 123584359
Bug: 119187075

Change-Id: I4ece03de6c7994451dbb9d0ce36d37f20656d3e0
2019-02-04 21:09:16 -08:00
Tarandeep Singh
73f9f9bf8f Merge changes Ib3997487,Ifed8351b
* changes:
  Link InsetsController to IME (IME transitons 4/n)
  Send IME control to client
2019-02-05 03:56:58 +00:00
Felipe Leme
3fe6e92440 Make ContentCapture calls directly from the UI thread.
Most calls are bufffered anyways, so by not using a handler we save time spent
on getting a pooled lambda and posting to the the handler.

The only "expensive" operation is flushing, but it makes a oneway binder call
so it might be fine (and if necessary, we can optimize it later).

Bug: 123307965
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I7182c8e193f58fa000396fdb3003e771214bf79b
2019-02-04 18:30:12 -08:00
Felipe Leme
01297698a1 Refactored how initial content capture events are sent.
The overall workflow of Content Capture is:
 - send initial structure
 - send deltas afterwards

Initially, the initial structure was being reported one view at time, which was causing janking.
This CL changes it so while that while the initial structure is being laid out, the content captures
are held. Then after it's finished, it traverses the structure and sends the initial events.

This change also allowed use to optimize the performance by caching the following state:
 - View.isImportantForContentCapture()
 - View.getContentCaptureSession()
 - Context.getContentCaptureManager()

Besides the performance improvements, this approach also has the following advantanges:
- It sends the VIEW_APPEARED events for the parent views before the events for the children.
- It send events to notify when the view structure layout is ready.

Bug: 123307965
Test: atest CtsContentCaptureServiceTestCases
Test: m update-api

Change-Id: I6db7cc11c6edf65cbffe42187fda82c84c3665ff
2019-02-04 18:28:15 -08:00
Ashley Rose
55f9f92545 @InspectableProperty coverage for android.widget
A few getters for view properties have been added where they were
missing. CTS tests for the new APIs are pending in b/123894719.

Test: m framework
Bug: 120492712
Change-Id: I743ce693d384eaf749ced3db7f81bda7d19ed275
2019-02-04 19:11:56 -05:00
Sumir Kataria
867b901c7e Don't allow reflection on ScaleGestureDetector#mSpanSlop.
This is a value provided by ViewConfiguration that is standardized
across the device.  There are two problems in changing this:
  1. inconsistent behavior with the rest of the uses
  2. modifying this would open the door to modifying all slops,
     which is infeasible and has no good API story

Bug: 123769434
Test: No API or behavior changes
Change-Id: I30bc9d065be8633752a67bd0faa9eafe1678e843
2019-02-04 15:29:50 -08:00
TreeHugger Robot
b031e8e7cb Merge "SurfaceView: Check correct OPAQUE flag for background visibility." 2019-02-04 22:34:43 +00:00
Ashley Rose
aed477d58a Merge "Add InspectionCompanionProvider" 2019-02-04 22:28:51 +00:00
Jorim Jaggi
7974259907 Better interpolation and duration for animations
Test: Open IME
Bug: 111084606
Change-Id: I3c64fe8b772a8164573c8fe3de94d3573e8cd238
2019-02-04 20:55:01 +00:00
Tarandeep Singh
46d59f0ecb Link InsetsController to IME (IME transitons 4/n)
With this change, InsetsController.show/hide now links to IME. This also
takes care of animating IME along with other types.
Insets API are reactive i.e. they remain in sync with state of IME.

Test: atest InsetsControllerTest
Test: atest ImeInsetsConsumerTest
Bug: 118118435

Change-Id: Ib3997487bd19351d1d23bc70173fc9bdfd23a704
2019-02-04 12:41:24 -08:00
Tarandeep Singh
215929b6f2 Send IME control to client
Sends the IME control to the client by calling
InsetsStateController.onImeTargetChanged.

Furthermore, since the frame we use to calculate the insets isn't
necessarily the surface frame, we also need to pass down the
surface position such that the client can calculate the final
leash position correctly.

Test: Open IME
Bug: 111084606
Change-Id: Ifed8351b12d47f698efde504205bd7b77032d36b
2019-02-04 12:41:24 -08:00
Robert Carr
d76074a44a SurfaceView: Check correct OPAQUE flag for background visibility.
No explanation beyond: Typo.

Bug: 123644326
Test: Manual
Change-Id: I2c2cf9eb441fd92703189e5566d70c07b048373c
2019-02-04 12:24:17 -08:00
Ashley Rose
a4850c4405 Add InspectionCompanionProvider
Bug: 117616612
Test: atest GeneratedInspectionCompanionProviderTest
Change-Id: I7998f4f8d9fdbb042e01b5b0c2fc66933b2035d1
2019-02-04 14:18:27 -05:00
Mathieu Chartier
86076a7cbe Add view inflation device config property
Added runtime namespace and corresponding device config property. If
the property is enabled, it overrides the system property.

Bug: 123524494
Bug: 111895153

Test: manual
Change-Id: I97f094e3a8471b72255b27fd0f10160040d49175
2019-02-04 08:55:43 -08:00
Jorim Jaggi
67684881cf Apply visibility at the beginning of the animation
Such that elements are more in sync, and this is also how it was
handled previously.

Furthermore we ensure that surface visibility is correct after the
animation for both show and hide.

Test: Show/hide IM
Bug: 111084606
Change-Id: I47b3d3b430fa38f80203276b9984df1f71008f6e
2019-02-01 15:52:01 -08:00
Peiyong Lin
dd4b22e66c Merge "[Color] Make setColorMode togglable." 2019-02-01 23:20:30 +00:00
Felipe Leme
4a7a6256fc Removed the Augmented Autofill blacklist APIs.
We'll initially implement just the whitelist ones...

Bug: 123233342

Test: m update-api
Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.augmented.AugmentedLoginActivityTest

Change-Id: If24519ec7bf136cf288c86e6d0621f35f4c92d09
2019-02-01 12:44:19 -08: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