Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AutomaticPromotionCoordinator.kt +8 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,14 @@ interface AutomaticPromotionCoordinator : Coordinator { * (but not normally promoted notifications). */ const val EXTRA_WAS_AUTOMATICALLY_PROMOTED = "android.wasAutomaticallyPromoted" /** * An extra set only on automatically promoted notifications that contains text that could * reasonably be the short critical text. For now, we're only extracting arrival times. Will * be set as a String. */ const val EXTRA_AUTOMATICALLY_EXTRACTED_SHORT_CRITICAL_TEXT = "android.automaticallyExtractedShortCriticalText" } } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/PromotedNotificationContentExtractor.kt +9 −1 Original line number Diff line number Diff line Loading @@ -26,9 +26,11 @@ import android.app.Notification.EXTRA_TEXT import android.app.Notification.EXTRA_TITLE import android.app.Notification.ProgressStyle import android.content.Context import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.promoted.AutomaticPromotionCoordinator.Companion.EXTRA_AUTOMATICALLY_EXTRACTED_SHORT_CRITICAL_TEXT import com.android.systemui.statusbar.notification.promoted.AutomaticPromotionCoordinator.Companion.EXTRA_WAS_AUTOMATICALLY_PROMOTED import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel.Companion.isPromotedForStatusBarChip Loading Loading @@ -113,8 +115,14 @@ private fun Notification.shortCriticalText(): String? { if (!android.app.Flags.apiRichOngoing()) { return null } if (this.shortCriticalText != null) { return this.shortCriticalText } if (Flags.promoteNotificationsAutomatically()) { return this.extras?.getString(EXTRA_AUTOMATICALLY_EXTRACTED_SHORT_CRITICAL_TEXT) } return null } private fun Notification.chronometerCountDown(): Boolean = extras?.getBoolean(EXTRA_CHRONOMETER_COUNT_DOWN, /* defaultValue= */ false) ?: false Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AutomaticPromotionCoordinator.kt +8 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,14 @@ interface AutomaticPromotionCoordinator : Coordinator { * (but not normally promoted notifications). */ const val EXTRA_WAS_AUTOMATICALLY_PROMOTED = "android.wasAutomaticallyPromoted" /** * An extra set only on automatically promoted notifications that contains text that could * reasonably be the short critical text. For now, we're only extracting arrival times. Will * be set as a String. */ const val EXTRA_AUTOMATICALLY_EXTRACTED_SHORT_CRITICAL_TEXT = "android.automaticallyExtractedShortCriticalText" } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/PromotedNotificationContentExtractor.kt +9 −1 Original line number Diff line number Diff line Loading @@ -26,9 +26,11 @@ import android.app.Notification.EXTRA_TEXT import android.app.Notification.EXTRA_TITLE import android.app.Notification.ProgressStyle import android.content.Context import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.promoted.AutomaticPromotionCoordinator.Companion.EXTRA_AUTOMATICALLY_EXTRACTED_SHORT_CRITICAL_TEXT import com.android.systemui.statusbar.notification.promoted.AutomaticPromotionCoordinator.Companion.EXTRA_WAS_AUTOMATICALLY_PROMOTED import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel.Companion.isPromotedForStatusBarChip Loading Loading @@ -113,8 +115,14 @@ private fun Notification.shortCriticalText(): String? { if (!android.app.Flags.apiRichOngoing()) { return null } if (this.shortCriticalText != null) { return this.shortCriticalText } if (Flags.promoteNotificationsAutomatically()) { return this.extras?.getString(EXTRA_AUTOMATICALLY_EXTRACTED_SHORT_CRITICAL_TEXT) } return null } private fun Notification.chronometerCountDown(): Boolean = extras?.getBoolean(EXTRA_CHRONOMETER_COUNT_DOWN, /* defaultValue= */ false) ?: false Loading