[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
Loading
Please register or sign in to comment