Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/BundleInteractionLogger.kt +11 −2 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.statusbar.notification import com.android.internal.logging.UiEvent import com.android.internal.logging.UiEvent import com.android.internal.logging.UiEventLogger import com.android.internal.logging.UiEventLogger import com.android.internal.util.FrameworkStatsLog import com.android.internal.util.FrameworkStatsLog import com.android.systemui.notifications.ui.composable.row.BundleHeader import com.android.systemui.statusbar.notification.collection.BundleEntry import com.android.systemui.statusbar.notification.collection.BundleEntry import javax.inject.Inject import javax.inject.Inject Loading @@ -35,8 +36,16 @@ class BundleInteractionLogger @Inject constructor() { FrameworkStatsLog.NOTIFICATION_BUNDLE_INTERACTED, FrameworkStatsLog.NOTIFICATION_BUNDLE_INTERACTED, /* optional int32 event_id */ BundleInteractedEvent.NOTIF_BUNDLE_DISMISSED.id, /* optional int32 event_id */ BundleInteractedEvent.NOTIF_BUNDLE_DISMISSED.id, /* optional int32 type */ bundle.bundleRepository.bundleType, /* optional int32 type */ bundle.bundleRepository.bundleType, // TODO: b/415113012 - correctly reflect whether the bundle was ever expanded /* optional bool contents_shown */ bundleContentsShown(bundle), /* optional bool contents_shown */ false, ) ) } } fun bundleContentsShown(bundle: BundleEntry): Boolean { // Consider a bundle's contents to have been shown either if it has ever been collapsed // before or if it's expanded now. Otherwise, assume it to have never been opened. // TODO: b/422234721 - this logic doesn't correctly handle if the bundle was collapsed by // the entire shade closing rather than directly by the user return (bundle.bundleRepository.lastCollapseTime > 0L) || bundle.bundleRepository.state?.currentScene == BundleHeader.Scenes.Expanded } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/BundleInteractionLogger.kt +11 −2 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.statusbar.notification import com.android.internal.logging.UiEvent import com.android.internal.logging.UiEvent import com.android.internal.logging.UiEventLogger import com.android.internal.logging.UiEventLogger import com.android.internal.util.FrameworkStatsLog import com.android.internal.util.FrameworkStatsLog import com.android.systemui.notifications.ui.composable.row.BundleHeader import com.android.systemui.statusbar.notification.collection.BundleEntry import com.android.systemui.statusbar.notification.collection.BundleEntry import javax.inject.Inject import javax.inject.Inject Loading @@ -35,8 +36,16 @@ class BundleInteractionLogger @Inject constructor() { FrameworkStatsLog.NOTIFICATION_BUNDLE_INTERACTED, FrameworkStatsLog.NOTIFICATION_BUNDLE_INTERACTED, /* optional int32 event_id */ BundleInteractedEvent.NOTIF_BUNDLE_DISMISSED.id, /* optional int32 event_id */ BundleInteractedEvent.NOTIF_BUNDLE_DISMISSED.id, /* optional int32 type */ bundle.bundleRepository.bundleType, /* optional int32 type */ bundle.bundleRepository.bundleType, // TODO: b/415113012 - correctly reflect whether the bundle was ever expanded /* optional bool contents_shown */ bundleContentsShown(bundle), /* optional bool contents_shown */ false, ) ) } } fun bundleContentsShown(bundle: BundleEntry): Boolean { // Consider a bundle's contents to have been shown either if it has ever been collapsed // before or if it's expanded now. Otherwise, assume it to have never been opened. // TODO: b/422234721 - this logic doesn't correctly handle if the bundle was collapsed by // the entire shade closing rather than directly by the user return (bundle.bundleRepository.lastCollapseTime > 0L) || bundle.bundleRepository.state?.currentScene == BundleHeader.Scenes.Expanded } } }