Commit Graph

13911 Commits

Author SHA1 Message Date
Jackal Guo
a459b199c1 Support accessibility on embedded hierarchies (2/n)
Introduce AccessibilityEmbeddedConnection. This interface provides
to the host view to the latter can interact with the view hierarchy
in SurfaceControlViewHost.

Bug: 137593247
Test: a11y CTS & unit tests
Change-Id: I9c4f5478c5ecd3bda7f688fa23660f372b59512b
2020-02-11 08:56:10 +08:00
TreeHugger Robot
4b5b834e13 Merge "Fix memory leak in TCMS when TCSession.destroy() is not called." 2020-02-10 22:20:30 +00:00
Valerie Hau
4345673369 Merge "Move BLAST flag to WindowManagerService" 2020-02-10 20:13:42 +00:00
Jorim Jaggi
6043739952 Merge "Refine logic about controlling transient bars" 2020-02-10 19:51:32 +00:00
Steven Thomas
890e80dbd1 Merge "Fix IllegalArgumentException from Surface.release()" 2020-02-10 19:11:08 +00:00
TreeHugger Robot
d0db68c890 Merge "To add new marker to support long edge cutout" 2020-02-10 06:53:49 +00:00
Charles Chen
40eb219600 Merge "Fix AccessibilityInputFilterTest" 2020-02-10 02:12:48 +00:00
TreeHugger Robot
4b41675b13 Merge "Refine surrounding text logic and test case readability." 2020-02-10 02:07:19 +00:00
Greg Kaiser
498fded002 Merge "Revert "Enable insets flag for IME"" 2020-02-08 02:12:56 +00:00
TreeHugger Robot
fef7f67173 Merge "Remove an obsolete comment" 2020-02-08 01:21:25 +00:00
Greg Kaiser
d01913ae83 Revert "Enable insets flag for IME"
This reverts commit 1f0b27532f.

Reason for revert: Crashes android.anim on a wembley
Bug: 149121559
Test: Local build of wembley with this reverted doesn't crash android.anim.

Change-Id: Ie2b9ce95114082d07fa6fddd1ec6d0cb345bd860
2020-02-08 00:24:10 +00:00
Valerie Hau
779af293d4 Move BLAST flag to WindowManagerService
Querying flag property in preloaded class static initialization
removes it from preloading and increases boot time.  Move query
to WindowManagerService instead when constructed

Bug: 148614188
Test: build, boot, adb shell device_config put
window_manager_native_boot wm_use_blast_adapter true/false
check that BLAST adapter is turned on/off as expected

Change-Id: I02e2327b5c2cb11a231d02fc2c5c8c1ac200aaf0
2020-02-07 16:06:03 -08:00
Steven Thomas
408dc961c4 Fix IllegalArgumentException from Surface.release()
ag/9659388 introduced a problem where calling Surface.release() would
possibly result in an IllegalArgumentException. Fix the order of
deletions in release() to avoid this.

Bug: 144862317
Test: Ran a cts test that was failing with the exception, confirmed it
      no longer fails with this CL in place.

Change-Id: Ib3fa67d49457aee304512642afe34ed6a887e6eb
2020-02-07 15:30:10 -08:00
Yabin Huang
5b2fe96610 Merge "Fix View backward navigation bug" 2020-02-07 23:08:38 +00:00
Yohei Yukawa
fbb017ac10 Remove an obsolete comment
This is a follow up CL to our previous CL [1], where we forgot to
remove an obsolete comment, which was dded in our previous attempt to
tackle IME focus handling in InputMethodManager [2].  As the line
mentioned in that CL is now gone, there is no reason to keep that
stale comment.

There should be no behavior change in this CL.

 [1]: Ib455704fe1e9d243f93190a84f230210dbceac2a
      970d9d2e0c
 [2]: I219394178e4172bc47864297f1418e677dba25e5
      5f05965f54

