Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java +11 −2 Original line number Diff line number Diff line Loading @@ -596,7 +596,8 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { @Test public void callSwipeCallbacksDuringClearAll() { initController(/* viewIsAttached= */ true); ExpandableNotificationRow row = mock(ExpandableNotificationRow.class); ExpandableNotificationRow row = createExpandableNotificationRow(); NotificationCallback notificationCallback = mController.mNotificationCallback; when(mNotificationStackScrollLayout.getClearAllInProgress()).thenReturn(true); Loading @@ -611,7 +612,8 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { @Test public void callSwipeCallbacksDuringClearNotification() { initController(/* viewIsAttached= */ true); ExpandableNotificationRow row = mock(ExpandableNotificationRow.class); ExpandableNotificationRow row = createExpandableNotificationRow(); NotificationCallback notificationCallback = mController.mNotificationCallback; when(mNotificationStackScrollLayout.getClearAllInProgress()).thenReturn(false); Loading Loading @@ -868,6 +870,13 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { mSectionsManager); } private static ExpandableNotificationRow createExpandableNotificationRow() { ExpandableNotificationRow row = mock(ExpandableNotificationRow.class); when(row.getLoggingKey()).thenReturn("ENR_loggingKey"); return row; } static class LogMatcher implements ArgumentMatcher<LogMaker> { private final int mCategory, mType; Loading packages/SystemUI/src/com/android/systemui/SwipeHelper.java +16 −0 Original line number Diff line number Diff line Loading @@ -498,6 +498,7 @@ public class SwipeHelper implements Gefingerpoken, Dumpable { public void onAnimationStart(Animator animation) { super.onAnimationStart(animation); mCallback.onBeginDrag(animView); mCallback.onSwipeOutAnimStart(animView); } @Override Loading @@ -519,7 +520,10 @@ public class SwipeHelper implements Gefingerpoken, Dumpable { if (!mCancelled || wasRemoved) { mCallback.onChildDismissed(animView); resetViewIfSwiping(animView); } else { mCallback.onChildNotDismissed(animView, mCancelled, wasRemoved); } if (endAction != null) { endAction.accept(mCancelled); } Loading Loading @@ -988,6 +992,11 @@ public class SwipeHelper implements Gefingerpoken, Dumpable { void onBeginDrag(View v); /** * Called on swipe out animation starts. * Note that: it is added for logging. */ default void onSwipeOutAnimStart(View v) {} /** * Set magnetic and roundable targets for a view. */ Loading Loading @@ -1080,5 +1089,12 @@ public class SwipeHelper implements Gefingerpoken, Dumpable { /** The density scale has changed */ void onDensityScaleChange(float density); /** * Called when child dismissal fails. * Note that: it is added for logging. */ default void onChildNotDismissed( View v, boolean animationCancelled, boolean viewWasRemoved) {} } } packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +7 −0 Original line number Diff line number Diff line Loading @@ -6029,9 +6029,16 @@ public class NotificationStackScrollLayout } void addSwipedOutView(View v) { logAddSwipedOutView(v); mSwipedOutViews.add(v); } private void logAddSwipedOutView(View v) { if (mLogger != null && v instanceof ExpandableNotificationRow row) { mLogger.logAddSwipedOutView(row.getLoggingKey(), mClearAllInProgress); } } void onSwipeBegin(View viewSwiped) { if (!(viewSwiped instanceof ExpandableNotificationRow)) { return; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +43 −0 Original line number Diff line number Diff line Loading @@ -572,6 +572,7 @@ public class NotificationStackScrollLayoutController implements Dumpable { */ @Override public void onChildDismissed(View view) { logOnChildDismissed(view); if (!(view instanceof ActivatableNotificationView row)) { return; } Loading @@ -595,6 +596,7 @@ public class NotificationStackScrollLayoutController implements Dumpable { public void handleChildViewDismissed(View view) { // The View needs to clean up the Swipe states, e.g. roundness. mMagneticNotificationRowManager.resetRoundness(); logHandleChildViewDismissed(view); mView.onSwipeEnd(); if (mView.getClearAllInProgress()) { return; Loading Loading @@ -692,6 +694,34 @@ public class NotificationStackScrollLayoutController implements Dumpable { mView.onSwipeBegin(v); } @Override public void onSwipeOutAnimStart(View v) { logOnSwipeOutAnimationStart(v); } private void logOnSwipeOutAnimationStart(View v) { if (mLogger != null && v instanceof ExpandableNotificationRow row) { mLogger.logOnSwipeBegin(row.getLoggingKey(), /* reason = */"onSwipeOutAnimStart", mView.getClearAllInProgress()); } } @Override public void onChildNotDismissed(View v, boolean animationCancelled, boolean viewWasRemoved) { logOnChildNotDismissed(v, animationCancelled, viewWasRemoved); } private void logOnChildNotDismissed(View v, boolean animationCancelled, boolean viewWasRemoved) { if (mLogger != null && v instanceof ExpandableNotificationRow row) { mLogger.logOnChildNotDismissed(row.getLoggingKey(), animationCancelled, viewWasRemoved); } } @Override public void setMagneticAndRoundableTargets(View v) { if (v instanceof ExpandableNotificationRow row) { Loading Loading @@ -767,6 +797,19 @@ public class NotificationStackScrollLayoutController implements Dumpable { } }; private void logHandleChildViewDismissed(View view) { if (mLogger != null && view instanceof ExpandableNotificationRow row) { mLogger.logOnSwipeEnd(row.getLoggingKey(), /* reason = */"handleChildViewDismissed", mView.getClearAllInProgress()); } } private void logOnChildDismissed(View view) { if (mLogger != null && view instanceof ExpandableNotificationRow enr) { mLogger.logOnChildDismissed(enr.getLoggingKey(), mView.getClearAllInProgress()); } } private final OnHeadsUpChangedListener mOnHeadsUpChangedListener = new OnHeadsUpChangedListener() { @Override Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLogger.kt +70 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,76 @@ constructor( { "setMaxDisplayedNotifications: $int1" }, ) } fun logAddSwipedOutView(loggingKey: String, clearAllInProgress: Boolean) { notificationRenderBuffer.log( TAG, INFO, { str1 = loggingKey bool1 = clearAllInProgress }, { "addSwipedOutView from NSSL: childKey = $str1 -- clearAllInProgress:$bool1" }, ) } fun logOnChildDismissed(loggingKey: String, clearAllInProgress: Boolean) { notificationRenderBuffer.log( TAG, INFO, { str1 = loggingKey bool1 = clearAllInProgress }, { "onChildDismissed from NSSL: childKey = $str1 -- clearAllInProgress:$bool1" }, ) } fun logOnSwipeBegin(loggingKey: String, reason: String, clearAllInProgress: Boolean) { notificationRenderBuffer.log( TAG, INFO, { str1 = loggingKey str2 = reason bool1 = clearAllInProgress }, { "onSwipeBegin from $str2: childKey = $str1 -- clearAllInProgress:$bool1" }, ) } fun logOnSwipeEnd(loggingKey: String, reason: String, clearAllInProgress: Boolean) { notificationRenderBuffer.log( TAG, INFO, { str1 = loggingKey str2 = reason bool1 = clearAllInProgress }, { "onSwipeEnd from $str2: childKey = $str1 -- clearAllInProgress:$bool1" }, ) } fun logOnChildNotDismissed( loggingKey: String, animationCancelled: Boolean, viewWasRemoved: Boolean, ) { notificationRenderBuffer.log( TAG, INFO, { str1 = loggingKey bool1 = animationCancelled bool2 = viewWasRemoved }, { "onChildNotDismissed (ERROR) childKey = $str1 " + "-- animationCancelled:$bool1 -- viewWasRemoved:$bool2" }, ) } } private const val TAG = "NotificationStackScroll" Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java +11 −2 Original line number Diff line number Diff line Loading @@ -596,7 +596,8 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { @Test public void callSwipeCallbacksDuringClearAll() { initController(/* viewIsAttached= */ true); ExpandableNotificationRow row = mock(ExpandableNotificationRow.class); ExpandableNotificationRow row = createExpandableNotificationRow(); NotificationCallback notificationCallback = mController.mNotificationCallback; when(mNotificationStackScrollLayout.getClearAllInProgress()).thenReturn(true); Loading @@ -611,7 +612,8 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { @Test public void callSwipeCallbacksDuringClearNotification() { initController(/* viewIsAttached= */ true); ExpandableNotificationRow row = mock(ExpandableNotificationRow.class); ExpandableNotificationRow row = createExpandableNotificationRow(); NotificationCallback notificationCallback = mController.mNotificationCallback; when(mNotificationStackScrollLayout.getClearAllInProgress()).thenReturn(false); Loading Loading @@ -868,6 +870,13 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { mSectionsManager); } private static ExpandableNotificationRow createExpandableNotificationRow() { ExpandableNotificationRow row = mock(ExpandableNotificationRow.class); when(row.getLoggingKey()).thenReturn("ENR_loggingKey"); return row; } static class LogMatcher implements ArgumentMatcher<LogMaker> { private final int mCategory, mType; Loading
packages/SystemUI/src/com/android/systemui/SwipeHelper.java +16 −0 Original line number Diff line number Diff line Loading @@ -498,6 +498,7 @@ public class SwipeHelper implements Gefingerpoken, Dumpable { public void onAnimationStart(Animator animation) { super.onAnimationStart(animation); mCallback.onBeginDrag(animView); mCallback.onSwipeOutAnimStart(animView); } @Override Loading @@ -519,7 +520,10 @@ public class SwipeHelper implements Gefingerpoken, Dumpable { if (!mCancelled || wasRemoved) { mCallback.onChildDismissed(animView); resetViewIfSwiping(animView); } else { mCallback.onChildNotDismissed(animView, mCancelled, wasRemoved); } if (endAction != null) { endAction.accept(mCancelled); } Loading Loading @@ -988,6 +992,11 @@ public class SwipeHelper implements Gefingerpoken, Dumpable { void onBeginDrag(View v); /** * Called on swipe out animation starts. * Note that: it is added for logging. */ default void onSwipeOutAnimStart(View v) {} /** * Set magnetic and roundable targets for a view. */ Loading Loading @@ -1080,5 +1089,12 @@ public class SwipeHelper implements Gefingerpoken, Dumpable { /** The density scale has changed */ void onDensityScaleChange(float density); /** * Called when child dismissal fails. * Note that: it is added for logging. */ default void onChildNotDismissed( View v, boolean animationCancelled, boolean viewWasRemoved) {} } }
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +7 −0 Original line number Diff line number Diff line Loading @@ -6029,9 +6029,16 @@ public class NotificationStackScrollLayout } void addSwipedOutView(View v) { logAddSwipedOutView(v); mSwipedOutViews.add(v); } private void logAddSwipedOutView(View v) { if (mLogger != null && v instanceof ExpandableNotificationRow row) { mLogger.logAddSwipedOutView(row.getLoggingKey(), mClearAllInProgress); } } void onSwipeBegin(View viewSwiped) { if (!(viewSwiped instanceof ExpandableNotificationRow)) { return; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +43 −0 Original line number Diff line number Diff line Loading @@ -572,6 +572,7 @@ public class NotificationStackScrollLayoutController implements Dumpable { */ @Override public void onChildDismissed(View view) { logOnChildDismissed(view); if (!(view instanceof ActivatableNotificationView row)) { return; } Loading @@ -595,6 +596,7 @@ public class NotificationStackScrollLayoutController implements Dumpable { public void handleChildViewDismissed(View view) { // The View needs to clean up the Swipe states, e.g. roundness. mMagneticNotificationRowManager.resetRoundness(); logHandleChildViewDismissed(view); mView.onSwipeEnd(); if (mView.getClearAllInProgress()) { return; Loading Loading @@ -692,6 +694,34 @@ public class NotificationStackScrollLayoutController implements Dumpable { mView.onSwipeBegin(v); } @Override public void onSwipeOutAnimStart(View v) { logOnSwipeOutAnimationStart(v); } private void logOnSwipeOutAnimationStart(View v) { if (mLogger != null && v instanceof ExpandableNotificationRow row) { mLogger.logOnSwipeBegin(row.getLoggingKey(), /* reason = */"onSwipeOutAnimStart", mView.getClearAllInProgress()); } } @Override public void onChildNotDismissed(View v, boolean animationCancelled, boolean viewWasRemoved) { logOnChildNotDismissed(v, animationCancelled, viewWasRemoved); } private void logOnChildNotDismissed(View v, boolean animationCancelled, boolean viewWasRemoved) { if (mLogger != null && v instanceof ExpandableNotificationRow row) { mLogger.logOnChildNotDismissed(row.getLoggingKey(), animationCancelled, viewWasRemoved); } } @Override public void setMagneticAndRoundableTargets(View v) { if (v instanceof ExpandableNotificationRow row) { Loading Loading @@ -767,6 +797,19 @@ public class NotificationStackScrollLayoutController implements Dumpable { } }; private void logHandleChildViewDismissed(View view) { if (mLogger != null && view instanceof ExpandableNotificationRow row) { mLogger.logOnSwipeEnd(row.getLoggingKey(), /* reason = */"handleChildViewDismissed", mView.getClearAllInProgress()); } } private void logOnChildDismissed(View view) { if (mLogger != null && view instanceof ExpandableNotificationRow enr) { mLogger.logOnChildDismissed(enr.getLoggingKey(), mView.getClearAllInProgress()); } } private final OnHeadsUpChangedListener mOnHeadsUpChangedListener = new OnHeadsUpChangedListener() { @Override Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLogger.kt +70 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,76 @@ constructor( { "setMaxDisplayedNotifications: $int1" }, ) } fun logAddSwipedOutView(loggingKey: String, clearAllInProgress: Boolean) { notificationRenderBuffer.log( TAG, INFO, { str1 = loggingKey bool1 = clearAllInProgress }, { "addSwipedOutView from NSSL: childKey = $str1 -- clearAllInProgress:$bool1" }, ) } fun logOnChildDismissed(loggingKey: String, clearAllInProgress: Boolean) { notificationRenderBuffer.log( TAG, INFO, { str1 = loggingKey bool1 = clearAllInProgress }, { "onChildDismissed from NSSL: childKey = $str1 -- clearAllInProgress:$bool1" }, ) } fun logOnSwipeBegin(loggingKey: String, reason: String, clearAllInProgress: Boolean) { notificationRenderBuffer.log( TAG, INFO, { str1 = loggingKey str2 = reason bool1 = clearAllInProgress }, { "onSwipeBegin from $str2: childKey = $str1 -- clearAllInProgress:$bool1" }, ) } fun logOnSwipeEnd(loggingKey: String, reason: String, clearAllInProgress: Boolean) { notificationRenderBuffer.log( TAG, INFO, { str1 = loggingKey str2 = reason bool1 = clearAllInProgress }, { "onSwipeEnd from $str2: childKey = $str1 -- clearAllInProgress:$bool1" }, ) } fun logOnChildNotDismissed( loggingKey: String, animationCancelled: Boolean, viewWasRemoved: Boolean, ) { notificationRenderBuffer.log( TAG, INFO, { str1 = loggingKey bool1 = animationCancelled bool2 = viewWasRemoved }, { "onChildNotDismissed (ERROR) childKey = $str1 " + "-- animationCancelled:$bool1 -- viewWasRemoved:$bool2" }, ) } } private const val TAG = "NotificationStackScroll"