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

Commit 4b06b154 authored by András Kurucz's avatar András Kurucz
Browse files

Improve the locked-shade close animation after dismissing a single notification

Wait for the child animations to finish before we close the shade,
otherwise the notification outro animation will start in the shade, and
finish on the lockscreen which causes a flicker.

Fixes: 388298358
Test: Dismiss the last notification in the locked shade -> observe the
animations
Flag: com.android.systemui.notification_shade_close_waits_for_child_animations

Change-Id: Ie670bc5906603276b1425133d84c1fdd168eb6ef
parent 2e9dcd82
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -258,6 +258,16 @@ flag {
    }
}

flag {
    name: "notification_shade_close_waits_for_child_animations"
    namespace: "systemui"
    description: "Improve the locked-shade close animation after dismissing a single notification."
    bug: "388298358"
    metadata {
       purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "scene_container"
    namespace: "systemui"
+8 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.view.View;
import androidx.annotation.NonNull;

import com.android.internal.statusbar.IStatusBarService;
import com.android.systemui.Flags;
import com.android.systemui.InitController;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.deviceentry.domain.interactor.DeviceUnlockedInteractor;
@@ -206,9 +207,15 @@ class StatusBarNotificationPresenter implements NotificationPresenter, CommandQu
                && !mQsController.getExpanded()
                && mStatusBarStateController.getState() == StatusBarState.SHADE_LOCKED
                && !isCollapsing()) {
            if (Flags.notificationShadeCloseWaitsForChildAnimations()) {
                // wait for child animations before we close the shade to have a smooth transition
                mNsslController.runAfterAnimationFinished(
                        () -> mStatusBarStateController.setState(StatusBarState.KEYGUARD));
            } else {
                mStatusBarStateController.setState(StatusBarState.KEYGUARD);
            }
        }
    }

    @Override
    public boolean isCollapsing() {