Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 61b57331 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[flexiglass] Fixes back navigation.

The QS scene adds a BackHandler that conditions its enabled state on
whether QS is in edit mode (isCustomizing). This seemed to not have
worked with Flexiglass and the back callbacks were being invoked on the
BackHandler in SceneTransitionLayoutImpl even though the child
composable of the scene was changing its own BackHandler's enabled state
after that parent SceneTransitionLayoutImpl BackHandler was added.

The assumption is that because the BackHandler in
SceneTransitionLayoutImpl was being added conditionally, only when the
current scene had a "back" user action result, the order of addition of
BackHandlers was incorrect with the parent composable going through
recomposition in response to the new destinationScenes map from the
current scene.

The fix is to have the SceneTransitionLayoutImpl add its BackHandler
unconditionally but to set its enabled state based on whether the
current scene has a "back" user aciton result. This preserves the order
of addition of BackHandlers.

Fix: 332749288
Test: locally replaced the emptyMap() in QuickSettingsSceneViewModel
with a back action that goes back to the QS scene; just to test the
following two things (but also tested them without that change, just in
case)
Test: manually verified that unlock -> shade -> QS -> edit -> back, correctly returns to QS in non-edit mode
Test: manually verified that unlock -> shade -> QS -> back, correctly
returns to the shade scene
Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT

Change-Id: I3ad46557fbe634d89de46249bf775cf315d15f86
parent 7bfffc4f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment