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

Commit 4dcb6938 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Android (Google) Code Review
Browse files

Merge "Dump FooterView visibility data" into udc-dev

parents e0112b77 1baa09c6
Loading
Loading
Loading
Loading
+81 −30
Original line number Diff line number Diff line
@@ -732,9 +732,21 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            return;
        }
        // TODO: move this logic to controller, which will invoke updateFooterView directly
        boolean showDismissView = mClearAllEnabled &&
                mController.hasActiveClearableNotifications(ROWS_ALL);
        boolean showFooterView = (showDismissView || mController.getVisibleNotificationCount() > 0)
        final boolean showHistory = mController.isHistoryEnabled();
        final boolean showDismissView = shouldShowDismissView();

        updateFooterView(shouldShowFooterView(showDismissView)/* visible */,
                showDismissView /* showDismissView */,
                showHistory/* showHistory */);
    }

    private boolean shouldShowDismissView() {
        return mClearAllEnabled
                && mController.hasActiveClearableNotifications(ROWS_ALL);
    }

    private boolean shouldShowFooterView(boolean showDismissView) {
        return (showDismissView || mController.getVisibleNotificationCount() > 0)
                && mIsCurrentUserSetup // see: b/193149550
                && !onKeyguard()
                && mUpcomingStatusBarState != StatusBarState.KEYGUARD
@@ -742,9 +754,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                && (mQsExpansionFraction != 1 || !mQsFullScreen)
                && !mScreenOffAnimationController.shouldHideNotificationsFooter()
                && !mIsRemoteInputActive;
        boolean showHistory = mController.isHistoryEnabled();

        updateFooterView(showFooterView, showDismissView, showHistory);
    }

    /**
@@ -5278,7 +5287,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        });
        pw.println();
        pw.println("Contents:");
        DumpUtilsKt.withIncreasedIndent(pw, () -> {
        DumpUtilsKt.withIncreasedIndent(
                pw,
                () -> {
                    int childCount = getChildCount();
                    pw.println("Number of children: " + childCount);
                    pw.println();
@@ -5286,6 +5297,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                    for (int i = 0; i < childCount; i++) {
                        ExpandableView child = getChildAtIndex(i);
                        child.dump(pw, args);
                        if (child instanceof FooterView) {
                            DumpUtilsKt.withIncreasedIndent(pw, () -> dumpFooterViewVisibility(pw));
                        }
                        pw.println();
                    }
                    int transientViewCount = getTransientViewCount();
@@ -5303,6 +5317,43 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                });
    }

    private void dumpFooterViewVisibility(IndentingPrintWriter pw) {
        final boolean showDismissView = shouldShowDismissView();

        pw.println("showFooterView: " + shouldShowFooterView(showDismissView));
        DumpUtilsKt.withIncreasedIndent(
                pw,
                () -> {
                    pw.println("showDismissView: " + showDismissView);
                    DumpUtilsKt.withIncreasedIndent(
                            pw,
                            () -> {
                                pw.println("mClearAllEnabled: " + mClearAllEnabled);
                                pw.println(
                                        "hasActiveClearableNotifications: "
                                                + mController.hasActiveClearableNotifications(
                                                        ROWS_ALL));
                            });
                    pw.println();
                    pw.println("showHistory: " + mController.isHistoryEnabled());
                    pw.println();
                    pw.println(
                            "visibleNotificationCount: "
                                    + mController.getVisibleNotificationCount());
                    pw.println("mIsCurrentUserSetup: " + mIsCurrentUserSetup);
                    pw.println("onKeyguard: " + onKeyguard());
                    pw.println("mUpcomingStatusBarState: " + mUpcomingStatusBarState);
                    pw.println("mQsExpansionFraction: " + mQsExpansionFraction);
                    pw.println("mQsFullScreen: " + mQsFullScreen);
                    pw.println(
                            "mScreenOffAnimationController"
                                    + ".shouldHideNotificationsFooter: "
                                    + mScreenOffAnimationController
                                            .shouldHideNotificationsFooter());
                    pw.println("mIsRemoteInputActive: " + mIsRemoteInputActive);
                });
    }

    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    public boolean isFullyHidden() {
        return mAmbientState.isFullyHidden();