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
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
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
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
Recent deferTransaction change created
bootloop when BLAST is turned on
Bug: 146345307
Test: build, boot, manual
Change-Id: Ib5e484c39d11260026694fc2a32015d8a7f04baf
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
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
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
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
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
Test: Inspect systrace, ensure not a constant ping-pong between
apps and server
Test: InsetsStateTest
Bug: 118118435
Change-Id: I35937971897cf76ad9187c7c23a7abf394d59e46
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
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
- 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
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
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
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
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
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
Applications should use WindowMetrics obtained from visual contexts
for UI-related inquiries.
Bug: 128338354
Test: Build, auto test
Change-Id: I685ed4db93c25a05b1f2188e399767d33e5d1a49
Add Bundle parameter to createWindowContext method to allow
passing window-related options.
Bug: 128338354
Test: Build, auto test
Change-Id: I19cf9335068ecf94c9d94a99be0e8f1021f78e34
- 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