Commit Graph

13871 Commits

Author SHA1 Message Date
Tony Mak
4624cdd12e Merge "Make TCS.getDefaultTextClassifierImplementation returns a ... SystemTextClassifier that is backed by ExtServices" 2020-02-05 14:44:39 +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
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
TreeHugger Robot
5e135fe823 Merge "Adapt SurfaceControl to libgui API for display info" 2020-02-03 22:29:43 +00:00
TreeHugger Robot
27e12881e4 Merge "Use FrameworkStatsLog instead of StatsLog" 2020-02-03 21:36:22 +00:00
TreeHugger Robot
3d08de1582 Merge "Fix segfault in ViewRootImpl on BLAST" 2020-02-03 19:24:35 +00:00
TreeHugger Robot
d7b27259b3 Merge "Fix no-op traversal requested in traversal before layout" 2020-02-03 18:32:45 +00:00
Evan Rosky
680377e1cb Pass through some input-related layout flags for windowless surfaces
Add a new API to update a previously-granted input channel. This
currently only supports changing layout param flags, and, for
those: only supports NON_TOUCHABLE and SLIPPERY

Bug: 133381284
Test: Added WindowlessWmTests#testDisableTouchInput
Change-Id: I29f70cde0eb646663c0a0ad058979845e732cee7
2020-02-03 10:13:37 -08:00
Valerie Hau
f0a24dd2be Fix segfault in ViewRootImpl on BLAST
Recent deferTransaction change created
bootloop when BLAST is turned on
Bug: 146345307
Test: build, boot, manual

Change-Id: Ib5e484c39d11260026694fc2a32015d8a7f04baf
2020-02-03 10:00:01 -08:00
Muhammad Qureshi
e2b2432bc6 Use FrameworkStatsLog instead of StatsLog
As part of statsd becoming a Mainline module in R, autogenerated
StatsLog.write() calls are going away and replaced by
*StatsLog.java
that is autogenerated for each module.
This CL replaces some usages of StatsLog with
FrameworkStatsLog.

Bug: 145952197
Test: m
Change-Id: Iaa2db34a7be4c3215f62cc36661ba8ac81656baa
2020-02-03 09:17:40 -08:00
TreeHugger Robot
afc185e97d Merge "Implement Transient Insets Animation" 2020-02-03 05:44:38 +00:00
Yunfan Chen
b5d2db7738 Implement Transient Insets Animation
This implements the transient insets animation. To have InsetsPolicy run
the animation, this patch:
1. Let InsetsPolicy implements InsetsAnimationControlCallbacks;
2. Make several properties, methods and subclasses in InsetsController
   public, to let InsetsPolicy re-use them when possible.
3. Do everything necessary in InsetsPolicy to let the animation run
   correctly.

Other misc changes in this CL includes:
1. Removed some un-necessary imports;
2. Implemented two toString method, for debug purpose.

Bug: 118118435
Test: Manual test with the new Insets API test app, everything works as
      expected;
Test: go/wm-smoke
Test: atest InsetsPolicyTest

Change-Id: I6c45bd557573fcabb1a3f5aea3dcd58229280613
2020-02-03 12:31:34 +09:00
Jorim Jaggi
0e1ac39a06 Merge "Replace OnContentApplyWindowInsetsListener with simple boolean" 2020-02-01 15:44:51 +00:00
Jorim Jaggi
6e50bae678 Merge "Keep track of requestedVisibility when control unavailable" 2020-02-01 13:47:09 +00:00
Jorim Jaggi
3182ef1488 Keep track of requestedVisibility when control unavailable
When control is unavailable, but the client still wants to hide or
show something, we keep track of it and execute the animation as
soon as we get control.

Also fix an issue with a crash where control was lost before
animation was started.

Test: InsetsControllerTest, InsetsSourceConsumerTest
Change-Id: I31c5177d9281161b8a607b24ddf094dbba640da3
2020-02-01 13:04:59 +01:00
Jorim Jaggi
1f08f649c8 Replace OnContentApplyWindowInsetsListener with simple boolean
The concept will move into the support library (androidx), so in
the framework we only need a simple boolean to toggle the default
behavior.

Also remove redundant methods on WIC to control IME.

Bug: 143556682
Bug: 118118435
Test: WindowTest CTS
Change-Id: I30fbffdfbe79a57b0f4166f0657c78370c7bcf02
2020-02-01 12:51:42 +01:00
Jorim Jaggi
9964f40cd2 Merge "Add missing visible frame copy" 2020-02-01 00:53:57 +00:00
Evan Rosky
0037e5f901 Add TaskTile concept to Window Manager
This adds the concept of a TaskTile to the WM. Due to
complexities in the current Stack/Task relationship, tiles
can't actually be part of the hierarchy, so the Stack
level has to internally resolve configurations as if they
were.

The TaskTiles themselves *are* ActivityStacks though from
the client/sysui perspective, though.

Bug: 133381284
Test: Added TaskTileTests
Change-Id: I9baad5ec899b4fab323a36c1533a40081727a2f7
2020-01-31 10:26:45 -08:00
Jorim Jaggi
4d4fae4ab8 Add missing visible frame copy
Test: Inspect systrace, ensure not a constant ping-pong between
apps and server
Test: InsetsStateTest
Bug: 118118435

Change-Id: I35937971897cf76ad9187c7c23a7abf394d59e46
2020-01-31 17:30:01 +01:00
Jacky Kao
3e33bedee0 Changing the return type of takeScreenshot() (1/n)
Roll back the method, takeScreenshot(), of the UiAutomationConnection
class using by the UiAutomation class due to the return type of the
method, takeScreenshot(), of the AccessibilityService class, isn't
the Bitmap. Besides they also used the different methods of the
SurfaceControl class now.

Bug: 10931661
Test: a11y CTS tests
Change-Id: I7459ebfe77162e51ed3a50c8663e13579a8a67a3
2020-01-31 10:31:11 +08:00
Andrii Kulian
e11e951f66 Merge changes from topic "add_bundle_to_window_context"
* changes:
  Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b
  Add bundle options to Context#createWindowContext API
2020-01-31 01:16:34 +00:00
Andrii Kulian
e57f2dc246 Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b
Replace the existing usages of now-deprecated API
WindowManager.getDefaultDisplay() with WindowMetrics or
Context.getDisplay() in frameworks/base.

Bug: 128338354
Test: Build, auto test
Change-Id: I02d38a022c5e0e6e9d699f03d35b65d6c8126da9
2020-01-31 01:15:21 +00:00
Taran Singh
397101302b Merge "Change insets property from wm to debug." 2020-01-30 22:26:07 +00:00
Jorim Jaggi
1edbc80971 Merge "Adjust SysUI for new insets" 2020-01-30 21:09:23 +00:00
Andrii Kulian
ad820a0ebd Merge "Deprecate Display#getSize/RectSize/Metrics" 2020-01-30 20:47:02 +00:00
Jorim Jaggi
026ed75dbd Adjust SysUI for new insets
- Layout of notif shade is no longer custom, so need to handle
insetsIgnoringVisibility on client.
- Do not special case Keyguard anymore. Just treat it as regular
control target.
- No more special sauce to hide navigation bar on Keyguard.
- Treat it as BEHAVIOR_SHOW_TRANSIENT_BARS_ON_SWIPE but don't
actually do that in DisplayPolicy

Test: InsetsPolicyTest
Test: Lockscreen with PIN
Bug: 118118435
Change-Id: I1edce4fdb792fd97a181165a03957ba5d6d3e551
2020-01-30 18:23:25 +01:00
Tarandeep Singh
f2316be9c8 Change insets property from wm to debug.
persist.wm is not editable on user builds, changing it to debug so it is
editable. Making the change so its flippable on dp1.

Bug: 111084606
Test: atest CtsInputMethodTestCases
      Manually verified adb shell setprop persist.debug.* is editable on
      user build.
Change-Id: I693abad22d2b087f0df6ac5c138ba942252cc620
2020-01-29 17:51:36 -08:00
Dominik Laskowski
69b281d5f3 Adapt SurfaceControl to libgui API for display info
Bug: 144601064
Test: dumpsys display
Change-Id: I477e0e3126cc15eb5f120610b4e6b6b1568df389
2020-01-29 14:32:45 -08:00
Jorim Jaggi
23a02a9f67 IME always provides bottom insets, if any
This fixes an issue where IME wasn't visible in landscape with a
cutout, because IME window didn't cover full edge.

Also fix an issue where floating IME didn't work because alpha
was calculated the wrong way.

Test: InsetsSourceTest
Bug: 111084606
Change-Id: I29b7a45cd590a52ecb03f2e539edde57aef4dba3
2020-01-29 21:42:27 +00:00
Jorim Jaggi
abaa904348 Hide IME when loosing control
Because we can't restore IME visibility yet, we update requested
visibility whenever we loose control.

Bug: 111084606
Test: Set password as screen lock, then open status bar while
unlocked.

Change-Id: I476e05dd4ec24b9e4d78ea585e43e698b87b30a5
2020-01-29 21:41:59 +00:00
Sergey Volnov
e453dcef3b Merge "Got rid of cancellation signals in the Content Capture Data Sharing" 2020-01-29 20:24:48 +00:00
Philip Quinn
2116f0e58b Merge "Move ViewConfiguration#AMBIGUOUS_GESTURE_MULTIPLIER to config.xml." 2020-01-29 19:24:53 +00:00
Riddle Hsu
7d5780c351 Fix no-op traversal requested in traversal before layout
Commit f64e134 (2652da8) eliminates the unconditional resize from
the first layout. But IME window may rely on the additional resize
to trigger the 3rd layout pass to compute its final size, otherwise
the height of navigation bar isn’t accounted for IME window.

The layout steps of initializing IME window:
a. Add root view (ViewRootImpl setView -> requestLayout).
b. Layout pass 1: apply window insets (WindowInsetsListener of
    InputMethodService ~ DecorView#updateColorViews
    -> addView (navigation bar background) -> requestLayout).
c. Layout pass 2: almost no-op because pass 1 cleared
   ViewRootImpl#mLayoutRequested (performLayout is called
   after dispatchApplyInsets).

So if pass 2 performs measure and layout correctly, the 3rd layout
pass is not needed. As the comment of the first place that clears
mLayoutRequested (in ViewRootImpl#performTraversals), the layout
request during traversal should be caught for performing next full
layout pass.

Fix: 147857963
Test: atest OnScreenPositionTest#testImeIsNotBehindNavBar

Change-Id: Ib9c116fb81cd41c2df30ab81c0f0594c489cebf9
2020-01-29 17:01:25 +00:00
Sergey Volnov
439294404f Got rid of cancellation signals in the Content Capture Data Sharing
Motivation: if the Content Capture service want's to end the session, it
can close the read-fd, while not have finished reading, and that would
result in an exception in the system server, that can later be
propagated to the caller as an error.

Similarly, timeout of the sharing session can be reflected as an error
with a specific error code.

Test: built Android locally and perfomed a manual test.
Bug: 145203958
Change-Id: Iaeb45e0ab68da9fe30dce1ae4eab2354ef56d827
2020-01-29 15:31:00 +00:00
Andrii Kulian
0271e57bfe Deprecate Display#getSize/RectSize/Metrics
Applications should use WindowMetrics obtained from visual contexts
for UI-related inquiries.

Bug: 128338354
Test: Build, auto test
Change-Id: I685ed4db93c25a05b1f2188e399767d33e5d1a49
2020-01-28 21:00:09 -08:00
Andrii Kulian
ea325634d3 Add bundle options to Context#createWindowContext API
Add Bundle parameter to createWindowContext method to allow
passing window-related options.

Bug: 128338354
Test: Build, auto test
Change-Id: I19cf9335068ecf94c9d94a99be0e8f1021f78e34
2020-01-28 17:52:57 -08:00
Danny Epstein
dab6c77154 Merge "Don't draw default focus highlight unless focused." 2020-01-28 22:48:32 +00:00
TreeHugger Robot
42ce71195c Merge "Handle controlInputMethodAnim correctly when IME isn't ready" 2020-01-28 21:09:07 +00:00
Rob Carr
55a32151b4 Merge "WM: Defer transactions for BLAST Surfaces too." 2020-01-28 20:19:18 +00:00
Rob Carr
c847a7ad12 Merge "ViewRootImpl: Always run finishBLASTSync" 2020-01-28 19:32:53 +00:00
Jorim Jaggi
d7f10ed088 Handle controlInputMethodAnim correctly when IME isn't ready
- Store pending control request when request needs to go over IME
- Abort pending control request when losing control
- Use timeout in case we haven't heard back from IME

Test: InsetsControllerTest
Bug: 111084606
Change-Id: Icb6a9d8ad9134f8cb836e15c09c2b2295219fc15
2020-01-28 20:24:02 +01:00
TreeHugger Robot
e428a2cc04 Merge "Deprecate Canvas.EdgeType" 2020-01-28 18:13:01 +00:00