Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowControllerTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import com.android.systemui.plugins.FalsingManager import com.android.systemui.plugins.PluginManager import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.statusbar.SmartReplyController import com.android.systemui.statusbar.notification.BundleInteractionLogger import com.android.systemui.statusbar.notification.ColorUpdateLogger import com.android.systemui.statusbar.notification.collection.EntryAdapter import com.android.systemui.statusbar.notification.collection.EntryAdapterFactory Loading Loading @@ -113,6 +114,7 @@ class ExpandableNotificationRowControllerTest : SysuiTestCase() { private val msdlPlayer: MSDLPlayer = mock() private val rebindingTracker: NotificationRebindingTracker = mock() private val entryAdapterFactory: EntryAdapterFactory = mock() private val bundleInteractionLogger: BundleInteractionLogger = mock() private lateinit var controller: ExpandableNotificationRowController @Before Loading Loading @@ -164,6 +166,7 @@ class ExpandableNotificationRowControllerTest : SysuiTestCase() { rebindingTracker, entryAdapterFactory, kosmos.windowRootViewBlurInteractor, bundleInteractionLogger, ) } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/BundleInteractionLogger.kt +15 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification import android.service.notification.Adjustment import com.android.internal.logging.UiEvent import com.android.internal.logging.UiEventLogger import com.android.internal.util.FrameworkStatsLog Loading @@ -24,13 +25,26 @@ import com.android.systemui.statusbar.notification.collection.BundleEntry import javax.inject.Inject enum class BundleInteractedEvent(private val _id: Int) : UiEventLogger.UiEventEnum { @UiEvent(doc = "User dismissed a bundle") NOTIF_BUNDLE_DISMISSED(2264); @UiEvent(doc = "User dismissed a bundle") NOTIF_BUNDLE_DISMISSED(2264), @UiEvent(doc = "User expanded a bundle") NOTIF_BUNDLE_EXPANDED(2343), @UiEvent(doc = "User collapsed a bundle") NOTIF_BUNDLE_COLLAPSED(2344); override fun getId() = _id } class BundleInteractionLogger @Inject constructor() { fun logBundleExpansionChanged(@Adjustment.Types bundleType: Int, nowExpanded: Boolean) { FrameworkStatsLog.write( FrameworkStatsLog.NOTIFICATION_BUNDLE_INTERACTED, /* optional int32 event_id */ if (nowExpanded) BundleInteractedEvent.NOTIF_BUNDLE_EXPANDED.id else BundleInteractedEvent.NOTIF_BUNDLE_COLLAPSED.id, /* optional int32 type */ bundleType, /* optional bool contents_shown */ true, // irrelevant but inherently true ) } fun logBundleDismissed(bundle: BundleEntry) { FrameworkStatsLog.write( FrameworkStatsLog.NOTIFICATION_BUNDLE_INTERACTED, Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleEntryAdapter.kt +4 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,10 @@ class BundleEntryAdapter( // do nothing. it should not be possible for a bundle to be contained within a bundle Log.wtf(TAG, "onBundleDisabled() called") } override fun getBundleType(): Int { return entry.bundleRepository.bundleType } } private const val TAG = "BundleEntryAdapter" packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/EntryAdapter.java +5 −0 Original line number Diff line number Diff line Loading @@ -243,5 +243,10 @@ public interface EntryAdapter { * Processes when the bundle this entry is within is disabled. */ void onBundleDisabled(); /** * Returns the bundle type of this entry if it is a bundle. */ int getBundleType(); } packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntryAdapter.kt +8 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.content.Context import android.os.SystemClock import android.service.notification.NotificationListenerService import android.service.notification.StatusBarNotification import android.util.Log import com.android.internal.logging.MetricsLogger import com.android.systemui.statusbar.notification.NotificationActivityStarter import com.android.systemui.statusbar.notification.collection.coordinator.BundleCoordinator.Companion.debugBundleAppName Loading Loading @@ -297,4 +298,11 @@ class NotificationEntryAdapter( row.attachedChildren?.forEach { it.entryAdapter.onBundleDisabled() } } } override fun getBundleType(): Int { Log.wtf(TAG, "getBundleType() called on non-bundle entry") return -1 } } private const val TAG = "NotifEntryAdapter" Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowControllerTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import com.android.systemui.plugins.FalsingManager import com.android.systemui.plugins.PluginManager import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.statusbar.SmartReplyController import com.android.systemui.statusbar.notification.BundleInteractionLogger import com.android.systemui.statusbar.notification.ColorUpdateLogger import com.android.systemui.statusbar.notification.collection.EntryAdapter import com.android.systemui.statusbar.notification.collection.EntryAdapterFactory Loading Loading @@ -113,6 +114,7 @@ class ExpandableNotificationRowControllerTest : SysuiTestCase() { private val msdlPlayer: MSDLPlayer = mock() private val rebindingTracker: NotificationRebindingTracker = mock() private val entryAdapterFactory: EntryAdapterFactory = mock() private val bundleInteractionLogger: BundleInteractionLogger = mock() private lateinit var controller: ExpandableNotificationRowController @Before Loading Loading @@ -164,6 +166,7 @@ class ExpandableNotificationRowControllerTest : SysuiTestCase() { rebindingTracker, entryAdapterFactory, kosmos.windowRootViewBlurInteractor, bundleInteractionLogger, ) } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/BundleInteractionLogger.kt +15 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification import android.service.notification.Adjustment import com.android.internal.logging.UiEvent import com.android.internal.logging.UiEventLogger import com.android.internal.util.FrameworkStatsLog Loading @@ -24,13 +25,26 @@ import com.android.systemui.statusbar.notification.collection.BundleEntry import javax.inject.Inject enum class BundleInteractedEvent(private val _id: Int) : UiEventLogger.UiEventEnum { @UiEvent(doc = "User dismissed a bundle") NOTIF_BUNDLE_DISMISSED(2264); @UiEvent(doc = "User dismissed a bundle") NOTIF_BUNDLE_DISMISSED(2264), @UiEvent(doc = "User expanded a bundle") NOTIF_BUNDLE_EXPANDED(2343), @UiEvent(doc = "User collapsed a bundle") NOTIF_BUNDLE_COLLAPSED(2344); override fun getId() = _id } class BundleInteractionLogger @Inject constructor() { fun logBundleExpansionChanged(@Adjustment.Types bundleType: Int, nowExpanded: Boolean) { FrameworkStatsLog.write( FrameworkStatsLog.NOTIFICATION_BUNDLE_INTERACTED, /* optional int32 event_id */ if (nowExpanded) BundleInteractedEvent.NOTIF_BUNDLE_EXPANDED.id else BundleInteractedEvent.NOTIF_BUNDLE_COLLAPSED.id, /* optional int32 type */ bundleType, /* optional bool contents_shown */ true, // irrelevant but inherently true ) } fun logBundleDismissed(bundle: BundleEntry) { FrameworkStatsLog.write( FrameworkStatsLog.NOTIFICATION_BUNDLE_INTERACTED, Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleEntryAdapter.kt +4 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,10 @@ class BundleEntryAdapter( // do nothing. it should not be possible for a bundle to be contained within a bundle Log.wtf(TAG, "onBundleDisabled() called") } override fun getBundleType(): Int { return entry.bundleRepository.bundleType } } private const val TAG = "BundleEntryAdapter"
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/EntryAdapter.java +5 −0 Original line number Diff line number Diff line Loading @@ -243,5 +243,10 @@ public interface EntryAdapter { * Processes when the bundle this entry is within is disabled. */ void onBundleDisabled(); /** * Returns the bundle type of this entry if it is a bundle. */ int getBundleType(); }
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntryAdapter.kt +8 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.content.Context import android.os.SystemClock import android.service.notification.NotificationListenerService import android.service.notification.StatusBarNotification import android.util.Log import com.android.internal.logging.MetricsLogger import com.android.systemui.statusbar.notification.NotificationActivityStarter import com.android.systemui.statusbar.notification.collection.coordinator.BundleCoordinator.Companion.debugBundleAppName Loading Loading @@ -297,4 +298,11 @@ class NotificationEntryAdapter( row.attachedChildren?.forEach { it.entryAdapter.onBundleDisabled() } } } override fun getBundleType(): Int { Log.wtf(TAG, "getBundleType() called on non-bundle entry") return -1 } } private const val TAG = "NotifEntryAdapter"