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

Commit 49166add authored by Steve Elliott's avatar Steve Elliott
Browse files

[flexiglass] Propagate onKeyguard to child rows

Fixes: 391230625
Test: manual
 1. Receive a notification group whilst on AOD
 2. Unlock, open shade
 3. Observe: all notifications in group are expandable
Flag: com.android.systemui.scene_container
Change-Id: I1d1d20e41e6607e09046925eb2365c596ff35aed
parent 10770a27
Loading
Loading
Loading
Loading
+42 −21
Original line number Diff line number Diff line
@@ -2971,6 +2971,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            if (isAboveShelf() != wasAboveShelf) {
                mAboveShelfChangedListener.onAboveShelfStateChanged(!wasAboveShelf);
            }
            if (SceneContainerFlag.isEnabled()) {
                if (mIsSummaryWithChildren) {
                    mChildrenContainer.setOnKeyguard(onKeyguard);
                }
            }
        }
    }

@@ -4115,7 +4120,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            pw.print(", alpha: " + getAlpha());
            pw.print(", translation: " + getTranslation());
            pw.print(", entry dismissable: " + canEntryBeDismissed());
            pw.print(", mOnUserInteractionCallback null: " + (mOnUserInteractionCallback == null));
            pw.print(", mOnUserInteractionCallback==null: " + (mOnUserInteractionCallback == null));
            pw.print(", removed: " + isRemoved());
            pw.print(", expandAnimationRunning: " + mExpandAnimationRunning);
            pw.print(", mShowingPublic: " + mShowingPublic);
@@ -4128,9 +4133,17 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            pw.print(", clipBounds: " + getClipBounds());
            if (PromotedNotificationUiForceExpanded.isEnabled()) {
                pw.print(", isPromotedOngoing: " + isPromotedOngoing());
            }
            pw.print(", isExpandable: " + isExpandable());
            pw.print(", mExpandable: " + mExpandable);
            }
            pw.print(", isUserExpanded: " + isUserExpanded());
            pw.print(", hasUserChangedExpansion: " + mHasUserChangedExpansion);
            pw.print(", isOnKeyguard: " + isOnKeyguard());
            pw.print(", isSummaryWithChildren: " + mIsSummaryWithChildren);
            pw.print(", enableNonGroupedExpand: " + mEnableNonGroupedNotificationExpand);
            pw.print(", isPinned: " + isPinned());
            pw.print(", expandedWhenPinned: " + mExpandedWhenPinned);
            pw.print(", isMinimized: " + mIsMinimized);

            pw.println();
            if (NotificationContentView.INCLUDE_HEIGHTS_TO_DUMP) {
@@ -4159,28 +4172,36 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
                pw.println("Children Container Intrinsic Height: "
                        + mChildrenContainer.getIntrinsicHeight());
                pw.println();
                dumpChildren(pw, args);
                dumpTransientViews(transientViewCount, pw, args);
            } else if (mPrivateLayout != null) {
                mPrivateLayout.dumpSmartReplies(pw);
            }
        });
    }

    private void dumpChildren(IndentingPrintWriter pw, String[] args) {
        List<ExpandableNotificationRow> notificationChildren = getAttachedChildren();
        pw.print("Children: " + notificationChildren.size() + " {");
                pw.increaseIndent();
        DumpUtilsKt.withIncreasedIndent(pw, () -> {
            for (ExpandableNotificationRow child : notificationChildren) {
                pw.println();
                child.dump(pw, args);
            }
                pw.decreaseIndent();
        });
        pw.println("}");
                pw.print("Transient Views: " + transientViewCount + " {");
                pw.increaseIndent();
                for (int i = 0; i < transientViewCount; i++) {
    }

    private void dumpTransientViews(int transientCount, IndentingPrintWriter pw, String[] args) {
        pw.print("Transient Views: " + transientCount + " {");
        DumpUtilsKt.withIncreasedIndent(pw, () -> {
            for (int i = 0; i < transientCount; i++) {
                pw.println();
                ExpandableView child = (ExpandableView) mChildrenContainer.getTransientView(i);
                child.dump(pw, args);
            }
                pw.decreaseIndent();
                pw.println("}");
            } else if (mPrivateLayout != null) {
                mPrivateLayout.dumpSmartReplies(pw);
            }
        });
        pw.println("}");
    }

    private void dumpHeights(IndentingPrintWriter pw) {
+8 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.widget.NotificationExpandButton;
import com.android.systemui.res.R;
import com.android.systemui.scene.shared.flag.SceneContainerFlag;
import com.android.systemui.statusbar.CrossFadeHelper;
import com.android.systemui.statusbar.NotificationGroupingUtil;
import com.android.systemui.statusbar.notification.FeedbackIcon;
@@ -1713,4 +1714,11 @@ public class NotificationChildrenContainer extends ViewGroup
                + ", clipBounds: " + getClipBounds()
                + ", roundableState: " + getRoundableState().debugString() + "}";
    }

    public void setOnKeyguard(boolean onKeyguard) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        for (ExpandableNotificationRow child : mAttachedChildren) {
            child.setOnKeyguard(onKeyguard);
        }
    }
}