Loading packages/SystemUI/res/values/ids.xml +1 −0 Original line number Diff line number Diff line Loading @@ -296,6 +296,7 @@ <item type="id" name="brightness_dialog_slider" /> <item type="id" name="aod_promoted_notification_view_updater_tag" /> <item type="id" name="aod_promoted_notification_inflation_identity" /> <!-- id for the composable battery meter (see UnifiedBattery.kt) --> <item type="id" name="battery_meter_composable_view" /> Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt +2 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ fun AODPromotedNotification( Log.w(TAG, "not displaying promoted notif with ineligible style on AOD") return } key(content.identity) { key(content.identity, notificationView.getTag(viewInflationIdentity)) { AODPromotedNotificationView( notificationViewFactory = { notificationView }, content = content, Loading Loading @@ -815,5 +815,6 @@ private fun scaledFontHeight(@DimenRes dimenId: Int): Dp { } private val viewUpdaterTagId = systemuiR.id.aod_promoted_notification_view_updater_tag private val viewInflationIdentity = systemuiR.id.aod_promoted_notification_inflation_identity private const val TAG = "AODPromotedNotification" packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/PromotedNotificationContentExtractor.kt +12 −0 Original line number Diff line number Diff line Loading @@ -259,6 +259,8 @@ constructor( return contentBuilder.build() } private data class InflationIdentity(val layout: Int, val density: Float, val scale: Float) private fun inflateNotificationView( contentBuilder: PromotedNotificationContentModel.Builder, systemUiContext: Context, Loading @@ -275,6 +277,16 @@ constructor( trace("AODPromotedNotification#inflate") { contentBuilder.notificationView = LayoutInflater.from(systemUiContext).inflate(res, /* root= */ null) val inflationIdentity = InflationIdentity( layout = res, density = systemUiContext.resources.displayMetrics.density, scale = systemUiContext.resources.displayMetrics.scaledDensity, ) contentBuilder.notificationView?.setTag( com.android.systemui.res.R.id.aod_promoted_notification_inflation_identity, inflationIdentity, ) } } Loading Loading
packages/SystemUI/res/values/ids.xml +1 −0 Original line number Diff line number Diff line Loading @@ -296,6 +296,7 @@ <item type="id" name="brightness_dialog_slider" /> <item type="id" name="aod_promoted_notification_view_updater_tag" /> <item type="id" name="aod_promoted_notification_inflation_identity" /> <!-- id for the composable battery meter (see UnifiedBattery.kt) --> <item type="id" name="battery_meter_composable_view" /> Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt +2 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ fun AODPromotedNotification( Log.w(TAG, "not displaying promoted notif with ineligible style on AOD") return } key(content.identity) { key(content.identity, notificationView.getTag(viewInflationIdentity)) { AODPromotedNotificationView( notificationViewFactory = { notificationView }, content = content, Loading Loading @@ -815,5 +815,6 @@ private fun scaledFontHeight(@DimenRes dimenId: Int): Dp { } private val viewUpdaterTagId = systemuiR.id.aod_promoted_notification_view_updater_tag private val viewInflationIdentity = systemuiR.id.aod_promoted_notification_inflation_identity private const val TAG = "AODPromotedNotification"
packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/PromotedNotificationContentExtractor.kt +12 −0 Original line number Diff line number Diff line Loading @@ -259,6 +259,8 @@ constructor( return contentBuilder.build() } private data class InflationIdentity(val layout: Int, val density: Float, val scale: Float) private fun inflateNotificationView( contentBuilder: PromotedNotificationContentModel.Builder, systemUiContext: Context, Loading @@ -275,6 +277,16 @@ constructor( trace("AODPromotedNotification#inflate") { contentBuilder.notificationView = LayoutInflater.from(systemUiContext).inflate(res, /* root= */ null) val inflationIdentity = InflationIdentity( layout = res, density = systemUiContext.resources.displayMetrics.density, scale = systemUiContext.resources.displayMetrics.scaledDensity, ) contentBuilder.notificationView?.setTag( com.android.systemui.res.R.id.aod_promoted_notification_inflation_identity, inflationIdentity, ) } } Loading