Commit Graph

11996 Commits

Author SHA1 Message Date
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
Perumaal S
addabbaf82 Implement getServiceComponentName API for Content Capture
Tests are in ag/5989968

Fixes: 121047489
Test: atest CtsContentCaptureServiceTestCases # to make sure nothing broke
Test: atest
CtsContentCaptureServiceTestCases:android.contentcaptureservice.cts.BlankActivityTest#testTargetServiceName_enabled
Test: google3 test with test app
Change-Id: I4f11a324beb938a28cd150c35bb3d83c77e59e0b
2019-01-10 12:32:12 -08:00
Adam He
328c0e3841 Integrate content capture with FLAG_SECURE
Change-Id: I4e2c7d8063ca224d2037c01b7ddb24f8a7d85cbf
Fixes: 119254124
Test: atest CtsContentCaptureServiceTestCases
Test: atest android.contentcaptureservice.cts.LoginActivityTest#testStateDisabledByFlagSecure
2019-01-10 11:48:54 -08:00
Jorim Jaggi
9fb9315c1f Fix return value for comment consistency in getDetachWallpaper
Test: n/a
Change-Id: Ie1d9d1b9ee173895316806492eb47b3d1ac0bc5f
Fixes: 119620687
2019-01-10 16:25:49 +01:00
Felipe Leme
93ffb98e8e Implemented missing methods on android.view.contentcapture.ViewNode
Also fixed AssistStructure.ViewNodeBuilder.setVisibility() so it doesn't mess
up with the flags when it receives an invalid value.

Test: atest FrameworksCoreTests:android.view.contentcapture.ViewNodeTest
Test: atest CtsContentCaptureServiceTestCases

Fixes: 121135096

Change-Id: I2280c6922ca5a02aa4ed16ba3e8b39b9cb2f4b55
2019-01-09 17:36:43 -08:00
Rob Carr
c9fd5fc46b Merge changes from topic "sf-remove-remove-layer"
* changes:
  SurfaceFlinger: Remove removeLayer
  Fix memory leak in SurfaceControl#copyFrom
2019-01-09 21:23:15 +00:00
Adam He
58611544cd Merge "Added null checks for NPE on mSystemServerInterface" 2019-01-09 18:40:01 +00:00
Jorim Jaggi
64e9cd30b3 Merge changes from topic "inset_dispatch"
* changes:
  A brave new world for window insets (10/n)
  A brave new world for window insets (9/n)
  A brave new world for window insets (8/n)
2019-01-09 14:17:35 +00:00
Tony Mak
afd5467420 Use isLoggable so that we can enable full logging easily
Also, change to use android.util.Log rather than Slog, which should
be used by system service only.

Test: Try out adb shell setprop log.tag.androidtc and observe verbose
      logging.

Change-Id: Ie86c6b3f8bd39957f041ffe3a10abb7584f96f83
2019-01-09 10:47:36 +00:00
TreeHugger Robot
8c4d24f07e Merge changes I16a302b5,I33f2ce58
* changes:
  Migrate frameworks/base/apct-tests/perftests/core to androidx.test
  Introduce TextClassifierEventTronLogger
2019-01-09 01:24:18 +00:00
TreeHugger Robot
30bbaa3613 Merge "Moved AutofillManager.SyncResultReceiver to an internal utility package" 2019-01-08 22:38:26 +00:00
Adam He
6884fed092 Added null checks for NPE on mSystemServerInterface
Bug: 119254124
Change-Id: Iebec84b414b2e156b9cdada05d66bfeb7f6caf05
Test: atest CtsContentCaptureServiceTestCases
2019-01-08 13:24:47 -08:00
Phil Weaver
c41c91aa67 Merge "Update javadoc for accessibility announcements" 2019-01-08 21:10:00 +00:00
Adam He
435736d3c5 Merge changes from topics "nested_sessions", "fix_flush_sessions"
* changes:
  Implemented nested Content Capture sessions.
  Fixed how session created / removed events are generated.
2019-01-08 20:57:58 +00:00
Felipe Leme
c0c15a3f90 Moved AutofillManager.SyncResultReceiver to an internal utility package
Bug: 121047489
Test: atest CtsAutoFillServiceTestCases # which is crashing due to unrelated issue

Change-Id: I4aba260e9878b1b420dfb7290f2389199c32a82f
2019-01-08 11:18:05 -08:00
Jorim Jaggi
15637fddc3 A brave new world for window insets (10/n)
Rework how dispatching works for apps targeting Q+

(flagged off at the moment behind VRI.USE_NEW_INSETS)

We properly dispatch windows in the hierarchy by fixing the issue
that insets modified by onApplyWindowInsets affected all other
views later in prefix order, including siblings and siblings of
parents.

Furthermore, we get rid of stopping dispatch if they are consumed,
as it gets a lot more complicated with the granular information we
add what consumed actually means.

Test: ViewGroupTest, ViewTest
Bug: 118118435

Change-Id: I9dfb69ebb93b334bb34d17889282293bec94e1af
2019-01-08 17:24:17 +01:00
Jorim Jaggi
bcf99fff73 A brave new world for window insets (9/n)
Implement WindowInsets.get(Max)Insets(int typeMask) to allow the
developer to query the inset by inset type.

