Commit Graph

12026 Commits

Author SHA1 Message Date
Peiyong Lin
367b1aef01 Merge "[SurfaceControl] Add API to query composition color spaces." 2019-01-18 01:17:48 +00:00
TreeHugger Robot
eb5034ac6e Merge "Uses main thread for ContentCaptureManager handler." 2019-01-18 00:33:59 +00:00
TreeHugger Robot
10b727ca66 Merge "[layout compilation] Disable precompiled layouts when preferCodeIntegrity is set" 2019-01-18 00:27:36 +00:00
Peiyong Lin
5f4a568d80 [SurfaceControl] Add API to query composition color spaces.
To facilitate the need of returning color spaces about the composition
pipeline, add an API to query this information. This API will be used by Canvas
and Display, etc.

BUG: 120904891
Test: Build, flash and boot. Verify by checking returned values.
Change-Id: I97123ba1488ca76888a4c004128b4100a7c1f76c
2019-01-17 14:51:20 -08:00
TreeHugger Robot
643e1c2d16 Merge "[SurfaceControl] Add API to query protected content support." 2019-01-17 22:03:31 +00:00
Eric Holk
987c7a95c7 [layout compilation] Disable precompiled layouts when preferCodeIntegrity is set
This feature involves generating and loading code on the
application. Applications may use the preferCodeIntegrity flag to indicate they
do not want this behavior, so we need to respect this preference. We also
disable loading precompiled layouts for privapps.

Bug: 111895153
Change-Id: I5c563e9f6eb7dd5eb7aac7df3838888f71b38866
2019-01-17 13:54:46 -08:00
Felipe Leme
34ccedf4a8 Uses main thread for ContentCaptureManager handler.
Initially it was creating a new thread, which infers in a ~0.3ms cost in the
initial activity creation. Examples:

Before:
com.android.settings: 403.542us
com.google.android.apps.nexuslauncher: 13147.397us
android.contentcaptureservice.cts: 481.979us

After:
com.android.settings: 25.677us
com.google.android.apps.nexuslauncher: 45.0us
android.contentcaptureservice.cts: 56.041us

Test: manually System.out check above
Test: atest CtsContentCaptureServiceTestCases

Fixes: 121039624

Change-Id: I4e7d90c4556467612d8b914fb3d3a5bc05a852bd
2019-01-17 13:52:54 -08:00
TreeHugger Robot
9c81c7cc5e Merge "Log history of Content Capture flushes." 2019-01-17 21:08:48 +00:00
Peiyong Lin
0ddb7d497a [SurfaceControl] Add API to query protected content support.
To facilitate display color service to know the capability of protected content
in GPU composition, add an API to SurfaceControl to query back from composer.

BUG: 117436546
Test: Build. flash and boot. Verify by checking returned value.
Change-Id: I313c88e68dc4d2ae3f1e8e9d11b1f4d877a4d64f
2019-01-17 12:28:52 -08:00
Eric Holk
becdfa7a9e Merge "[LayoutInflater] Use precompiled layouts if available" am: cb5f54e264 am: 3be49488d5
am: 90d5dd50de

Change-Id: Ia35e56f2ef4bc38894521daae3587b93cf221061
2019-01-17 11:30:17 -08:00
Eric Holk
90d5dd50de Merge "[LayoutInflater] Use precompiled layouts if available" am: cb5f54e264
am: 3be49488d5

Change-Id: I2e714604fa13e9421987c57913bb099349172d45
2019-01-17 11:14:34 -08:00
Eric Holk
3be49488d5 Merge "[LayoutInflater] Use precompiled layouts if available"
am: cb5f54e264

Change-Id: I40f7755dc5b3f85181a73db24149e6f5a8e2b17a
2019-01-17 10:56:05 -08:00
Eric Holk
928bbac9c5 [LayoutInflater] Use precompiled layouts if available
This change enables the use of precompiled layouts, provided a couple of
conditions are met:

1. Precompiled layouts are enabled by the system property
   view.use_precompiled_layouts.
2. There is a file called compiled_view.dex in the application's code cache
   directory.

If these conditions are met, when a layout is inflated, the LayoutInflater will
first check if a precompiled version is available and use that. If anything goes
wrong, such as if the layout is not available or something goes wrong during the
inflation process, then the LayoutInflater will fall back on interpretting the
layout resource as before.

Bug: 111895153
Test: atest $ANDROID_BUILD_TOP/cts/tests/tests/view/src/android/view/cts/LayoutInflaterTest.java
Change-Id: Id050072c0206080322a0e876782ee2b66d03916d
2019-01-17 09:11:27 -08:00
Nikita Iashchenko
957fe88fc9 Merge "Switch TextClassifier implementation from native to java" am: 06eb53cede
am: 6ff8cf84f7

Change-Id: Ibd2281c89692d3b1630c3c259978ace8e241068f
2019-01-17 08:13:52 -08:00
Nikita Iashchenko
6ff8cf84f7 Merge "Switch TextClassifier implementation from native to java"
am: 06eb53cede

Change-Id: Iaaddc488874381fbc1f6b76f5f60dc47abf65cdd
2019-01-17 07:48:09 -08:00
Nikita Iashchenko
06eb53cede Merge "Switch TextClassifier implementation from native to java" 2019-01-17 15:34:02 +00:00
Felipe Leme
1af85ea149 Log history of Content Capture flushes.
Bug: 122959591

Test: manual verification
Test: atest CtsContentCaptureServiceTestCases \
            FrameworksCoreTests:android.view.contentcapture.ContentCaptureTest

Change-Id: I9a5af8d1ea882b7b8fbbfa32aa2a37466b524ce5
2019-01-16 18:08:14 -08:00
Felipe Leme
7a4c182d47 Merge "Minor fixes on ContentCapture session logic." 2019-01-17 01:27:34 +00:00
Ashley Rose
74c1d773f6 Merge "Refactor inspector API" 2019-01-16 20:59:22 +00:00
Felipe Leme
d65692c606 Minor fixes on ContentCapture session logic.
Some apps - like launcher and settings' FallbackHome - generate view-level events before ever
starting an activity (probably because they're using dialogs). Hence, we were scheduling a
flush request, but never cancelling it.

Bug: 120494182
Bug: 122959591
Test: atest CtsContentCaptureServiceTestCases

Change-Id: I4a5448f19902ae51c8f2679eb0c468757b98c3ff
2019-01-16 12:53:44 -08:00
TreeHugger Robot
8b08542a5a Merge "Schematize Display system properties" 2019-01-16 17:28:57 +00:00
Jelle Fresen
02301df216 Restore @UnsupportedApiUsage in AnimationListener
As long as FragmentManagerImpl in AndroidX is not fixed, we need to keep
this annotation, or FragmentManagerImpl will crash.

Bug: 122893665
Test: atest AnimationTest
Change-Id: I5e21ee5f3ffb4c314ae7b5ea8f32d3880e2f2550
2019-01-16 12:55:50 +00:00
TreeHugger Robot
64883457cf Merge "Improved ContentCaptureManagerSession state." 2019-01-16 03:26:37 +00:00
TreeHugger Robot
d9043b830e Merge "Implement setContentCaptureEnabled for manually enabling content capture" 2019-01-16 03:23:30 +00:00
Ashley Rose
618e0efd66 Refactor inspector API
- Remove unused IntFlagMapping.Builder#clear()
- Rename IntFlagMapping#namesOf(int) to #get(int)
- Change signature of IntFlagMapping#get(int) to return a Set
- Add doc comment explaing desing rationale to PropertyReader
- Remove IntEnumMapping in favor of SparseArray. Note that this removes
  the immutability gaurantees of IntEnumMapping.
- Miscelaneous doc fixes

Test: atest IntFlagMappingTest
Bug: 122518089
Change-Id: I94acf03431b238d84afcd74cdbdd347431381c40
2019-01-16 00:35:29 +00:00
Feng Cao
158b65635e Use the same UI classes for augmented autofill as the standard android autofill.
Bug: 122479403
Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.augmented.AugmentedLoginActivityTest
Test: atest CtsAutoFillServiceTestCases # sanity check, 3 are consistently failing due to timeout.
Change-Id: Ida44a5714e1abcfc308a2a8d747b7766202fcb45
2019-01-15 15:53:20 -08:00
Felipe Leme
01b8749b40 Improved ContentCaptureManagerSession state.
Test: atest CtsContentCaptureServiceTestCases
Bug: 111276913

Change-Id: I8b1f36174582d89913d5d170abb65789a16818ec
2019-01-15 14:52:35 -08:00
Adam He
6079d151e4 Implement setContentCaptureEnabled for manually enabling content capture
Change-Id: Id660aebac0b35a33b39a7c74da0f11c0958549ee
Fixes: 121047183
Test: atest CtsContentCaptureServiceTestCases
Test: atest android.contentcapture.cts.ChildlessActivityTest#testDisabledByApp
2019-01-15 12:13:21 -08:00
Kiyoung Kim
0fe161dffd Schematize Display system properties
Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.

Bug: 117924132
Test: m -j
Change-Id: Id9bbb997669b05b6edb5307d561e766ead19abf1
2019-01-15 20:03:11 +00:00
Nikita Iashchenko
7ea2f83f9f Switch TextClassifier implementation from native to java
Thic CL eliminates the native dependency on libtextclassifier in favor of the java one
because the .java implementation is built on top of stable APIs (@CorePlatformAPI, Android SDK)
while the native API might change in future, leading to breakages.

Bug: 119788152
Test: m droid successfully builds + atest frameworks/base/core/tests/coretests/src/android/view/textclassifier
Change-Id: I4c3bb4790c360dd514ed2ea48e0634de43dab9e7
Merged-In: Ide5e58d1c80d9a028cea4e9192a91aeac2843c71
(cherry picked from commit 64c4cb2ea9)
2019-01-15 13:23:17 +00:00
TreeHugger Robot
66f91878a0 Merge "Cleanup TextClassifier APIs" 2019-01-15 10:49:13 +00:00
TreeHugger Robot
a508d8cec1 Merge "Added an (optional) session id to Autofill id." 2019-01-14 21:39:53 +00:00
TreeHugger Robot
3bd034f341 Merge "Made Augmented Autofill APIs accessible to tests." 2019-01-14 19:30:36 +00:00
Tony Mak
ae85aae6aa Cleanup TextClassifier APIs
Major changes:
1. ConversationAction is now in top-level.
2. Removed TypeConfig, and repurposed TextClassifier.EntityConfig for
   general use. It would be better to rename it to be something like
   TypeConfig. But just a bad name is probably not worth to deprecate
   the existing APIs.
3. Hints constants are moved to Request object.
4. Action constants are moved to ConversationAction object.

Test: atest TextClassifierTest.java

BUG: 120841922

Change-Id: Ia466aaf4c5050a9c7e404dcd3b295f5ef7e4ce6f
2019-01-14 17:06:00 +00:00
Jorim Jaggi
4a710a85d2 Merge changes I88f7f7e5,If6c1153d
* changes:
  Expand docs for animation listener
  A brave new world for window insets (11/n)
2019-01-14 15:37:23 +00:00
qinyige
e8754b4652 Merge "Avoid adding node itself as child node." am: e0a34bf17f am: 234076ca37
am: fb9e440baf

Change-Id: Ic682f24666614f9d683fab5c0206540c224888db
2019-01-12 08:24:39 -08:00
qinyige
fb9e440baf Merge "Avoid adding node itself as child node." am: e0a34bf17f
am: 234076ca37

Change-Id: I6f395d4c831a0a7ef60c7704461a071a9ce404f6
2019-01-12 08:14:37 -08:00
qinyige
234076ca37 Merge "Avoid adding node itself as child node."
am: e0a34bf17f

Change-Id: I5b86189d3ad1e3ead4b24f0c15c44d6beb2a0a4b
2019-01-12 07:50:12 -08:00
Treehugger Robot
e0a34bf17f Merge "Avoid adding node itself as child node." 2019-01-12 15:37:43 +00:00
Felipe Leme
739b98fe65 Added an (optional) session id to Autofill id.
Test: atest FrameworksCoreTests:android.view.autofill.AutofillIdTest \
            FrameworksCoreTests:android.view.contentcapture.ContentCaptureSessionTest \
            FrameworksCoreTests:android.view.contentcapture.ViewNodeTest \
	    CtsContentCaptureServiceTestCases \
            CtsAutoFillServiceTestCases
Bug: 121197119

Change-Id: I7572de182d9bf1c3862997766423bd5742f3ce2a
2019-01-11 16:54:14 -08:00
Robert Carr
a7827f7b5e Prepare to unhide SurfaceControl
Bug: 111297488
Test: Builds
Change-Id: Ieb38ee12153241e94fcebf6b818be5e12cdd8228
2019-01-11 13:38:56 -08:00
Felipe Leme
2cab38cab2 Made Augmented Autofill APIs accessible to tests.
Bug: 119638958

Test: atest CtsAutoFillServiceTestCases
Test: m update-api && m

Change-Id: I4863885be6121889e4a53db4eb9afad3565c51aa
2019-01-11 11:57:22 -08:00
Jorim Jaggi
98c756513d Expand docs for animation listener
Test: builds
Bug: 118118435
Change-Id: I88f7f7e5943e1165868052db03423121fa548152
2019-01-11 18:19:16 +01:00
Jorim Jaggi
02a741f7a9 A brave new world for window insets (11/n)
Implement animation listeners

Test: CTS will be added in the future
Bug: 118118435
Change-Id: If6c1153da007b80859485ecbcdc1610d1d82373e
2019-01-11 18:18:50 +01:00
Jorim Jaggi
d345052a8f Merge "Fix return value for comment consistency in getDetachWallpaper" 2019-01-11 11:50:21 +00:00
TreeHugger Robot
3bf407f536 Merge "Add classification to MotionEvent" 2019-01-11 06:28:13 +00:00
Yohei Yukawa
a878b9500e Support per-profile IME behind the flag
In order to support BYOD (Bring your own device) use cases, Android
phones can associate multiple users into a single profile group so
that other system components such as launcher can help users
seamlessly switch user identity without doing a heavy-weight
device-level user switching.

For instance, an Android device can be configured to work for two
different users Alice and Bob, while Alice also has two different
identities: one as her private account and the other for her
work-related account.

  Profile group X == Alice:
    Parent user X (user id: 0)
      for personal account, under her control.
    Child user 1 (user id: 10)
      for work-related account, partly under system-admin's control.
  Profile group Y == Bob:
    Parent user Y (user id: 11)
      private account, under his control.

The above configuration allows system-level data separation not only
between Alice (user 0) and Bob (user 11) but also between Alice's
personal account (user 0) and Alice's work-related account
(user 10). For instance, Calendar app that runs under user 0 cannot
see any data for other users including user 10.

IME is one of known exceptions in the above design. For instance, when
Alice is using the device, the system launches InputMethodService,
which is the code-level representation of IMEs, only for the user 0
then gives it a special ability to interact with all the applications
that run under the same profile group.

  Profile group X == Alice:
    IME works as user 0 but interacts with apps that run under
    user 0 and 10.
  Profile group Y == Bob:
    IME works as user 11 and interacts with apps that run under
    user 11.

Of course there are non-trivial imprications by sharing the same
instance of InputMethodService across profiles but this was basically
the only option when we initially introduced in Android 5.0 [1]
because of multiple challenges (schedule, complexity, performance
concerns, and so on). To to mitigate the risk, we also introduced APIs
that allow system administrators to whitelist what IMEs can be enabled
for the entire profile [2].  Even with such a whitelist feature, we
have received multiple feature requests to completely separate IME
instances by profile boundaries, like other applications behave.

This is why this CL was authored.

With this CL, a new runtime mode "per-profile IME" is introduced
behind the flag.  When the flag is enabled:

  * InputMethodManagerService (IMMS) may calls IMMS#switchUserLocked()
    from IMMS#startInputOrWindowGainedFocus() every time when a
    different profile's IME client gains IME focus.
  * SpellCheckerService also enables per-user mode, which has been
    temporarily disabled [3].
  * DevicePolicyManagerService no longer disable packages that contain
    system IMEs when creating a new profile user.
  * Following IME APIs start returning result based on the caller's
    user (profile) ID.
     * InputMethodManager#getInputMethodList()
     * InputMethodManager#getEnabledInputMethodList()
     * InputMethodManager#getEnabledInputMethodSubtypeList()

There are still multiple known issues though. Hopefully we can address
those issues in subsequent CLs.

 * Inline-reply from non-primary profiles is still dispatched to the
   main profile's IME because SysUI is always running under main
   profile (Bug 120744418).  This probably can be addressed by
   allowing the IME clients that have INTERACT_ACROSS_USERS_FULL to
   specify the target user ID in some @hide parameter.
 * IMMS#switchUserLocked() is not yet fully optimized (Bug 28750507).
   New client app's UI thread can be blocked more than 100ms,
   depending on the number of installed IMEs and the number of IME
   subtypes implemented by those IMEs.
 * Even after IMMS#switchUserLocked() is fully optimized, IMEs'
   cold-startups are known to be slow.  One way to optimize this is
   keeping binding to those IMEs, but doing so would require 1)
   non-trivial amount of code changes and 2) doubles RAM consumption.
 * Virtual keyboard settings page for profile users are not yet
   available (Bug 120748696).
 * Migration from shared-profile IME mode to per-profile IME mode is
   not yet supported (Bug 121348796).  By default, IME packages will
   be automatically disabled when a profile user is created.  This
   means if the device switches from shared-profile IME mode to
   per-profile IME mode, IME packages continue to be disabled hence
   the user cannot type anything for those profiles.

