Fixes a compatibility issues, where apps that were not expecting
a cutout were dispatched one anyway, which caused the WindowInsets
dispatch to continue down the hierarchy even though the SystemInsets
were consumed by the app.
To avoid this, we pre-emptively consume the cutout for any apps that
did not request to be laid out in the cutout area. This is safe,
because for apps that don't request it, the status bar will take care
of consuming it, or they won't be laid out in the cutout at all.
If apps still need to know where the cutout is, they can query for it
via View.getRootWindowInsets().
Fixes: 65689439
Bug: 70490585
Test: atest android.view.cts.DisplayCutoutTest
Change-Id: If06674c619f095d4105be1b3a511fb5823b63d2b
Our automated tests should have caught this issue, but they weren't run
on the offending cl (I294f7e4d16c98c6512d56d08d488b204c1f91d47).
Fixes: 70279108
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Change-Id: I99ced41a7c92bece02754fc72966c5440752d8d6
First CL that introduces SurfaceAnimator/LockFreeAnimator
We start our synchronized app transition journey by showing that
the concept works by using WindowState animations as proof of
concept.
The main class in this CL are SurfaceAnimator and
SurfaceAnimatorRunner. When we start an animation on a Window, we
create a new bufferless surface, called "The Leash", in the
hierarchy and attach the surface of WindowState onto it, while
attaching the leash onto the old surface parent which is still
responsible for z-layering.
Then, we pass off the Leash into SurfaceAnimationRunner, which then
changes the surface properties of Leash in every animation frame,
without holding the WM lock. While it's doing that we can still
update the z-layering of the window, or even relayout the window
of needed - the important surfaces for this are still under WM's
control.
In case the animation is finished the window surface gets
reparented to its original parent, and the leash is abandoned.
Note that the reparenting is done in the same transaction as
processing the animation finish, such that we don't end up with
a flicker in case of a disappearing animation, where the window
surface gets destroyed.
In case the animation needs to be cancelled, WM can revoke control
of the leash by reparenting the window surface. Even if the
cancellation signal is heavily delayed, WM immediately regains
control over the surface by reparenting it within a transaction.
We also introduce the concept of animating a WindowContainer. We
clean up isAnimating:
- isLocalAnimating: is the container itself animating
- isAnimating: is the container or one of its parents animating
- isSelfOrChildAnimating: is local animating or any child
animating.
SurfaceAnimationRunner also needs it's own thread so it's not getting
bogged down by any WM lock contention by processing regular
animation frames. We call that thread android.anim.lf (lockfree).
Now, imagine that SurfaceAnimationAnimator would sit behind an IPC in
another process and instead of animating WindowState, we'd animate
AppWindowToken. Then, synchronized app transitions would be done.
Test: go/wm-smoke
Test: SurfaceAnimatorTest
Test: SurfaceAnimationRunnerTest
Test: WindowContainerTests
Bug: 64674361
Change-Id: I10d41f7a289ab2158da3f2f1c3ddd78edd1efc86
Exempt-From-Owner-Approval: Tiny change unrelated to display management.
This CL mirrors changes made to the android.support.annotation version
of IntDef, to keep the usage and semantics identical (though the
internal version of @IntDef and @LongDef are of course hidden and not
part of the SDK.)
Test: These annotations have source retention and therefore have
no runtime impact; the change was compiling the SDK.
Change-Id: Idaf47e8d983c88be1bd8f938615c86611014b45a
Behaves pretty much the same as @IntDef, but now supports "suffix"
in addition to "prefix" when matching constants.
Test: manual docs output looks sane
Bug: 70406696
Change-Id: I35064b0f9f36f1f13ccdb40302d818a004014f15
InputMethodManager is public InputMethod API for apps. The methods
that take Window-token as parameter are restricted to system
and/or IME developers. Such methods should really live
in InputMethodService.
This CL deprecates such methods in IMM and moves them to IMS.
This is the first step towards simplifying IME APIs.
Bug: 70282603
Test: atest InputMethodManagerTest
Change-Id: I3163f3cbe557c85103ca287bee0874a3b4194032
Add policy around how the display cutout should influence window layout:
- if not requested, windows should not overlap with the display cutout
- except windows that asked for LAYOUT_IN_SCREEN | LAYOUT_INSET_DECOR,
which overlap only with a top cutout, provided they did not request any FULLSCREEN mode.
- the content frame must never overlap with the display cutout
- adds FLAG2_LAYOUT_IN_CUTOUT to explicitly ask to be laid out in the cutout area.
Bug: 65689439
Test: atest com.android.server.policy.PhoneWindowManagerLayoutTest
Change-Id: I3a966bc78ef7a4e076104a996799369c60ab7de1
This change adds support for VR-only IMEs in InputMethod framework.
In order to set this VR IME, setVrInputMethod(ComponentName) should be
called by VrManager.
When VrManager calls setVrInputMethod(), IMMS changes updates
the selected input method in a transient way i.e. it doesn't
update the Settings or input history. Once VR mode finishes,
it restores last input from settings.
Bug: 63037786
Test: Manually using the sample app in bug.
Change-Id: I1db7981b5198e7e203d4578cae7e5b6d20037d0d
Adds the logic to dispatch a DisplayCutout from DisplayFrames
through WindowState to the View hierarchy. Does however not yet
change how windows are laid out in response to a DisplayCutout.
The display cutout is currently never present, the following CL
will add logic to emulate a display cutout on devices that do
not have a physical one.
Bug: 65689439
Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/wm/WindowFrameTests.java
Change-Id: Ie4cd4b575755b66a7ffead31e28640983ef4894e
- Dont create a session if the component is not owned by the calling UID.
- Log metrics for forged attempts.
- Avoid possible NPEs on AutofillManager when context or client is null.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.VirtualContainerActivityTest#testAppCannotFakePackageName
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases
Bug: 69981710
Change-Id: I9695bc046f3eb8aeecfe44f80fd0366f68b2c635
Bitmaps created from SurfaceControl.screenshot are hardware Bitmaps. In
order to update the size for the screenshot preview, the Bitmaps need to
be converted to software Bitmaps first.
Also updated the SurfaceControl docs to make this clear.
Fixes: 69929720
Test: Notifications from lock screen and status bar show the screenshot
preview.
Change-Id: Iebc4a261216f3d965e1c98a77c27cc0cb2e442af
Dirty rect offsets and canvas offsets were incorrectly set.
Cherry picked from: b02004c5e4ecfc9b1df49200ebcaa24883c35b0e
and 223fee602408fdd62ac23f7d59406ffe7719e6be.
Test: Resize a test app with HW acceleration disabled. Confirm no
regressions with HW enabled - eg. Gmail.
Bug: 63601140, 64402035
Change-Id: I3e1cea4dc354457b794d3cc50456a27073cb96a0
In order to support VR-only InputMethod, new attribute 'isVrOnly' is
added.
Bug: 63037786
Test: atest InputMethodInfoTest
Change-Id: Iab936df9972212f56277ef9c18d9e1f67f92a913
Simple mistake. Change from one branch didn't get propagated forward
during review.
Bug: 69974273
Test: Boots
Change-Id: I4df8a939f2b38202ada2d1dc150b56ec5dc8f496
A signature is a tag that a TextClassifier may use to identify an
object it returned for a given query. This is useful for logging
purposes.
This cl also removes:
- TextClassification.getLogType() and related logging.
This is already covered by selection event logging.
- TextClassification.getVersionInfo(),
TextSelection.getVersionInfo()/getSourceClassifier().
These are now featured in the signature.
TODO: Write a container class that generates and parses signatures.
Bug: 69791269
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I294f7e4d16c98c6512d56d08d488b204c1f91d47
Now instead of using FillResponse.setFieldDetection() with an object that
contains both the autofill ids an the user data, service must:
- Set global mapping through AutofillService.setUserData()
- Pass just the autofill ids to FillResponse.setFieldClassificationIds()
This CL is purely a refactoring CL - although the new API supports multiple
values and multiple fields, the implementation is still hardcode for one
value and one field (as before).
Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest
Test: atest CtsAutoFillServiceTestCases:UserDataTest
Test: atest CtsAutoFillServiceTestCases:FillResponseTest
Bug: 68045531
Change-Id: I8d846d817dfcde3a4db7abff798bb2250e1c4e7b
Bug: 68846316
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I84c652cb953f1af9b1c4077fa2a13ae23689c48b