Bug: 141738570
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: Iee92a7eb4dfcfb059b0e1fc105f78dd9bdecbbfc
2020-02-07 14:24:09 -08:00
Evan Rosky
a85b3f1828 Merge "Add hierarchy operations to container transaction" 2020-02-07 19:19:12 +00:00
TreeHugger Robot
7f6598257e Merge "Enable insets flag for IME" 2020-02-07 19:10:16 +00:00
TreeHugger Robot
cceb2c2e61 Merge "Send autofill assist structure data to content capture" 2020-02-07 18:41:58 +00:00
Mihir Patel
4770be2d60 Send autofill assist structure data to content capture
Test: manual
Change-Id: I23339a8f90dbb6c31f473e6163ba0866518cb0a4
Bug: 147232107
2020-02-07 10:40:15 -08:00
TreeHugger Robot
aab0c36259 Merge "Providing new accessibilityNode action" 2020-02-07 17:31:57 +00:00
Tarandeep Singh
1f0b27532f Enable insets flag for IME
Test: atest CtsInputMethodTestCases WindowManagerSmokeTest
      CtsWindowManagerDeviceTestCases CtsInputMethodTestCases
      FrameworksCoreTests
Bug: 111084606
Change-Id: I34b17174cc57fdb1427749dc28664f6bb5b3abca
2020-02-07 08:46:06 -08:00
Tony Mak
53195e0da7 Fix memory leak in TCMS when TCSession.destroy() is not called.
TCMS stores sessions in a Map and remove it when the session is
destroyed. Memory leak happens if the client forget to call
TCSession.destroy() or does not have a chance to call before the process
is dead.

Solution:
1. Use linkToDeath() to remove the cached session when client process
   is dead. TCSessionID now contains a binder to make this possible.
2. Install a Cleaner to TCSession object such that destroy() is called
   whenever the session object is going to be GCed. This is needed
   because some clients may have a long lifecycle, e.g. apps that are
   bounded by system.

BUG:149012454

Test: Write an app that creates a TC session, but not calling destory().
      Then make sure TCMS removed the session in the following situations:
      1. The app is killed
      2. TCSession object is GCed (By forcing GC)
      By checking the output dumpsys textclassificataion, we can know
      that the session object is removed
Test: mts-tradefed run mts-extservices
Test: Sanity test: smart selection + smart replies

Change-Id: Ifb7dcb23e1f50d4b3e97a6ce40e63b57193f2892
2020-02-07 11:54:26 +00:00
Chris.CC Lee
4de5306e7e Refine surrounding text logic and test case readability.
1. Follow up refinement for CL[1].
2. Test case to verify the InitialSurroundingText parcel
wrapping/unwrapping logic.

[1] c486acc4d2, Ie04f2349b1157408aa8ed9044aea12ce99132cb4

Bug: 148035211
Test: atest FrameworksCoreTests:EditorInfoTest
Change-Id: I9609b8a7dabb6285ed673cb0890bb3019e3b7caa
2020-02-07 19:15:40 +08:00
Tiger Huang
a166340304 Refine logic about controlling transient bars
- Use copied InsetsSourceControl to prevent the leash from being
  released while the control gets revoked while playing transient
  bar animations.
- Start the animation after mAnimationControl gets assigned to prevent
  NullPointerException.
- Let SystemUI to change the bar mode to transient mode before WM
  plays the transient bar animation.
- Remove a redundunt call to the super method.
- Fix InsetsPolicyTest
- Fix InsetsStateControllerTest
- Fix misc things

Bug: 118118435
Test: Manually swipe to show transient bars many times.
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest RegisterStatusBarResultTest
            ViewRootImplTest DisplayPolicyInsetsTests
            DisplayPolicyTests TaskSnapshotSurfaceTest
            InsetsAnimationControlImplTest
Change-Id: I7d445b7dc6f47a64048937cd439bdd5ffa7fa3a3
2020-02-07 18:19:21 +08:00
Felka Chang
489cf260aa To add new marker to support long edge cutout
Currently, the cutout only exists in short edge of a display. It means
that the cutout only locates in short edge of the display in portrait
mode. The method to parse the cutout only supports top boundary or bottom
boundary cutout.

To modify the parser of cutout specification supports the long edge cutout
feature. CutoutSpecification handles the parsing rulers extracted from
DisplayCutout.

In order to make parsing faster, it doesn't use regular expression to parse
specification and String.split.

Test: atest \
    FrameworksCoreTests:android.view.DisplayCutoutTest \
    FrameworksCoreTests:android.view.CutoutSpecificationTest \
    SystemUITests:com.android.systemui.ScreenDecorationsTest \
    CorePerfTests:android.view.CutoutSpecificationBenchmark

