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

Commit b9c59bf9 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Nullability fixes for Kotlin 2.1

Bug: 399463072
Flag: EXEMPT minor refactor
Test: presubmits
Change-Id: Idc98ad570053970d232371133ba0958f218b9ef0
parent de78dfa6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -22,14 +22,14 @@ import com.google.common.truth.Subject
import com.google.common.truth.Truth

/** Subclass of [Subject] to simplify verifying [FakeUiEvent] data */
class UiEventSubject(metadata: FailureMetadata, private val actual: FakeUiEvent) :
class UiEventSubject(metadata: FailureMetadata, private val actual: FakeUiEvent?) :
    Subject(metadata, actual) {

    /** Check that [FakeUiEvent] contains the expected data from the [bubble] passed id */
    fun hasBubbleInfo(bubble: Bubble) {
        check("uid").that(actual.uid).isEqualTo(bubble.appUid)
        check("packageName").that(actual.packageName).isEqualTo(bubble.packageName)
        check("instanceId").that(actual.instanceId).isEqualTo(bubble.instanceId)
        check("uid").that(actual?.uid).isEqualTo(bubble.appUid)
        check("packageName").that(actual?.packageName).isEqualTo(bubble.packageName)
        check("instanceId").that(actual?.instanceId).isEqualTo(bubble.instanceId)
    }

    companion object {
+8 −8
Original line number Diff line number Diff line
@@ -18,27 +18,27 @@ package com.android.systemui.statusbar.notification.shared
import com.google.common.truth.Correspondence

val byKey: Correspondence<ActiveNotificationModel, String> =
    Correspondence.transforming({ it?.key }, "has a key of")
    Correspondence.transforming({ it.key }, "has a key of")
val byIsAmbient: Correspondence<ActiveNotificationModel, Boolean> =
    Correspondence.transforming({ it?.isAmbient }, "has an isAmbient value of")
    Correspondence.transforming({ it.isAmbient }, "has an isAmbient value of")
val byIsSuppressedFromStatusBar: Correspondence<ActiveNotificationModel, Boolean> =
    Correspondence.transforming(
        { it?.isSuppressedFromStatusBar },
        { it.isSuppressedFromStatusBar },
        "has an isSuppressedFromStatusBar value of",
    )
val byIsSilent: Correspondence<ActiveNotificationModel, Boolean> =
    Correspondence.transforming({ it?.isSilent }, "has an isSilent value of")
    Correspondence.transforming({ it.isSilent }, "has an isSilent value of")
val byIsRowDismissed: Correspondence<ActiveNotificationModel, Boolean> =
    Correspondence.transforming({ it?.isRowDismissed }, "has an isRowDismissed value of")
    Correspondence.transforming({ it.isRowDismissed }, "has an isRowDismissed value of")
val byIsLastMessageFromReply: Correspondence<ActiveNotificationModel, Boolean> =
    Correspondence.transforming(
        { it?.isLastMessageFromReply },
        { it.isLastMessageFromReply },
        "has an isLastMessageFromReply value of",
    )
val byIsPulsing: Correspondence<ActiveNotificationModel, Boolean> =
    Correspondence.transforming({ it?.isPulsing }, "has an isPulsing value of")
    Correspondence.transforming({ it.isPulsing }, "has an isPulsing value of")
val byIsPromoted: Correspondence<ActiveNotificationModel, Boolean> =
    Correspondence.transforming(
        { it?.promotedContent != null },
        { it.promotedContent != null },
        "has (or doesn't have) a promoted content model",
    )