Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8766c336 authored by Julia Tuttle's avatar Julia Tuttle
Browse files

Move layoutResource check out of key block to avoid Compose crash

Bug: 398194709
Flag: com.android.systemui.aod_ui_rich_ongoing
Test: manual: Notify.apk, Inbox, ongoing, autobundle, colorize bg
Change-Id: I2aaf187adf36cb9b76e12049dada36d826585dbd
parent b9f5056b
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.app.Flags
import android.app.Flags.notificationsRedesignTemplates
import android.app.Notification
import android.graphics.PorterDuff
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.View.GONE
@@ -80,9 +81,13 @@ fun AODPromotedNotification(
    val content = viewModel.content ?: return
    val audiblyAlertedIconVisible = viewModel.audiblyAlertedIconVisible

    key(content.identity) {
        val layoutResource = content.layoutResource ?: return
    val layoutResource = content.layoutResource
    if (layoutResource == null) {
        Log.w(TAG, "not displaying promoted notif with ineligible style on AOD")
        return
    }

    key(content.identity) {
        val sidePaddings = dimensionResource(systemuiR.dimen.notification_side_paddings)
        val sidePaddingValues = PaddingValues(horizontal = sidePaddings, vertical = 0.dp)