summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dave Mankoff <mankoff@google.com> 2025-03-06 21:58:06 +0000
committer Dave Mankoff <mankoff@google.com> 2025-03-07 16:54:09 +0000
commitb9c59bf9f798fc893cbeed97e56505cf1fe30bf2 (patch)
tree49b809c25ec402c77b0c50f0fe9864f5d41a40ae
parentde78dfa68d5248d9f7e75c49aecc2d0ab876d9da (diff)
Nullability fixes for Kotlin 2.1
Bug: 399463072 Flag: EXEMPT minor refactor Test: presubmits Change-Id: Idc98ad570053970d232371133ba0958f218b9ef0
-rw-r--r--libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/UiEventSubject.kt8
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shared/TestActiveNotificationModel.kt16
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",
)