Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62892489 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

refactor: apply Sayantan's suggestion again

parent 43154100
Loading
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -202,14 +202,10 @@ class SystemAppsUpdatesRepository @Inject constructor(
     * or stop to support an old one
     */
    private fun getAndroidVersionCodeChar(): String {
        val baseAPI = Build.VERSION_CODES.BASE
        val lastUnsupportedAPI = Build.VERSION_CODES.R

        return when (val currentAPI = Build.VERSION.SDK_INT) {
            in baseAPI.. lastUnsupportedAPI -> throw UnsupportedAndroidApiException("Android $currentAPI is not supported anymore")
            Build.VERSION_CODES.S -> "S"
            Build.VERSION_CODES.TIRAMISU -> "T"
            else -> throw UnsupportedAndroidApiException("Android $currentAPI and above is not yet supported")
            else -> throw UnsupportedAndroidApiException("API level $currentAPI is not supported")
        }
    }