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
(cherry picked from commit 64acfee25d)
Merged-In: I2c1b1f7581426496f31198896c4ff3bd9abf2941
This commit is contained in:
Colin Cross
2022-06-24 11:36:41 -07:00
parent f267c377bd
commit 2bab49dd2f
4 changed files with 5 additions and 2 deletions

View File

@@ -417,6 +417,7 @@ class BackPanelController private constructor(
stretchEntryBackIndicator(preThresholdStretchProgress(xTranslation))
GestureState.INACTIVE ->
mView.resetStretch()
else -> {}
}
// set y translation

View File

@@ -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)

View File

@@ -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 -> {}
}
}

View File

@@ -149,6 +149,7 @@ private val ClassFieldInfo.allClassFields: List<ClassFieldInfo>
when (field) {
is ClassFieldInfo -> this += field.allClassFields
is ListFieldInfo -> this += field.element.allClassFields
else -> {}
}
}
}