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

Commit f8277c1d authored by Yining Liu's avatar Yining Liu
Browse files

Add logs for all ExpandableNotificationRow transient views adding to and...

Add logs for all ExpandableNotificationRow transient views adding to and removing from NotificationStackScrollLayout

Add logs for all ExpandableNotificationRow transient views that are added to and removed from NotificationStackScrollLayout. To help with:
1. determining if the known additions and removals are working as intended (especially in a good order) .
2. discovering unknown additions and removals of transient rows.

Bug: 281628358
Test: `adb shell settings put global systemui/buffer/NotifRenderLog
VERBOSE` and look for NotificationStackScroll tag in logcat

Change-Id: I0ed40d36c06c7c77c5f22f48ca8e28fd70286bfe
parent e9011c20
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -2799,6 +2799,22 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        }
    }

    @Override
    public void addTransientView(View view, int index) {
        if (mLogger != null && view instanceof ExpandableNotificationRow) {
            mLogger.addTransientRow(((ExpandableNotificationRow) view).getEntry(), index);
        }
        super.addTransientView(view, index);
    }

    @Override
    public void removeTransientView(View view) {
        if (mLogger != null && view instanceof ExpandableNotificationRow) {
            mLogger.removeTransientRow(((ExpandableNotificationRow) view).getEntry());
        }
        super.removeTransientView(view);
    }

    /**
     * Has this view been fully swiped out such that it's not visible anymore.
     */
+28 −0
Original line number Diff line number Diff line
@@ -126,6 +126,34 @@ class NotificationStackScrollLogger @Inject constructor(
                    "-- ViewGroup: $str2"
        })
    }

    fun addTransientRow(
            childEntry: NotificationEntry,
            index: Int
    ) {
        notificationRenderBuffer.log(
                TAG,
                INFO,
                {
                    str1 = childEntry.logKey
                    int1 = index
                },
                { "addTransientRow to NSSL: childKey: $str1 -- index: $int1" }
        )
    }

    fun removeTransientRow(
            childEntry: NotificationEntry,
    ) {
        notificationRenderBuffer.log(
                TAG,
                INFO,
                {
                    str1 = childEntry.logKey
                },
                { "removeTransientRow from NSSL: childKey: $str1" }
        )
    }
}

private const val TAG = "NotificationStackScroll"
 No newline at end of file