Also rework InsetsState.calculateInsets to actually construct the
WindowInsets instance that contains this information.

Test: InsetStateTests
Bug: 118118435
Change-Id: Ie316e074c020bdb9808c11608812dea572c8de5d
2019-01-08 17:24:16 +01:00
Jorim Jaggi
297985ab9d A brave new world for window insets (8/n)
WindowInsets now keeps track of all insets per type. Insets are
non-additive, i.e. every inset starts out relative to the window
edge, so the IME inset would include the navigation bar inset, but
not vice-versa.

We remove decorWindowInsets because it wasn't used at all.

For compatibility, we map the constructor where we pass in a Rect
to TOP_BAR. This is fine as every query to systemWindowInsets
stableInsets will include this type, so we don't need the
information where it came from.

Test: WindowInsetTest
Bug: 118118435
Change-Id: I1cb37d328060293f9a876e61d4a09e6675fa7197
2019-01-08 17:24:08 +01:00
Tony Mak
5a5f0d52c3 Introduce TextClassifierEventTronLogger
1. SelectionEvent will be still logged via SelectionSessionLogger
   to make sure we don't break existing logs.

2. New features including language detection and conversation actions
   are logged via TextClassifierEventTronLogger.

3. Added TYPE_ACTIONS_GENERATED to log when actions are generated.
   This is used to calcuate the recall, i.e. among all the requests,
   how many of them TextClassifier returns something.

Test: atest TextClassifierEventTronLoggerTest
Test: Turn on the DEBUG flag and observe the logging.

BUG: 120803809
BUG: 120828422

Change-Id: I33f2ce58885d90bc35316f54abcd42b137b42a13
2019-01-08 11:07:23 +00:00
Robert Carr
8810b69fc4 SurfaceFlinger: Remove removeLayer
We remove explicit layer destruction and replace it
with reparent->null, completing the transition to
a reference counted model.

Test: Manual
Bug: 62536731
Bug: 111373437
Bug: 111297488
Change-Id: I6be5ae01218e566deb713ed9079b36e1135ff2ec
2019-01-07 18:36:36 -08:00
Robert Carr
eb344c7a35 Fix memory leak in SurfaceControl#copyFrom
Not leaking in practice but if it were used on an already initialized
SurfaceControl Java Wrapper it would leak the old native object by
failing to cal dec strong.

Bug: 111373437
Test: Boots
Change-Id: Ie8f59788630bc2ba05bbdcbbefed4124a4032170
2019-01-07 18:36:36 -08:00
Abodunrinwa Toki
adcd10f10f RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
am: a69950ce18

Change-Id: I0830e1c1a1cea2fd93f0b1ed8a1a792260201bb2
2019-01-07 17:10:30 -08:00
Phil Weaver
e105cc2938 Update javadoc for accessibility announcements
Trying to make it less appealing for developers to force
announcements.

Test: make
Change-Id: I95087c2f068ed5b6c36e4bff6a66bb6c48910f9c
2019-01-07 17:07:20 -08:00
Rob Carr
30e984ca78 Merge changes from topic "remove-scoped-connection"
* changes:
  Remove usage of scoped connections.
  Allow SurfaceControl to be passed over AIDL.
2019-01-07 20:08:58 +00:00
Felipe Leme
4bc0f6be78 Implemented nested Content Capture sessions.
Test: atest CtsContentCaptureServiceTestCases
Fixes: 121033016

Change-Id: I46bbd05c363cbda8b66704203455411d38c6a025
2019-01-07 10:19:39 -08:00
Manpreet
18ebaa979c Merge "Null locale causing the VTS fail." am: 179f30a443 am: 9568191633
am: e9fe937245

Change-Id: I715e3b8126e1506c9d02f0be278fb8baad396018
2019-01-06 20:53:29 -08:00
Manpreet
e9fe937245 Merge "Null locale causing the VTS fail." am: 179f30a443
am: 9568191633

Change-Id: Iab284dfc831a9079e339c8c23fba8f3e7e4ec04d
2019-01-06 20:44:13 -08:00
Manpreet
9568191633 Merge "Null locale causing the VTS fail."
am: 179f30a443

Change-Id: I8ae92392e70c046194df1c8ebee0bd32ed9513cf
2019-01-06 20:30:46 -08:00
Treehugger Robot
179f30a443 Merge "Null locale causing the VTS fail." 2019-01-07 04:19:22 +00:00
qinyige
0b5ca24a41 Avoid adding node itself as child node.
Apps can call addChild through AccessibilityNodeProvider, so it's
possible that an app adds a node itself as a child node. This will break
down the integrity of UI tree and cause failure to operation in
UIAutomator. Thus I suggest do this integrity check when adding child.

Test: as follows
    - built
    - flashed
    - booted
    - run my test script based on uiautomator

Change-Id: I8cba22a1d9d1a49365c6bce4241ef5067502fb79
Signed-off-by: qinyige <qinyige@xiaomi.com>
2019-01-07 10:31:42 +08:00
Felipe Leme
e127c9a47e Fixed how session created / removed events are generated.
Long-story short, they must be flushed right away...

Test: atest CtsContentCaptureServiceTestCases
Bug: 121033016

Change-Id: I1b3132ad49674d43bf63717f79848b6e4b23b605
2019-01-04 17:54:52 -08:00