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

Commit 90c58c32 authored by Marat Davliatchin's avatar Marat Davliatchin Committed by Android (Google) Code Review
Browse files

Merge "Multiple instances of the IdleHostViewController class exist at the same time"

parents 9b1377cb f644bcc3
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -346,6 +346,7 @@ public class NotificationPanelViewController extends PanelViewController {
    private VelocityTracker mQsVelocityTracker;
    private boolean mQsTracking;

    private IdleHostView mIdleHostView;
    private CommunalHostView mCommunalView;

    /**
@@ -894,6 +895,7 @@ public class NotificationPanelViewController extends PanelViewController {
    private void onFinishInflate() {
        loadDimens();
        mKeyguardStatusBar = mView.findViewById(R.id.keyguard_header);
        mIdleHostView = mView.findViewById(R.id.idle_host_view);
        mCommunalView = mView.findViewById(R.id.communal_host);

        FrameLayout userAvatarContainer = null;
@@ -916,10 +918,11 @@ public class NotificationPanelViewController extends PanelViewController {
                        .getKeyguardStatusBarViewController();
        mKeyguardStatusBarViewController.init();

        IdleViewComponent idleViewComponent = mIdleViewComponentFactory
                .build(mView.findViewById(R.id.idle_host_view));
        if (mIdleHostView != null) {
            IdleViewComponent idleViewComponent = mIdleViewComponentFactory.build(mIdleHostView);
            mIdleHostViewController = idleViewComponent.getIdleHostViewController();
            mIdleHostViewController.init();
        }

        if (mCommunalView != null) {
            CommunalViewComponent communalViewComponent =
@@ -934,7 +937,7 @@ public class NotificationPanelViewController extends PanelViewController {
                mView.findViewById(R.id.keyguard_status_view),
                userAvatarContainer,
                keyguardUserSwitcherView,
                mView.findViewById(R.id.idle_host_view),
                mIdleHostView,
                mCommunalView);
        mNotificationContainerParent = mView.findViewById(R.id.notification_container_parent);
        NotificationStackScrollLayout stackScrollLayout = mView.findViewById(
@@ -1032,9 +1035,12 @@ public class NotificationPanelViewController extends PanelViewController {
        mKeyguardStatusViewController = statusViewComponent.getKeyguardStatusViewController();
        mKeyguardStatusViewController.init();

        if (idleHostView != null && idleHostView != mIdleHostView) {
            mIdleHostView = idleHostView;
            IdleViewComponent idleViewComponent = mIdleViewComponentFactory.build(idleHostView);
            mIdleHostViewController = idleViewComponent.getIdleHostViewController();
            mIdleHostViewController.init();
        }

        if (mKeyguardUserSwitcherController != null) {
            // Try to close the switcher so that callbacks are triggered if necessary.