diff options
2 files changed, 12 insertions, 12 deletions
diff --git a/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/UiEventSubject.kt b/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/UiEventSubject.kt index 2d6df43f67e0..3597ce0041d4 100644 --- a/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/UiEventSubject.kt +++ b/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/UiEventSubject.kt @@ -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 { diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shared/TestActiveNotificationModel.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shared/TestActiveNotificationModel.kt index 531b30b9547a..0fb0548582ce 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shared/TestActiveNotificationModel.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shared/TestActiveNotificationModel.kt @@ -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", ) |