Bug: 146875639
Change-Id: Ice3ad28ef29a6f11875c4946cf4a60ee792f1270
2020-02-07 16:30:05 +08:00
Charles Chen
4741084716 Fix AccessibilityInputFilterTest
The root cause is that we use WM#getCurrentMetrics(New API) instead of
Display#getSize in ViewConfiguration .
However, we use a stub display in AccessibilityInputFilterTest, which
don't have a corresponding DisplayContent in WMS.
Use getDisplayContentOrCreate to create a DisplayContent if it is not
yet created, and throws exception if display object is invalid.

fixes: 148823816
Test: atest AccessibilityInputFilterTest
Test: atest WindowMetricsTests

Change-Id: I36c6b020faafebbf609a46dfdeb0c9580e115e01
2020-02-07 16:16:48 +08:00
Evan Rosky
a8fde159c7 Add hierarchy operations to container transaction
Also add a way to query for child containers of a container.

Combined, these provide enough flexibility to re-arrange
containers to system-ui. For now, it is locked-down a bit so
it only provides children of TaskTiles and can only reparent
ActivityStacks. Eventually, this can be expanded for nested
tasks or display areas.

Bug: 133381284
Test: Added TaskTileTest#testHierarchyTransaction
Change-Id: Id0e89a4e4b9352d9392349c4e1fe7d69b4f9f212
2020-02-06 20:11:01 -08:00
Joanne Chung
c3348eb824 Merge "Add missing tests for inline input part." 2020-02-07 02:38:41 +00:00
Jacky Kao
a3419bab91 Providing new accessibilityNode action
Removed this constant variable, TextView.ACCESSIBILITY_ACTION_IME_ENTER,
and added more description for new accessibility action,
ACTION_IME_ENTER.

Bug: 139380257
Test: a11y CTS tests & unit tests
Change-Id: I929262aa0046640aafe36a2dc2a8896ee7cab9ff
2020-02-07 07:30:57 +08:00
Yvonne Jiang
43361f713d Merge "Update secondary lock screen implementation to use the newly updated SurfaceControlViewHost API." 2020-02-06 23:02:49 +00:00
TreeHugger Robot
c5bd42701b Merge "Fix an issue that it is impossible to have multiple active sessions" 2020-02-06 21:31:08 +00:00
TreeHugger Robot
799de92e69 Merge "SurfaceView: Show SurfacePackage child when reparenting" 2020-02-06 20:34:09 +00:00
Tony Mak
2cfc5bb18b Fix an issue that it is impossible to have multiple active sessions
Root cause:
TCM caches SystemTC. TCM.createTCSession returns a wrapper of
the same SystemTC and it just updates the sessionID
(and some other session related stuff) of the shared system TC.
That means, if clients call createTCSession multiple times for multiple
active sessions, all of these session TCs have the same session ID
(the latest one) because they all point to the same SystemTC.

It has been an issue since P. But we don't really have code that creates
multiple active sessions before R. In R, we create a session per each
notification, and thus hit the bug.

Solution:
Don't cache SystemTC. SystemTC is just a thin wrapper that forwards calls
to TCMS anyway.

BUG: 149012454
Test: atest CtsTextClassifierService (Added a new test in ag/10260978.)
Test: Sanity tests: smart selection and smart replies are still working.

Change-Id: I71fe558b2f3d2c5d9eb0b6fc7f258fb4d8ad48d6
2020-02-06 17:58:58 +00:00
TreeHugger Robot
a7db3c8e79 Merge "Add a flag to allow system health experiment for the behavior change ... of getDefaultTextClassifierImplementation()" 2020-02-06 11:50:42 +00:00
Joanne Chung
8792ff2e4d Add missing tests for inline input part.
Remove comment due to test is ready.

Bug: 146453105
Test: atest CtsInputMethodTestCases:android.view.inputmethod.cts.InlineSuggestionInfoTest
Test: atest CtsInputMethodTestCases:android.view.inputmethod.cts.InlineSuggestionsRequestTest
Change-Id: I968ab360cae93c895e6cfeae76e15c2205f5a7e6
2020-02-06 18:00:48 +08:00
Adrian Roos
bbf42404b7 IME: Dispatch onProgress directly during app-driven onReady
Fixes and issue where the initial frame of an app-driven transition would flicker
because onProgress would only be called after the first frame had been rendered.

