aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2021-09-25 18:19:21 -0700
committerAllan Wang <me@allanwang.ca>2021-09-25 18:19:21 -0700
commite2ac8e3e82b842ea05c8c7a2c92d566553d8ea91 (patch)
treef04c5fb57d6d4f51827df8a530fd206383550257
parent302011d140a79953a01eac2e27df3a788510787e (diff)
downloadkau-e2ac8e3e82b842ea05c8c7a2c92d566553d8ea91.tar.gz
kau-e2ac8e3e82b842ea05c8c7a2c92d566553d8ea91.tar.bz2
kau-e2ac8e3e82b842ea05c8c7a2c92d566553d8ea91.zip
Add checkSdkIntAtLeast annotation; fixes #267
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/utils/PackageUtils.kt8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/PackageUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/PackageUtils.kt
index 0bd534e..d8524fa 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/utils/PackageUtils.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/utils/PackageUtils.kt
@@ -22,6 +22,7 @@ import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.provider.Settings
+import androidx.annotation.ChecksSdkIntAtLeast
/**
* Created by Allan Wang on 2017-06-23.
@@ -67,14 +68,21 @@ fun Context.showAppInfo(packageName: String) {
}
inline val buildIsMarshmallowAndUp: Boolean
+ @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.M)
get() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
inline val buildIsLollipopAndUp: Boolean
+ @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.LOLLIPOP)
get() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
inline val buildIsNougatAndUp: Boolean
+ @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.N)
get() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
+inline val buildIsOreoAndUp: Boolean
+ @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.O)
+ get() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
+
const val INSTALLER_GOOGLE_PLAY_VENDING = "com.android.vending"
const val INSTALLER_GOOGLE_PLAY_FEEDBACK = "com.google.android.feedback"