summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yining Liu <liuyining@google.com> 2023-06-12 03:00:53 +0000
committer Yining Liu <liuyining@google.com> 2023-06-21 17:54:22 +0000
commitb3db1c7b5fa662c3f7be3038a51f716c9477901c (patch)
tree61b7fa68cca88fa7304f370876ab3f9c8bc15630
parent58ee34ab35e563fb8ffc718e0ad8338e99fe406b (diff)
Add logs for NotificationStackScrollLayout traversal removal of transient group child ExpandableNotificationRows
Add logs for NSSL traversal removal of transient group child ExpandableNotificationRows. These logs track when the transient views for group child ExpandableNotificationRows are cleaned by NSSL's traversal cleaning (when the Shade's collapsing finishes). Bug: 281628358 Test: `adb shell settings put global systemui/buffer/NotifRenderLog VERBOSE` and look for NotificationStackScroll tag in logcat Change-Id: Ia4d4a78ac4a821ed51d24df5edc58eace850c1cd
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java32
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLogger.kt13
2 files changed, 40 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index d1413a275ff2..7751c4481532 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -3033,7 +3033,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
if (!animationsEnabled) {
mSwipedOutViews.clear();
mChildrenToRemoveAnimated.clear();
- clearTemporaryViewsInGroup(this);
+ clearTemporaryViewsInGroup(
+ /* viewGroup = */ this,
+ /* reason = */ "setAnimationsEnabled");
}
}
@@ -4008,26 +4010,48 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
private void clearTemporaryViews() {
// lets make sure nothing is transient anymore
- clearTemporaryViewsInGroup(this);
+ clearTemporaryViewsInGroup(
+ /* viewGroup = */ this,
+ /* reason = */ "clearTemporaryViews"
+ );
for (int i = 0; i < getChildCount(); i++) {
ExpandableView child = getChildAtIndex(i);
if (child instanceof ExpandableNotificationRow) {
ExpandableNotificationRow row = (ExpandableNotificationRow) child;
- clearTemporaryViewsInGroup(row.getChildrenContainer());
+ clearTemporaryViewsInGroup(
+ /* viewGroup = */ row.getChildrenContainer(),
+ /* reason = */ "clearTemporaryViewsInGroup(row.getChildrenContainer())"
+ );
}
}
}
- private void clearTemporaryViewsInGroup(ViewGroup viewGroup) {
+ private void clearTemporaryViewsInGroup(ViewGroup viewGroup, String reason) {
while (viewGroup != null && viewGroup.getTransientViewCount() != 0) {
final View transientView = viewGroup.getTransientView(0);
viewGroup.removeTransientView(transientView);
if (transientView instanceof ExpandableView) {
((ExpandableView) transientView).setTransientContainer(null);
+ if (transientView instanceof ExpandableNotificationRow) {
+ logTransientNotificationRowTraversalCleaned(
+ (ExpandableNotificationRow) transientView,
+ reason
+ );
+ }
}
}
}
+ private void logTransientNotificationRowTraversalCleaned(
+ ExpandableNotificationRow transientView,
+ String reason
+ ) {
+ if (mLogger == null) {
+ return;
+ }
+ mLogger.transientNotificationRowTraversalCleaned(transientView.getEntry(), reason);
+ }
+
void onPanelTrackingStarted() {
mPanelTracking = true;
mAmbientState.setPanelTracking(true);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLogger.kt
index 5b0ec1d14edc..40b4c2904a6b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLogger.kt
@@ -4,6 +4,7 @@ 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.dagger.NotificationRenderLog
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.logKey
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_ADD
@@ -15,7 +16,8 @@ import com.google.errorprone.annotations.CompileTimeConstant
import javax.inject.Inject
class NotificationStackScrollLogger @Inject constructor(
- @NotificationHeadsUpLog private val buffer: LogBuffer
+ @NotificationHeadsUpLog private val buffer: LogBuffer,
+ @NotificationRenderLog private val notificationRenderBuffer: LogBuffer
) {
fun hunAnimationSkipped(entry: NotificationEntry, reason: String) {
buffer.log(TAG, INFO, {
@@ -77,6 +79,15 @@ class NotificationStackScrollLogger @Inject constructor(
"isTouchBelowNotification: $bool2 motionEvent: $str1"
})
}
+
+ fun transientNotificationRowTraversalCleaned(entry: NotificationEntry, reason: String) {
+ notificationRenderBuffer.log(TAG, INFO, {
+ str1 = entry.logKey
+ str2 = reason
+ }, {
+ "transientNotificationRowTraversalCleaned: key: $str1 reason: $str2"
+ })
+ }
}
private const val TAG = "NotificationStackScroll" \ No newline at end of file