diff options
| author | 2022-06-24 11:36:41 -0700 | |
|---|---|---|
| committer | 2022-08-17 19:18:58 +0000 | |
| commit | 0a1823f99029e7bf8289259e7467f6b0915aad3f (patch) | |
| tree | 5b342d9bb3928f35e76d35132d8c5533958413d1 | |
| parent | e648d3cb91f9a0156c729ca18ec27e71f59f9ce2 (diff) | |
Fix more kotlin 1.7.0 errors
Fix "'when' expression must be exhaustive" and UNEXPECTED_SAFE_CALL
errors.
Bug: 216136346
Test: m checkbuild
Change-Id: I2c1b1f7581426496f31198896c4ff3bd9abf2941
Merged-In: I2c1b1f7581426496f31198896c4ff3bd9abf2941
3 files changed, 4 insertions, 2 deletions
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/MediaResumeListenerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/MediaResumeListenerTest.kt index 3d3ac836d264..83168cb87dfe 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/media/MediaResumeListenerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/media/MediaResumeListenerTest.kt @@ -305,7 +305,7 @@ class MediaResumeListenerTest : SysuiTestCase() { // Then we save an update with the current time verify(sharedPrefsEditor).putString(any(), (capture(componentCaptor))) componentCaptor.value.split(ResumeMediaBrowser.DELIMITER.toRegex()) - ?.dropLastWhile { it.isEmpty() }.forEach { + .dropLastWhile { it.isEmpty() }.forEach { val result = it.split("/") assertThat(result.size).isEqualTo(3) assertThat(result[2].toLong()).isEqualTo(currentTime) @@ -392,7 +392,7 @@ class MediaResumeListenerTest : SysuiTestCase() { // Then we store the new lastPlayed time verify(sharedPrefsEditor).putString(any(), (capture(componentCaptor))) componentCaptor.value.split(ResumeMediaBrowser.DELIMITER.toRegex()) - ?.dropLastWhile { it.isEmpty() }.forEach { + .dropLastWhile { it.isEmpty() }.forEach { val result = it.split("/") assertThat(result.size).isEqualTo(3) assertThat(result[2].toLong()).isEqualTo(currentTime) diff --git a/services/tests/PackageManagerServiceTests/host/src/com/android/server/pm/test/SystemStubMultiUserDisableUninstallTest.kt b/services/tests/PackageManagerServiceTests/host/src/com/android/server/pm/test/SystemStubMultiUserDisableUninstallTest.kt index 45e0d09a1753..4ef6875dd310 100644 --- a/services/tests/PackageManagerServiceTests/host/src/com/android/server/pm/test/SystemStubMultiUserDisableUninstallTest.kt +++ b/services/tests/PackageManagerServiceTests/host/src/com/android/server/pm/test/SystemStubMultiUserDisableUninstallTest.kt @@ -628,6 +628,7 @@ class SystemStubMultiUserDisableUninstallTest : BaseHostJUnit4Test() { CodePath.SAME, CodePath.DIFFERENT -> throw AssertionError("secondDataPath cannot be a data path") CodePath.SYSTEM -> assertThat(codePaths[1]).isEqualTo(stubFile.parent.toString()) + else -> {} } } diff --git a/tools/xmlpersistence/src/main/kotlin/Generator.kt b/tools/xmlpersistence/src/main/kotlin/Generator.kt index b2c5f4ac767b..8e62388c860f 100644 --- a/tools/xmlpersistence/src/main/kotlin/Generator.kt +++ b/tools/xmlpersistence/src/main/kotlin/Generator.kt @@ -149,6 +149,7 @@ private val ClassFieldInfo.allClassFields: List<ClassFieldInfo> when (field) { is ClassFieldInfo -> this += field.allClassFields is ListFieldInfo -> this += field.element.allClassFields + else -> {} } } } |