Add a method to screenshot helper that allows the caller to provide the
bitmap to be treated as a screen shot.
First use Overview can provide a task snapshot to use as a screenshot.
Test: update tests, local
Bug: 145297320
Change-Id: I4d21906212797bf394094d7a29208be02a6bfd7e
Although it makes sense to not get IMM delegate every time, the
instance may need to be refreshed if the associated display is
changed because InputMethodManager returns different instance for
different display.
Fix: 148189172
Test: atest MultiDisplayClientTests# \
testDisplayIdUpdateWhenImeMove_NoRelaunchActivity
Change-Id: Id4c85be1c0eab51f167ba00fc355386f852c424d
Previously when IMEs want to get initial input text for advanced
prediction featues, it will take up to three IPC calls. Once we provide
the initial text in the EditorInfo object, it would be available right
after the input connection setup and no IPC overheads will be
introduced.
Bug: 122691437
Test: atest FrameworksCoreTests:TextViewTest
Test: atest FrameworksCoreTests:EditorInfoTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest CtsInputMethodTestCases:EditorInfoTest
Change-Id: Ie04f2349b1157408aa8ed9044aea12ce99132cb4
Fraction is now from animation start to end state. This makes it
more in line with other animation fraction meaning. Also, the app
can figure out the animation direction on its own by inspecting
the visibility state when the animation gets prepared.
Also fix some other stuff in WindowInsetsAnimationCallback.
Test: CTS coming soon
Bug: 118118435
Change-Id: I81d36159817719a9b0ee25bb78cfbfddc2029270
Since we have a better approach of fitting content instead of
setting them on the layout params
(Window.setContentOnApplyWindowInsetsListener), we can now
simplify forcing of filling the screen:
Instead of clearing the fit types when the private flag is set, we
unset the types and straight out reject any params when the client
would like to fit.
Test: DisplayPolicyTests
Bug: 118118435
Change-Id: I845e6b1c81e29ab66a770891d03c62a32418e8cc
setFrameRate() is a new api in Android 11 that will enable apps to
specify their intended frame rate.
Bug: 143912624
Bug: 137287430
Test: Added a new CTS test - android.graphics.cts.SetFrameRateTest.
Change-Id: I922573c0d704e2e0ce4cfc2a462f14dce8cb7a79
Unhide the SurfaceControlViewHost API and the getHostToken/setChildSurfacePackage
API's required to use them.
Bug: 134365580
Bug: 140587144
Test: WindowlessWmTests
Change-Id: I0c5af2166f1d87947f54a492fd0b887c6253b9fe
When root-level content containers fit insets, they used to just
apply and consume the entire system insets. However, with the new
Inset APIs, and with deprecating ADJUST_RESIZE IME flag, we want
to give apps an easy way to customize this behavior.
For that, we introduce Window.setOnContentApplyWindowInsetsListener
that returns what kind of margins/padding should be applied and
what should be dispatched to the content views. This is essentially
a replacement for SYSTEM_UI_FLAG_LAYOUT_* as well as
SOFT_INPUT_ADJUST_RESIZE: It allows apps to choose which insets
should be handled on the window level vs view level.
For that, we mark the window decor views as
FRAMEWORK_OPTIONAL_FIT_SYSTEM_WINDOWS, in order to distinguish the
case when support library calls makeOptionalFitSystemWindows(). This
is because of two reasons:
- We don't want the listener to be invoked twice.
- We can not do the compat ping-pong between onApplyWindowInsets
and fitSystemWindows. This is because during the ping-pong, the
result of the OnContentApplyWindowInsetsListener would be lost.
However, we still need to do the compat ping-pong for
ActionBarOverlayLayout in the support library (until that gets
migrated to use onApplyWindowInsets), so we have this separate
dispatching path that only gets used for framework optional
fitting views.
Test: WindowTest
Bug: 118118435
Change-Id: I4b514addd9e094163062d651972f85615b4a35db
For use with SurfaceControlViewHost. Currently this just performs a reparent
but it's future use is to also automatically link the accessibility IDs
of the embedded content and the SurfaceView.
Test: No test, to unblock accessibility team. Builds.
Bug: 134365580
Change-Id: I990c0f29b439ed6e6f18bdfa4be2c1d46f502503
- Make sure onCheckIsTextEditor should be called on the UI thread for
preventing exception in some cases that will break start input background
thread.
- Refine IMM#checkFocus and DelegateImpl#startInput to be out of
lock object to prevent start input background thread may blocked by other
methods which already inside the lock.
- Cache InputMethodManagerDelegate object for ImeFocusController#getDelegate.
Fix: 147447217
Bug: 141738570
Test: manual as test steps:
1) Launch Keeeps app, type some web-URL link.
2) Long press on any URL link > From the toolbar select "open / browser"
and observe.
3) Expect the soft-keyboard should be hidden after entering the
browser page.
Test: atest CtsInputMethodTestCases
Change-Id: I098df41f935438bf1889fb030c7a3e7a0645a168
It takes time from when IME is requested to the time when IME is ready
to be shown. When its ready to be shown, we need to make sure that
window that requested IME is still the IME target in DisplayContent. The
only realistic way of knowing originating window is passing windowToken
from IMM API.
Bug: 111084606
Test: CtsInputMethodTestCases
Change-Id: Ia49e23dd077d264a58d28a7b8acffde54b7db187
For ViewRootImpl on BLAST experiment, setting up namespace and flag to
turn on Blast adapter through P/H experiment
Bug: 147096935
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: Ie1b158721ac9b751fcf3954310259f14486d3bb8
- Fix up target SDK check
- Keep WindowInsets.CONSUMED concept to stop dispatch for
performance optimization. If the insets are handled at some point
in the hierarchy, we really don't need to dispatch it to all the
children. However, deprecate all the individual consuming methods
instead.
Bug: 118118435
Test: ViewGroupTest
Change-Id: I6b6627fb9c0a43444ee3f9dbeb978109f9138fbd
Refine the APIs of system bar appearance/behavior:
- Add getters
- Let the caller can only change certain appearance flags with out
touching others
- Adjust appearance/behavior for the legacy apps if they don't uses the
new APIs
Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
InsetsPolicyTest WindowStateTests CommandQueueTest
RegisterStatusBarResultTest InsetsFlagsTest
LightBarControllerTest RegisterStatusBarResultTest
ViewRootImplTest DisplayPolicyLayoutTests
DisplayPolicyInsetsTests DisplayPolicyTests
TaskSnapshotSurfaceTest
Change-Id: I388decc9dc9b617348a6352b81fe77a19f27a0d7
This will let server be able to re-use the same implementation during
the insets animation.
Test: atest InsetsControllerTest
Test: New insets API test app works as expected.
Bug: 118118435
Change-Id: Ie8522d2b86ea117e83c1fa806d831604f112ff55
SurfaceControl now has #setBackgroundBlurRadius, which receives a radius in pixels
pointing out how much the content behind the current window should be blurred.
Bug: 141640413
Test: visual; on power menu and shade
Test: adb shell dumpsys activity service com.android.systemui
Change-Id: I367f8a7199d5b37ad476d3c2bc02c8900f8c1f9e
This CL dispatches the compatible system UI visibility to the app.
There are some changes about the flag of low profile in the new insets
mode:
- A window cannot detect if another window changes the system bars to
the low profile mode via OnSystemUiVisibilityChangeListener.
- SYSTEM_UI_FLAG_LOW_PROFILE won't be cleared by swiping to show bars.
Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
InsetsPolicyTest WindowStateTests CommandQueueTest
RegisterStatusBarResultTest InsetsFlagsTest
LightBarControllerTest RegisterStatusBarResultTest
ViewRootImplTest DisplayPolicyLayoutTests
DisplayPolicyInsetsTests DisplayPolicyTests
TaskSnapshotSurfaceTest InsetsAnimationControlImplTest
Change-Id: I85b720fd6b09c206ec56ca661cd5b645f7add404
For waterfall display, also take the waterfall insets into accout to
comput safe insets.
Change-Id: I1d5663ebd8588021387b7ae5296851769954f996
Bug: 146876976
Test: atest DisplayCutoutTest
Similar to scrolling, state description changes can happen very
frequently, so let's not overwhelm the service when the user is focused
on something like a slider of progress bar.
Isolating and reusing scroll event throttling code to do this.
Test: Added CTS tests in other CL, tried scroll viewws around the
system, and progress bar and slider in talkback test app (which have
already adopted state API).
Fix: 145626718
Change-Id: I4f7d2e526d7d453485615c089b04a8a698828279