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

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

Add logs for group child notification row transient views adding

Add logs when group child notifications' row transient views are added to NotificationChildrenContainer, and when other ExpandableNotificationRows' transient views are added to the NSSL.

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

Change-Id: Iec4225cb44546ad2ab0e50a33dd67f3d8103f470
parent b3db1c7b
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -2759,6 +2759,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        boolean animationGenerated = container != null && generateRemoveAnimation(child);
        if (animationGenerated) {
            if (!mSwipedOutViews.contains(child) || !isFullySwipedOut(child)) {
                logAddTransientChild(child, container);
                container.addTransientView(child, 0);
                child.setTransientContainer(container);
            }
@@ -2774,6 +2775,30 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        focusNextViewIfFocused(child);
    }

    private void logAddTransientChild(ExpandableView child, ViewGroup container) {
        if (mLogger == null) {
            return;
        }
        if (child instanceof ExpandableNotificationRow) {
            if (container instanceof NotificationChildrenContainer) {
                mLogger.addTransientChildNotificationToChildContainer(
                        ((ExpandableNotificationRow) child).getEntry(),
                        ((NotificationChildrenContainer) container)
                                .getContainingNotification().getEntry()
                );
            } else if (container instanceof NotificationStackScrollLayout) {
                mLogger.addTransientChildNotificationToNssl(
                        ((ExpandableNotificationRow) child).getEntry()
                );
            } else {
                mLogger.addTransientChildNotificationToViewGroup(
                        ((ExpandableNotificationRow) child).getEntry(),
                        container
                );
            }
        }
    }

    /**
     * Has this view been fully swiped out such that it's not visible anymore.
     */
+38 −0
Original line number Diff line number Diff line
package com.android.systemui.statusbar.notification.stack

import android.view.ViewGroup
import com.android.systemui.log.dagger.NotificationHeadsUpLog
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.LogLevel.DEBUG
import com.android.systemui.log.LogLevel.INFO
import com.android.systemui.log.LogLevel.ERROR
import com.android.systemui.log.dagger.NotificationRenderLog
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.logKey
@@ -88,6 +90,42 @@ class NotificationStackScrollLogger @Inject constructor(
            "transientNotificationRowTraversalCleaned: key: $str1 reason: $str2"
        })
    }

    fun addTransientChildNotificationToChildContainer(
            childEntry: NotificationEntry,
            containerEntry: NotificationEntry,
    ) {
        notificationRenderBuffer.log(TAG, INFO, {
            str1 = childEntry.logKey
            str2 = containerEntry.logKey
        }, {
            "addTransientChildToContainer from onViewRemovedInternal: childKey: $str1 " +
                    "-- containerKey: $str2"
        })
    }

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

    fun addTransientChildNotificationToViewGroup(
            childEntry: NotificationEntry,
            container: ViewGroup
    ) {
        notificationRenderBuffer.log(TAG, ERROR, {
            str1 = childEntry.logKey
            str2 = container.toString()
        }, {
            "addTransientRowTo unhandled ViewGroup from onViewRemovedInternal: childKey: $str1 " +
                    "-- ViewGroup: $str2"
        })
    }
}

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