Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImplTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -571,6 +571,8 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { override fun canRowBeDismissed(): Boolean { return canRowBeDismissed } override fun getRowLoggingKey(): String = "testable listener" } } } packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java +10 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,16 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable, Ro public boolean canRowBeDismissed() { return canExpandableViewBeDismissed(); } @NonNull @Override public String getRowLoggingKey() { if (ExpandableView.this instanceof ExpandableNotificationRow row) { return row.getLoggingKey(); } else { return "null"; } } }; /** Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt +37 −14 Original line number Diff line number Diff line Loading @@ -55,10 +55,7 @@ constructor( ) } fun logRemoveTransientFromContainer( childEntry: String, containerEntry: String, ) { fun logRemoveTransientFromContainer(childEntry: String, containerEntry: String) { notificationRenderBuffer.log( TAG, LogLevel.INFO, Loading Loading @@ -91,11 +88,7 @@ constructor( ) } fun logAddTransientRow( childEntry: String, containerEntry: String, index: Int, ) { fun logAddTransientRow(childEntry: String, containerEntry: String, index: Int) { notificationRenderBuffer.log( TAG, LogLevel.ERROR, Loading Loading @@ -186,11 +179,7 @@ constructor( ) } fun logAppearAnimationFinished( entry: String, isAppear: Boolean, cancelled: Boolean, ) { fun logAppearAnimationFinished(entry: String, isAppear: Boolean, cancelled: Boolean) { notificationRenderBuffer.log( TAG, LogLevel.DEBUG, Loading Loading @@ -232,6 +221,40 @@ constructor( { "Failed to set magnetic row translation for $str1 on state $str2." }, ) } fun logMagneticRowManagerStateSet( loggingKey: String, from: MagneticNotificationRowManagerImpl.State, to: MagneticNotificationRowManagerImpl.State, ) { buffer.log( TAG, LogLevel.DEBUG, { str1 = loggingKey str2 = from.name str3 = to.name }, { "Magnetic state changed from $str2 to $str3 for notification: $str1" }, ) } fun logMagneticRowManagerInvalidStateChange( from: MagneticNotificationRowManagerImpl.State, to: MagneticNotificationRowManagerImpl.State, ) { buffer.log( TAG, LogLevel.ERROR, { str1 = from.name str2 = to.name }, { "Magnetic state changed from $str1 to $str2 on a null swiped listener, or the logging key of the listener is null" }, ) } } private const val TAG = "NotifRow" packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImpl.kt +14 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,20 @@ constructor( ) : MagneticNotificationRowManager { var currentState = State.IDLE private set private set(value) { val swipedLoggingKey = currentMagneticListeners.swipedListener()?.getRowLoggingKey().toString() if (swipedLoggingKey == "null") { logger.logMagneticRowManagerInvalidStateChange(from = currentState, to = value) } else { logger.logMagneticRowManagerStateSet( loggingKey = swipedLoggingKey, from = currentState, to = value, ) } field = value } // Magnetic targets var currentMagneticListeners = listOf<MagneticRowListener?>() Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MagneticRowListener.kt +3 −0 Original line number Diff line number Diff line Loading @@ -53,4 +53,7 @@ interface MagneticRowListener { /** Can the row be dismissed. */ fun canRowBeDismissed(): Boolean /** Get the logging key associated with this [MagneticRowListener] */ fun getRowLoggingKey(): String } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImplTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -571,6 +571,8 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { override fun canRowBeDismissed(): Boolean { return canRowBeDismissed } override fun getRowLoggingKey(): String = "testable listener" } } }
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java +10 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,16 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable, Ro public boolean canRowBeDismissed() { return canExpandableViewBeDismissed(); } @NonNull @Override public String getRowLoggingKey() { if (ExpandableView.this instanceof ExpandableNotificationRow row) { return row.getLoggingKey(); } else { return "null"; } } }; /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt +37 −14 Original line number Diff line number Diff line Loading @@ -55,10 +55,7 @@ constructor( ) } fun logRemoveTransientFromContainer( childEntry: String, containerEntry: String, ) { fun logRemoveTransientFromContainer(childEntry: String, containerEntry: String) { notificationRenderBuffer.log( TAG, LogLevel.INFO, Loading Loading @@ -91,11 +88,7 @@ constructor( ) } fun logAddTransientRow( childEntry: String, containerEntry: String, index: Int, ) { fun logAddTransientRow(childEntry: String, containerEntry: String, index: Int) { notificationRenderBuffer.log( TAG, LogLevel.ERROR, Loading Loading @@ -186,11 +179,7 @@ constructor( ) } fun logAppearAnimationFinished( entry: String, isAppear: Boolean, cancelled: Boolean, ) { fun logAppearAnimationFinished(entry: String, isAppear: Boolean, cancelled: Boolean) { notificationRenderBuffer.log( TAG, LogLevel.DEBUG, Loading Loading @@ -232,6 +221,40 @@ constructor( { "Failed to set magnetic row translation for $str1 on state $str2." }, ) } fun logMagneticRowManagerStateSet( loggingKey: String, from: MagneticNotificationRowManagerImpl.State, to: MagneticNotificationRowManagerImpl.State, ) { buffer.log( TAG, LogLevel.DEBUG, { str1 = loggingKey str2 = from.name str3 = to.name }, { "Magnetic state changed from $str2 to $str3 for notification: $str1" }, ) } fun logMagneticRowManagerInvalidStateChange( from: MagneticNotificationRowManagerImpl.State, to: MagneticNotificationRowManagerImpl.State, ) { buffer.log( TAG, LogLevel.ERROR, { str1 = from.name str2 = to.name }, { "Magnetic state changed from $str1 to $str2 on a null swiped listener, or the logging key of the listener is null" }, ) } } private const val TAG = "NotifRow"
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImpl.kt +14 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,20 @@ constructor( ) : MagneticNotificationRowManager { var currentState = State.IDLE private set private set(value) { val swipedLoggingKey = currentMagneticListeners.swipedListener()?.getRowLoggingKey().toString() if (swipedLoggingKey == "null") { logger.logMagneticRowManagerInvalidStateChange(from = currentState, to = value) } else { logger.logMagneticRowManagerStateSet( loggingKey = swipedLoggingKey, from = currentState, to = value, ) } field = value } // Magnetic targets var currentMagneticListeners = listOf<MagneticRowListener?>() Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MagneticRowListener.kt +3 −0 Original line number Diff line number Diff line Loading @@ -53,4 +53,7 @@ interface MagneticRowListener { /** Can the row be dismissed. */ fun canRowBeDismissed(): Boolean /** Get the logging key associated with this [MagneticRowListener] */ fun getRowLoggingKey(): String }