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

Commit 34d3768c authored by Yuri Lin's avatar Yuri Lin
Browse files

Close guts when disabling a bundle

Otherwise, when the bundle is re-enabled, it comes back in guts-open state with the switch in the wrong place (off).

Fixes: 423677831
Test: manual + BundleHeaderViewModelTest
Flag: com.android.systemui.notification_bundle_ui
Change-Id: Id16c1d43210299635496dc3c9c813bcb74f0794a
parent 2723c553
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ class BundleHeaderGutsViewModelTest : SysuiTestCase() {

        // Assert
        verify(mockDisableBundle).invoke()
        verify(mockCloseGuts, never()).invoke()
        verify(mockCloseGuts).invoke()
    }

    @Test
+2 −3
Original line number Diff line number Diff line
@@ -51,9 +51,8 @@ class BundleHeaderGutsViewModel(
    }

    fun onDoneOrApplyClicked() {
        if (switchState) {
        closeGuts.invoke()
        } else {
        if (!switchState) {
            // The bundle always starts enabled otherwise the guts would not have been visible. Thus
            // we only need to update settings when the switch was toggled to false. Notifications
            // that were previously in the bundle will be re-sorted into their original locations.