Bug: 111084606
Test: atest WmTests
Change-Id: I312ba27d95aaeb69c94bbdba39ee423ed38ffdac
2020-02-05 17:18:39 -08:00
Robert Carr
20c62d2dba SurfaceView: Show SurfacePackage child when reparenting
Since we aren't exposing the SurfaceControl in the public API
we need to show it for the user.

Bug: 134365580
Bug: 147303389
Test: SurfaceControlViewHostTests
Change-Id: Icec1384aeb50eef0261f3591a250f02f47737f66
2020-02-05 16:38:27 -08:00
Tony Mak
4624cdd12e Merge "Make TCS.getDefaultTextClassifierImplementation returns a ... SystemTextClassifier that is backed by ExtServices" 2020-02-05 14:44:39 +00:00
Tony Mak
df5d4bff7e Add a flag to allow system health experiment for the behavior change ...
of getDefaultTextClassifierImplementation()

Once the system health experiment is done, revert this change and
remove the local TC.

Test: Manual
1. Set use_default_system_text_classifier_as_default_impl to be false
   by using device_config command. Select a phone number.
   Verify the phone action is shown. Verify dumpsys textclassification
   shows that default TC is bound.

2. Set use_default_system_text_classifier_as_default_impl to be true.
   Reboot the device.
   Select a phone number and verify the phone action is shown.
   Verify dumpsys textclassification shows that the default TC
   is not bound.

BUG: 148049185
Change-Id: I602c3cb6d7bef468cba50be6ed8d799d79af8240
2020-02-05 11:43:07 +00:00
Marin Shalamanov
1ee05fd7b9 Merge "Update HDR capabilities and color modes when display changes." 2020-02-05 06:36:05 +00:00
Jacky Kao
dc50df397b Merge "Changing the return type of takeScreenshot() (1/n)" 2020-02-05 05:53:34 +00:00
Svetoslav Ganov
3e2213e035 Merge "Providing new accessibilityNode action" 2020-02-05 03:45:32 +00:00
Marin Shalamanov
677d3a7800 Update HDR capabilities and color modes when display changes.
Pair: blindahl
Test: manual
Test: atest LocalDisplayAdapterTest
Bug: 146824575
Change-Id: I3cd1db3fc3b1df34c2af5e7c3f6905bca9bcbec5
2020-02-05 03:41:45 +01:00
Yvonne Jiang
7f97f732d7 Update secondary lock screen implementation to use the newly updated SurfaceControlViewHost API.
Previously we passed back a SurfaceControl to the keyguard, updated to pass a SurfacePackage instead. The updated SurfaceControlViewHost logic addresses underlying accessibility bugs.

Bug: 136085151
Test: atest AdminSecondaryLockScreenControllerTest
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: I4881d5766f118b99f497ee306cd71d3c5a65a2f3
2020-02-04 15:44:13 -08:00
TreeHugger Robot
4a15b70b66 Merge "Fix BLAST Surface release" 2020-02-04 22:41:40 +00:00
Tony Mak
c5a7432ebf Make TCS.getDefaultTextClassifierImplementation returns a ...
SystemTextClassifier that is backed by ExtServices

1. The default textclassifier is always provided by
   config_servicesExtensionPackage (i.e. ExtServices)
2. OEM can specify a system text classifier by specifying
   config_defaultTextClassifierPackage.
3. System text classifiers can get an instance of the default textclassifier
   by calling TCS.getDefaultTextClassifierImplementation(), so that
   they can add their customization on top of the default TCS.
4. If config_systemTextClassifierPackage is set, the specified package
    is used to process requests from apps and the platform. Otherwise,
   the default textclassifier is used.
5. For testing and droidfooding purpose, text classifier service package
   can be overridden. If the overridden package is neither
   the default one nor the system one, the package is considered as a
   untrusted text classifier, which can only see requests from itself.

Test: m mts && mts-tradefed run mts-extservices
Test: Not setting config_defaultTextClassifierPackage. Select some text and
      make sure smart selection works. Run dumpsys textclassification
      to make sure the default TCS is bound.
Test: Setting config_defaultTextClassifierPackage and repeat the above.
      Make sure the specified OEM text classifier is used.
Test: Set the service override config to be ExtServices.
      Run dumpsys textclassification to make sure everything is unbound.
      Select some text and make sure ExtServices is bound.
Test: Set the service override to be AiAi and repeat the above.
Test: Set the service to be something invalid and repeat the above.
      Observe that no TC is bound and fallback to NO_OP.

BUG: 148049185

Change-Id: Ia2fb549fda49363e0d0ebc4b7e0d31cb76e11ee0
Make TCS.getDefaultTextClassifierImplementation returns a ...
SystemTextClassifier that is backed by ExtServices

1. The default textclassifier is always provided by
   config_servicesExtensionPackage (i.e. ExtServices)
2. OEM can specify a system text classifier by specifying
   config_defaultTextClassifierPackage.
3. System text classifiers can get an instance of the default textclassifier
   by calling TCS.getDefaultTextClassifierImplementation(), so that
   they can add their customization on top of the default TCS.
4. If config_systemTextClassifierPackage is set, the specified package
    is used to process requests from apps and the platform. Otherwise,
   the default textclassifier is used.
5. For testing and droidfooding purpose, text classifier service package
   can be overridden. If the overridden package is neither
   the default one nor the system one, the package is considered as a
   untrusted text classifier, which can only see requests from itself.

Test: m mts && mts-tradefed run mts-extservices
Test: Not setting config_defaultTextClassifierPackage. Select some text and
      make sure smart selection works. Run dumpsys textclassification
      to make sure the default TCS is bound.
Test: Setting config_defaultTextClassifierPackage and repeat the above.
      Make sure the specified OEM text classifier is used.
Test: Set the service override config to be ExtServices.
      Run dumpsys textclassification to make sure everything is unbound.
      Select some text and make sure ExtServices is bound.
Test: Set the service override to be AiAi and repeat the above.
Test: Set the service to be something invalid and repeat the above.
      Observe that no TC is bound and fallback to NO_OP.

BUG: 148049185

Change-Id: Ia2fb549fda49363e0d0ebc4b7e0d31cb76e11ee0
2020-02-04 20:36:52 +00:00
Robert Carr
3e5f001d30 Fix BLAST Surface release
The call to relayout may release the SurfaceControl for us by
reading back a null parcel. In this case remove will throw an exception.
We could check is valid, but actually we don't need to call remove
just release, which doesn't throw an exception if already released.

Bug: 146598493
Bug: 148692069
Test: Flip USE_BLAST_ADAPTER device boots.

Change-Id: I38ee8df702dc2645ca5da980bebdc5ac32a7a065
2020-02-04 11:07:18 -08:00
TreeHugger Robot
ae19a2d596 Merge "Fix Keyboard won't show up in some cases" 2020-02-04 08:13:29 +00:00
lumark
233164c924 Fix Keyboard won't show up in some cases
Commit 970d9d2 introduced IME focus controller which
added a new method View#hasImeFocus to restrict IME focus
only when the focused window won't have either FLAG_NOT_FOCUSABLE
or FLAG_ALT_FOCUSABLE_IM flags.

Since NotificationShadeWindowController will unset both flags when
RemoteInput active (or when PasswordEntry focused on lockscreen).

But, in ImeFocusControler#onTraversal won't keep update View#hasImeFocus
state, it will affect IME focus handle correctness.

Hence, it needs to fix View#hasImeFocus state update issue.

Fix: 148489857
Fix: 148788569
Bug: 141738570
Test: manual as following steps:
Case 1:
 0) make EditTextVariations
 1) adb install -r EditTextVariations.apk
 2) adb shell am start -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 3) Tap the 3-dot menu on the EditTextVariations
 4) Tap `Direct Reply` on the menu
 5) Open notification drawers
 6) Try to direct-reply on the notification, expect soft-keyboard should come up after step 6)

Case 2:
 1) Device set up with Pwd lockscreen security. Finish setting up the device.
 2) Once the device goes into sleep mode > Wake up the device > Swipe up locksreen.
 3) Observing that the keyboard should come up consistently.

Change-Id: I8d4fff94ba9313b773bc27fcbd019cc88580d3e9
2020-02-04 11:04:52 +08:00
Evan Rosky
ed187ae698 Merge "Pass through some input-related layout flags for windowless surfaces" 2020-02-04 00:23:58 +00:00