Use the existing extension for api version check
This commit is contained in:
parent
b85dbf3b4b
commit
f4575401f5
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue