The root cause is that only the top cutout spec was cached.
Now cache the full spec string.
Bug: 145983914
Test: atest android.view.DisplayCutoutTest#fromSpec_setsSafeInsets_top_and_bottom, android.view.DisplayCutoutTest#fromSpec_setsSafeInsets_top -- --abi x86
Test: atest DisplayCutouTest, ScreenDecorationTest
Change-Id: I21ef26e5453412ec659b1d05798b61f04c3d660b
Merged-In: I1d5663ebd8588021387b7ae5296851769954f996
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.
Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I288969b0c22fa3a63bc2e71bb5009fe4a927e154
Merged-In: I288969b0c22fa3a63bc2e71bb5009fe4a927e154
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.
Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I5be7335b23a92b8ac80d2fd890198273b66ad644
Merged-In: I5be7335b23a92b8ac80d2fd890198273b66ad644
By default cutouts are centered and support a @right marker to allow
them to be right aligned. Let's also support left alignment by
introducing a @left marker.
Test: atest DisplayCutoutTest
Test: manual
Bug: 143222961
Bug: 145707162
Change-Id: Ic5a645bd9f0513f3665f31c8b0f1861585bf30e6
Merged-In: Ic5a645bd9f0513f3665f31c8b0f1861585bf30e6
(cherry picked from commit 6e9636c5e0)
userId is a new field added in ag/8350816, and it is written in between
some old fields when we parcelize it.
That breaks AiAi because some of its code rely on the implementation
details of SelectionEvent.writeToParcel.
In the long run, we may want to update AiAi such that it works
without this assumption, but before that, let's fix that in platform
for now.
Bug: 145962464
Bug: 123232892
Test: atest FrameworksCoreTests:android.view.textclassifier.SelectionEventTest
Merged-In: I98137a095cddf0fb4c600e1e09eef507bb750528
Change-Id: I66f65ac4c81ca964f710404fd081496355276435
(cherry picked from commit 642c22b223)
Sys UI runs on user 0. This can lead to the TextClassifier (TC)
running for the wrong user. Consequencies are user A can launch apps
in user B via the TC's predicted actions and selected text being
unintentionally shared from user A to an app running in user B.
This fix ensures that the correct user id is passed and verified for
every TC request going across process boundaries (i.e. via SystemTC).
- Sys UI sets the appropriate user id in the TextView
- TextClassificationManager (TCM) system service is constructed using
a context generated from this user id
- SystemTC sets this user id before querying the TCMService
- TCMService validates the user id before forwarding the request to
the TCService belonging to that user id.
Bug: 136483597
Bug: 123232892
Test: atest android.view.textclassifier
atest android.widget.TextViewActivityTest
(manual) See I2fdffd8eb4221782cb1f34d2ddbe41dd3d36595c
Change-Id: Ibe68bc9e257521de97cbb014176b2b8ba23547d1
(cherry picked from commit 34e380cdd6)
Fixed a clear copy/paste error, docs had said "call getHeight() to
get the width" when it should have been "...to get the height".
Skipping staging since it's a simple text change.
Change-Id: Ic06557ac38517f409943585054835d774240ccf3
Test: make ds-docs
Exempt-from-owner-approval: Docs-only change
Bug: 144537947
userId is a new field added in ag/8350816, and it is written in between
some old fields when we parcelize it.
That breaks AiAi because some of its code rely on the implementation
details of SelectionEvent.writeToParcel.
In the long run, we may want to update AiAi such that it works
without this assumption, but before that, let's fix that in platform
for now.
Bug: 145962464
Bug: 123232892
Test: atest FrameworksCoreTests:android.view.textclassifier.SelectionEventTest
Merged-In: I98137a095cddf0fb4c600e1e09eef507bb750528
Change-Id: I66f65ac4c81ca964f710404fd081496355276435
Any pending windowGainedFocus future should be cancelled when IME is
switched/unbound.
Additinally, startInputInner() inside synchronized block blocked
WINDOW_FOCUS_GAIN from executing. Its fine to remove synchronization
here since startInputInner() already has relevant synchronized blocks.
Change-Id: I98cb044d8cbfb80480312a3923f168aefa9b7e7d
Fix: 144103599
Bug: 139806621
Test: Manually using the steps in bug.
(cherry picked from commit 322ee9bf9e)
For a typical window with Editor, IMM#startInputOrWindowGainedFocus
is called twice: first for WINDOW_FOCUS_GAIN (dummyInput), then
CHECK_FOCUS when actual editor receives focus and startsInput.
The first once can be moved to background thread and second startInput
will wait till its finished.
Bug: 139806621
Test: Manually launch activities with editors and confirm no change in
behavior.
Change-Id: I6aa4a664cfd0c86f75cee2457715317194bbe5e2
(cherry picked from commit e0172102b9)
Instead of doing lazy serialization of SKP on the
background executor serialize to a byte[] immediately
at callback invocation. This ensures no potential
for later mutations, race conditions, or wrong-thread issues
at the expense of potentially impacting app rendering performance.
However it seems preferable for a debug-only tool to be a slow
instead of very crashy.
Bug: 141772764
Test: test app
Change-Id: I3316d49970b96f1c59bb0a28ff7335db608e539e
(cherry picked from commit 8d0da1a6c5)