Anyway, there should be no behavior change unless the debug flag is
explicitly flipped.

 [1]: I3bd87b32aec69c3f8d470c8b29b144f4e849c808
      734983fff3
 [2]: I921888660d29a5370395db87adf75d4d106660c9
      9c9cbac5b71a23ed0dbab0f44cb78a820514cfc6
 [3]: Ic046f832f203115106409a53418a5746eb6d4939
      3f8c568883

Fix: 120709962
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: Made sure that there is no behavior change if the debug flag is
      not set as follows.
  1. Install Test DPC
  2. Enable managed profile with Test DPC
  3. make -j EditTextVariations
  4. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  5. Open two EditTextVariations instances in split-screen mode
   5.1. One is for the main profile
   5.2. The other is for the managed profile
  6. Make sure that main profile's instance of AOSP Keyboard is used
     for both applications.
  7. Make sure that main profile's instance of Android Spell Checker
     is used for both applications.
  8. adb shell ime list -a -s --user all
      -> Only "com.android.inputmethod.latin/.LatinIME" is shown.
  9. adb shell dumpsys textservices
      -> Only result for user #0 is shown.
Test: Made sure that basic text input can be done with
      "per-profile IME" mode enabled as follows.
  1. adb root
  2. adb shell setprop persist.debug.per_profile_ime 1
  3. adb reboot
  4. Install Test DPC
  5. Enable managed profile with Test DPC
  6. make -j EditTextVariations
  7. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  8. Open two EditTextVariations instances in split-screen mode
   8.1. One is for the main profile
   8.2. The other is for the managed profile
  9. Make sure that AOSP Keyboard will be re-launched to correspond to
     the focused IME client's user profile.
   9.1 When EditTextVariations for the main profile is focused,
       AOSP Keyboard for the main profile is shown.
   9.2 When EditTextVariations for the work profile is focused,
       AOSP Keyboard for the work profile is shown.
 10. Make sure that different instances of Android Spell Checker are
     used based on target application's profile
 11. adb shell ime list -a -s --user all
      -> "com.android.inputmethod.latin/.LatinIME" is shown for both
         user #0 and user #10.
 12. adb shell dumpsys textservices
      -> Both user #0 and user #10 have results.
Test: atest DevicePolicyManagerTest#testSetPermittedInputMethods_failIfNotProfileOwner
Test: atest com.android.server.devicepolicy.OverlayPackagesProviderTest
Change-Id: Ied99664d3dc61b97c919b220c601f90b29761b96
2019-01-10 19:36:24 -08:00
TreeHugger Robot
c6536e4de6 Merge changes from topic "cc_virtual_id"
* changes:
  New, minor ContentCapture APIs for virtual views management.
  Implemented missing methods on android.view.contentcapture.ViewNode
2019-01-11 02:09:45 +00:00
Felipe Leme
2057c38a17 New, minor ContentCapture APIs for virtual views management.
Test: atest CtsContentCaptureServiceTestCases:android.contentcaptureservice.cts.CustomViewActivityTest
Test: atest CtsContentCaptureServiceTestCases # sanity check
Test: atest FrameworksCoreTests:android.view.contentcapture.ContentCaptureSessionTest
Test: m update-api
Bug: 117944706

Change-Id: I08bed441c6cc15673296f392e333c78018b14f65
2019-01-11 02:09:37 +00:00
TreeHugger Robot
000e95725e Merge "Integrate content capture with FLAG_SECURE" 2019-01-11 01:27:40 +00:00