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

Commit dd2b7e67 authored by Jamie Garside's avatar Jamie Garside
Browse files

Fix bug where the clock may not exist when using custom animation.

It's possible that CLockContainerView has no children when
updateKeyguardStatusViewAlignemnt is called, which can cause an NPE.

Test: Manually verified.
Bug: 257762349
Change-Id: I0757abed8ffc26c8a654e55c352052098bc9086a
parent 4c430266
Loading
Loading
Loading
Loading
+20 −12
Original line number Diff line number Diff line
@@ -1569,6 +1569,13 @@ public final class NotificationPanelViewController implements Dumpable {
                    // Find the clock, so we can exclude it from this transition.
                    FrameLayout clockContainerView =
                            mView.findViewById(R.id.lockscreen_clock_view_large);

                    // The clock container can sometimes be null. If it is, just fall back to the
                    // old animation rather than setting up the custom animations.
                    if (clockContainerView == null || clockContainerView.getChildCount() == 0) {
                        TransitionManager.beginDelayedTransition(
                                mNotificationContainerParent, transition);
                    } else {
                        View clockView = clockContainerView.getChildAt(0);

                        transition.excludeTarget(clockView, /* exclude= */ true);
@@ -1586,6 +1593,7 @@ public final class NotificationPanelViewController implements Dumpable {
                        set.addTransition(adapter);

                        TransitionManager.beginDelayedTransition(mNotificationContainerParent, set);
                    }
                } else {
                    TransitionManager.beginDelayedTransition(
                            mNotificationContainerParent, transition);