Fix SystemUI build for kotlin 1.7.0

Kotlin 1.7.0 converts the UNEXPECTED_SAFE_CALL warning into an error:

frameworks/base/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt:780:68: error:
type mismatch: inferred type is Boolean? but Boolean was expected
        if (useMediaResumption && removed?.resumeAction != null && removed?.isLocalSession()) {
                                                                   ^

Replace the unnecessary ?. operator.

Bug: 216136346
Test: builds
Change-Id: Ib1605aaff28492b557deac4156f3cc2f4cf8b329
(cherry picked from commit 6e3d0a66d2)
Merged-In: Ib1605aaff28492b557deac4156f3cc2f4cf8b329
This commit is contained in:
Colin Cross
2022-06-23 15:34:33 -07:00
parent f267c377bd
commit 32783b391e

View File

@@ -1130,7 +1130,7 @@ class MediaDataManager(
fun onNotificationRemoved(key: String) { fun onNotificationRemoved(key: String) {
Assert.isMainThread() Assert.isMainThread()
val removed = mediaEntries.remove(key) val removed = mediaEntries.remove(key)
if (useMediaResumption && removed?.resumeAction != null && removed?.isLocalSession()) { if (useMediaResumption && removed?.resumeAction != null && removed.isLocalSession()) {
Log.d(TAG, "Not removing $key because resumable") Log.d(TAG, "Not removing $key because resumable")
// Move to resume key (aka package name) if that key doesn't already exist. // Move to resume key (aka package name) if that key doesn't already exist.
val resumeAction = getResumeMediaAction(removed.resumeAction!!) val resumeAction = getResumeMediaAction(removed.resumeAction!!)