Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/row/NotificationRowPrimitives.kt +4 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.notifications.ui.composable.row import android.graphics.drawable.Drawable import androidx.annotation.DrawableRes import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border Loading Loading @@ -46,6 +47,7 @@ import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.android.compose.animation.scene.ContentScope Loading @@ -71,7 +73,7 @@ object NotificationRowPrimitives { /** The Icon displayed at the start of any notification row. */ @Composable fun ContentScope.BundleIcon(drawable: Drawable?, modifier: Modifier = Modifier) { fun ContentScope.BundleIcon(@DrawableRes drawable: Int?, modifier: Modifier = Modifier) { val surfaceColor = notificationElementSurfaceColor() Box( modifier = Loading @@ -82,7 +84,7 @@ fun ContentScope.BundleIcon(drawable: Drawable?, modifier: Modifier = Modifier) .background(color = surfaceColor, shape = CircleShape) ) { if (drawable == null) return@Box val painter = rememberDrawablePainter(drawable) val painter = painterResource(drawable) Image( painter = painter, contentDescription = null, Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleEntry.kt +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import kotlinx.coroutines.flow.MutableStateFlow class BundleEntry(spec: BundleSpec) : PipelineEntry(spec.key) { /** The model used by UI. */ val bundleRepository = BundleRepository(spec.titleTextResId) val bundleRepository = BundleRepository(spec.titleTextResId, spec.icon) // TODO(b/394483200): move NotificationEntry's implementation to PipelineEntry? val isSensitive: MutableStateFlow<Boolean> = MutableStateFlow(false) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleSpec.kt +11 −1 Original line number Diff line number Diff line Loading @@ -17,35 +17,45 @@ package com.android.systemui.statusbar.notification.collection import android.app.NotificationChannel import androidx.annotation.DrawableRes import androidx.annotation.StringRes import com.android.internal.R data class BundleSpec(val key: String, @StringRes val titleTextResId: Int) { data class BundleSpec( val key: String, @StringRes val titleTextResId: Int, @DrawableRes val icon: Int, ) { companion object { val PROMOTIONS = BundleSpec( key = NotificationChannel.PROMOTIONS_ID, titleTextResId = R.string.promotional_notification_channel_label, icon = com.android.settingslib.R.drawable.ic_promotions, ) val SOCIAL_MEDIA = BundleSpec( key = NotificationChannel.SOCIAL_MEDIA_ID, titleTextResId = R.string.social_notification_channel_label, icon = com.android.settingslib.R.drawable.ic_social, ) val NEWS = BundleSpec( key = NotificationChannel.NEWS_ID, titleTextResId = R.string.news_notification_channel_label, icon = com.android.settingslib.R.drawable.ic_news, ) val RECOMMENDED = BundleSpec( key = NotificationChannel.RECS_ID, titleTextResId = R.string.recs_notification_channel_label, icon = com.android.settingslib.R.drawable.ic_recs, ) val DEBUG = BundleSpec( key = "debug_bundle", titleTextResId = R.string.notification_channel_developer, icon = com.android.systemui.res.R.drawable.ic_person, ) } } packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntryAdapter.kt +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import android.service.notification.NotificationListenerService import android.service.notification.StatusBarNotification import com.android.internal.logging.MetricsLogger import com.android.systemui.statusbar.notification.NotificationActivityStarter import com.android.systemui.statusbar.notification.collection.coordinator.BundleCoordinator import com.android.systemui.statusbar.notification.collection.coordinator.BundleCoordinator.Companion.debugBundleAppName import com.android.systemui.statusbar.notification.collection.coordinator.VisualStabilityCoordinator import com.android.systemui.statusbar.notification.collection.notifcollection.NotifLifetimeExtender import com.android.systemui.statusbar.notification.collection.provider.HighPriorityProvider Loading Loading @@ -270,7 +270,7 @@ class NotificationEntryAdapter( } override fun isBundled(): Boolean { return entry.isBundled || (BundleCoordinator.Companion.debugBundleUi && hasBundleParent()) return entry.isBundled || (!debugBundleAppName.isNullOrEmpty() && hasBundleParent()) } private fun hasBundleParent(): Boolean { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java +2 −4 Original line number Diff line number Diff line Loading @@ -294,9 +294,7 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable { mIdToBundleEntry.clear(); for (BundleSpec spec : mNotifBundler.getBundleSpecs()) { if (BundleCoordinator.debugBundleUi) { Log.i(TAG, "create BundleEntry with id: " + spec.getKey()); } debugBundleLog(TAG, () -> "create BundleEntry with id: " + spec.getKey()); mIdToBundleEntry.put(spec.getKey(), new BundleEntry(spec)); } } Loading Loading @@ -722,7 +720,7 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable { } private void debugList(String s) { if (!BundleCoordinator.debugBundleUi) { if (!BundleCoordinator.debugBundleLogs) { return; } StringBuilder listStr = new StringBuilder(); Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/row/NotificationRowPrimitives.kt +4 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.notifications.ui.composable.row import android.graphics.drawable.Drawable import androidx.annotation.DrawableRes import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border Loading Loading @@ -46,6 +47,7 @@ import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.android.compose.animation.scene.ContentScope Loading @@ -71,7 +73,7 @@ object NotificationRowPrimitives { /** The Icon displayed at the start of any notification row. */ @Composable fun ContentScope.BundleIcon(drawable: Drawable?, modifier: Modifier = Modifier) { fun ContentScope.BundleIcon(@DrawableRes drawable: Int?, modifier: Modifier = Modifier) { val surfaceColor = notificationElementSurfaceColor() Box( modifier = Loading @@ -82,7 +84,7 @@ fun ContentScope.BundleIcon(drawable: Drawable?, modifier: Modifier = Modifier) .background(color = surfaceColor, shape = CircleShape) ) { if (drawable == null) return@Box val painter = rememberDrawablePainter(drawable) val painter = painterResource(drawable) Image( painter = painter, contentDescription = null, Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleEntry.kt +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import kotlinx.coroutines.flow.MutableStateFlow class BundleEntry(spec: BundleSpec) : PipelineEntry(spec.key) { /** The model used by UI. */ val bundleRepository = BundleRepository(spec.titleTextResId) val bundleRepository = BundleRepository(spec.titleTextResId, spec.icon) // TODO(b/394483200): move NotificationEntry's implementation to PipelineEntry? val isSensitive: MutableStateFlow<Boolean> = MutableStateFlow(false) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleSpec.kt +11 −1 Original line number Diff line number Diff line Loading @@ -17,35 +17,45 @@ package com.android.systemui.statusbar.notification.collection import android.app.NotificationChannel import androidx.annotation.DrawableRes import androidx.annotation.StringRes import com.android.internal.R data class BundleSpec(val key: String, @StringRes val titleTextResId: Int) { data class BundleSpec( val key: String, @StringRes val titleTextResId: Int, @DrawableRes val icon: Int, ) { companion object { val PROMOTIONS = BundleSpec( key = NotificationChannel.PROMOTIONS_ID, titleTextResId = R.string.promotional_notification_channel_label, icon = com.android.settingslib.R.drawable.ic_promotions, ) val SOCIAL_MEDIA = BundleSpec( key = NotificationChannel.SOCIAL_MEDIA_ID, titleTextResId = R.string.social_notification_channel_label, icon = com.android.settingslib.R.drawable.ic_social, ) val NEWS = BundleSpec( key = NotificationChannel.NEWS_ID, titleTextResId = R.string.news_notification_channel_label, icon = com.android.settingslib.R.drawable.ic_news, ) val RECOMMENDED = BundleSpec( key = NotificationChannel.RECS_ID, titleTextResId = R.string.recs_notification_channel_label, icon = com.android.settingslib.R.drawable.ic_recs, ) val DEBUG = BundleSpec( key = "debug_bundle", titleTextResId = R.string.notification_channel_developer, icon = com.android.systemui.res.R.drawable.ic_person, ) } }
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntryAdapter.kt +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import android.service.notification.NotificationListenerService import android.service.notification.StatusBarNotification import com.android.internal.logging.MetricsLogger import com.android.systemui.statusbar.notification.NotificationActivityStarter import com.android.systemui.statusbar.notification.collection.coordinator.BundleCoordinator import com.android.systemui.statusbar.notification.collection.coordinator.BundleCoordinator.Companion.debugBundleAppName import com.android.systemui.statusbar.notification.collection.coordinator.VisualStabilityCoordinator import com.android.systemui.statusbar.notification.collection.notifcollection.NotifLifetimeExtender import com.android.systemui.statusbar.notification.collection.provider.HighPriorityProvider Loading Loading @@ -270,7 +270,7 @@ class NotificationEntryAdapter( } override fun isBundled(): Boolean { return entry.isBundled || (BundleCoordinator.Companion.debugBundleUi && hasBundleParent()) return entry.isBundled || (!debugBundleAppName.isNullOrEmpty() && hasBundleParent()) } private fun hasBundleParent(): Boolean { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java +2 −4 Original line number Diff line number Diff line Loading @@ -294,9 +294,7 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable { mIdToBundleEntry.clear(); for (BundleSpec spec : mNotifBundler.getBundleSpecs()) { if (BundleCoordinator.debugBundleUi) { Log.i(TAG, "create BundleEntry with id: " + spec.getKey()); } debugBundleLog(TAG, () -> "create BundleEntry with id: " + spec.getKey()); mIdToBundleEntry.put(spec.getKey(), new BundleEntry(spec)); } } Loading Loading @@ -722,7 +720,7 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable { } private void debugList(String s) { if (!BundleCoordinator.debugBundleUi) { if (!BundleCoordinator.debugBundleLogs) { return; } StringBuilder listStr = new StringBuilder(); Loading