ViewRootImpl was removing the callback from the server after the
windowState was removed, which was consistently failing resulting in an
exception in the log.
Now the removal is done before the ViewRootImpl's window removal
Test: Manually check that the error is not appearing in the log
Bug: 226089354
Change-Id: Ie9cb9940791b16d6ae1b243079794583c87b1a5c
In some cases, the InsetsState and the window frame can be changed at
the same time (such as orientation changed). Reporting them separately
might produce incorrect insets.
When the window layout is moved to the client, it uses the configuration
and the InsetsState to compute the window frame. They need to be
reported together as well.
Bug: 161810301
Bug: 160732586
Test: atest ActivityRecordTests WindowStateTests
Test: Add logs to check if we dispatch the correct insets to apps while
rotating the display.
Change-Id: I5c9f628eda40932def97c5caf968cb62db128e80
Previously, we checked info.globalVisibility to see if a system UI flag
exists, but since updateCompatSysUiVisibility can process more than one
type of one system bar, info.globalVisibility might be changed by one
type before the other type checks it. For example, if we process
ITYPE_CLIMATE_BAR first with visible=true and hasControl=false, and
then, when we process ITYPE_STATUS_BAR with visible=true and
hasControl=true, we cannot clear SYSTEM_UI_FLAG_FULLSCREEN by setting it
to info.localChanges, because wasVisible is false now.
Fix: 226555579
Bug: 225765490
Test: atest WindowInsetsControllerTests
Change-Id: I820842c7fe14fc47141a4fa09cfddf68f89dbd41
Replace the usage of consumeNextDraw with the SurfaceSyncer since
it's safer and integrated with VRI in a cleaner way.
Test: Internet Dialog in Notification Shade
Bug: 200284684
Change-Id: Ia837086040329c5fd3b8bb5b0adb0fddb339f3f9
- Use the focused window instead of the topApp window
- Instead we now rely on WindowManagerService to get
the focused window.
- SystemUI does not have ActivityRecord so we can't rely
on the top window of the Task to find the correct
window on which the callback will be called.
- Introduce a Builder for BackNavigationInfo
- This reduces the number of variable needed outside the synchonized
block.
- It also reduces the number of early return of BackNavigationInfo
instances
- Adding log messages to help further debug the method.
Test: BackNavigationControllerTests
Test: Manual dismiss of SystemUi dialog in QS
Bug: 216604581
Fixes: 221458292
Change-Id: I9ba2c7f89956f34d6338824502c210b3e58dc076
Introduce builder for BackNavigationInfo
Change-Id: I14b4a4b3abc8f417998b7b32831cb3d5c4faa491
We should compare the existing appearance with the new appearance which
is about to be applied to insetsFlags.appearance, not the raw appearance
from the argument, before deciding if we can skip it.
Bug: 224613946
Fix: 226227461
Test: atest WindowInsetsControllerTests#testSetSystemBarsAppearance
Change-Id: I1283089a3dadf4ca2c3136f80d1472a34351306a
This avoids creating an ArrayList if there are no keep clear areas,
returning early with an empty or singleton list where possible.
Bug: 222567277
Test: android.view.ViewShowHidePerfTest#testVisibleToInvisible
Change-Id: Id718a37ea8aa4fcf4edbaade532cea826b15adf0
The system will show translation after the animation is done but it
doesn't work if the animation is off. To fix the issue, we will
check the animation status before showing translation.
Bug: 215386127
Test: atest testUiTranslationWithoutAnimation
Change-Id: Id0d02c422100effcf842209971052f4d6e9b0bd2
Merged-in: Id0d02c422100effcf842209971052f4d6e9b0bd2
We push the syncId around via MSG_RESIZED and via
finishDrawing. We can see the finishDrawing change
is no-op, as it's not used on the server side. Likewise
we can see the MSG_RESIZED change is noop, since even if it
is received, it wont be used unless we call relayoutWindow
in which case it will be overwritten by the one used there. This
change is thus a noop until we actually remove relayout window.
Bug: 161810301
Bug: 175861051
Bug: 175861127
Bug: 200285149
Change-Id: I30627ddad805731109aebeeaf6c74867dcd1ecca
Instead of using the count to keep track of sync information in VRI, use
the SurfaceSyncer to handle this. This also means changing SV since SV
would also increment the VRI counter. This cleans up the logic since
code that's used for the SurfaceSyncer can be re-used in VRI.
Test: seamless rotation, launching apps
Bug: 200284684
Fixes: 225776224
Change-Id: Idb505b35eef9f99b2f76e9d1f1b26f5c50ed9a90
This is a step to let the client layout its window locally. The ultimate
goal is to reduce the jank while laying out the window.
With the new AIDL methods, we can divide IWindowSession.relayout into:
- IWindowSession#updateVisibility (synchronized binder call)
- To get or update the surface
- To fetch the latest factors about window-layout
- Only called when the view visibility is changed
- WindowLayout#computeFrames (local function call)
- To compute the window frames
- IWindowSession#updateLayout (one way binder call)
- To report the result of layout to the server
In this way, if the view visibility is not changed, the UI thread of
the client won't be blocked by the binder call during relayout.
The local layout project won't be done in a single CL. In order not to
break the existing logic, this CL introduces a flag: LOCAL_LAYOUT. The
flag will be enabled when the logic of local layout is ready.
Bug: 161810301
Bug: 175861051
Test: presubmit (no behavior change)
Change-Id: Ic4b2fc78a318f3a68e1ef8a35d8f3ab705856702
Initialize the touchable region of the handwriting window to be cropped
to the focused window bounds. This means the handwriting window will
only spy over the app bounds.
When attempting to start a handwriting session, ensure that we are
currently recording a gesture in the handwriting window. This means we
can only start handwriting if the gesture originated within the app
bounds.
When a handwriting session starts, change the touchable region of the
handwriting window to be over the entire display, so that scribbles
outside the app window can sent to the IME.
Bug: 226081811
Test: manual: using test apps in split screen
Change-Id: I95b67ec7be40dc80ed67c91d0ee0b32296e532ca
Taskbar is also considered as a navigation bar. While its visibility is
changed, View#dispatchSystemUiVisibilityChanged should be called.
Bug: 225765490
Test: atest WindowInsetsControllerTests
Change-Id: Ie9624211aa6077085966d588c28601000c68a4f2
Since the new split-screen doesn't need the fullscreen backdrop frame.
The backdrop frame will always be the window frame. The server doesn't
need to send the backdrop frame to the client. The client just needs to
offset the backdrop frame to (0, 0).
This CL also moves the logic of calling onWindowSizeIsChanging to the
handler thread because it reads some fields which should only be
accessed on the handler thread. Otherwise, there might be race
conditions.
Bug: 161810301
Test: 1. Perform drag-resize and drag-move on a freeform app, and see if
the layout is expected.
2. Move the divider in the split-screen mode, and see if there is
any abnormal.
Change-Id: Ie0058db0447260dd0561634179fc7721d965a9e2
The goal of this CL is to remove RELAYOUT_RES_DRAG_RESIZING_DOCKED and
RELAYOUT_RES_DRAG_RESIZING_FREEFORM, which is a step to make relayout an
oneway binder call.
When the resize mode is changed at the server side, the server will send
the new mode to the client via IWindow#resized, so the client doesn't
need to obtain the resize mode from the flags returned from relayout.
Bug: 161810301
Test: Perform drag-resize and drag-move on a freeform task and see if
there is any unexpected behavior.
Change-Id: I450abc113932b6c1dc0ce0e2b76bebdf85a60777
This will be used by clients such as Gboard to ensure they are
responding to translation events for the correct activity. Ideally we
would include the activity token, in case there are multiple activities
being translated in an app, but that isn't supported right now and it
requires changes to EditorInfo (in Input Method Framework) to get the
activity token.
Also fixed an issue where the callback methods are invoked twice when
the IME itself is the translated app is registering a callback for
itself. Note: This happens in UiTranslationManagerTest where the test
activity and IME have the same uid, but shouldn't happen outside of
tests.
Bug: 223979041
Test: atest CtsTranslationTestCases
Change-Id: Id99f501b065b92fe3358c2ae525175ad3ea4b119