summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan O'Leary <ryanaoleary@google.com>2022-07-14 20:00:10 +0000
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2022-10-07 22:54:17 +0000
commit7c3d4069aa81a8484134abbfe38215b52deb3048 (patch)
tree12314d73878bd018f3edaa02a0e406fbe4a1be11
parentaab1821020a5cf64b3603fb3787746b65ce24a3a (diff)
downloadDeskClock-7c3d4069aa81a8484134abbfe38215b52deb3048.tar.gz
AOSP DeskClock contains multiple warnings that become errors when updating to Kotlin 1.7. One such error is that 'when' expressions must be exhaustive (even if all cases are functionally covered). A simple fix for this is to simply add an empty null branch (i.e. null -> { }) at the end of the when statement. Bug: 237017037 Test: Ran `adb shell am instrument -w com.android.deskclock.tests` with output: Time: 54.056 OK (68 tests) Change-Id: Icfbeaf6d380efcc17cc02bc8299c9ba64c202d2e (cherry picked from commit 2d796a4ee72adf6d2016f7650c50b8eb6ec0c8e7) Merged-In: Icfbeaf6d380efcc17cc02bc8299c9ba64c202d2e
-rw-r--r--src/com/android/deskclock/alarms/AlarmActivity.kt1
-rw-r--r--src/com/android/deskclock/timer/TimerItem.kt1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/deskclock/alarms/AlarmActivity.kt b/src/com/android/deskclock/alarms/AlarmActivity.kt
index a4caf1a74..8d9535de0 100644
--- a/src/com/android/deskclock/alarms/AlarmActivity.kt
+++ b/src/com/android/deskclock/alarms/AlarmActivity.kt
@@ -283,6 +283,7 @@ class AlarmActivity : BaseActivity(), View.OnClickListener, View.OnTouchListener
}
AlarmVolumeButtonBehavior.NOTHING -> {
}
+ null -> { }
}
}
}
diff --git a/src/com/android/deskclock/timer/TimerItem.kt b/src/com/android/deskclock/timer/TimerItem.kt
index 9cdcca438..a0573cf18 100644
--- a/src/com/android/deskclock/timer/TimerItem.kt
+++ b/src/com/android/deskclock/timer/TimerItem.kt
@@ -138,6 +138,7 @@ class TimerItem @JvmOverloads constructor(
mTimerText.isActivated = true
mTimerText.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO
}
+ null -> { }
}
}
}