Use the existing extension for api version check

This commit is contained in:
Naveen 2022-09-18 22:54:51 +05:30
parent b85dbf3b4b
commit f4575401f5
1 changed files with 1 additions and 2 deletions

View File

@ -16,7 +16,6 @@ import android.media.AudioAttributes
import android.media.AudioManager import android.media.AudioManager
import android.media.RingtoneManager import android.media.RingtoneManager
import android.net.Uri import android.net.Uri
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
@ -997,7 +996,7 @@ fun Context.clearAllMessagesIfNeeded() {
} }
fun Context.subscriptionManagerCompat(): SubscriptionManager { fun Context.subscriptionManagerCompat(): SubscriptionManager {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { return if (isMarshmallowPlus()) {
getSystemService(SubscriptionManager::class.java) getSystemService(SubscriptionManager::class.java)
} else { } else {
@Suppress("DEPRECATION") @Suppress("DEPRECATION")