aboutsummaryrefslogtreecommitdiff
path: root/taler-kotlin-android/src
diff options
context:
space:
mode:
Diffstat (limited to 'taler-kotlin-android/src')
-rw-r--r--taler-kotlin-android/src/main/java/net/taler/common/AndroidUtils.kt3
1 files changed, 3 insertions, 0 deletions
diff --git a/taler-kotlin-android/src/main/java/net/taler/common/AndroidUtils.kt b/taler-kotlin-android/src/main/java/net/taler/common/AndroidUtils.kt
index 5b57320..7dde872 100644
--- a/taler-kotlin-android/src/main/java/net/taler/common/AndroidUtils.kt
+++ b/taler-kotlin-android/src/main/java/net/taler/common/AndroidUtils.kt
@@ -16,6 +16,7 @@
package net.taler.common
+import android.Manifest.permission.ACCESS_NETWORK_STATE
import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Context.CONNECTIVITY_SERVICE
@@ -40,6 +41,7 @@ import android.view.View
import android.view.View.INVISIBLE
import android.view.View.VISIBLE
import android.view.inputmethod.InputMethodManager
+import androidx.annotation.RequiresPermission
import androidx.annotation.StringRes
import androidx.core.content.ContextCompat.getSystemService
import androidx.fragment.app.Fragment
@@ -82,6 +84,7 @@ fun assertUiThread() {
val <T> T.exhaustive: T
get() = this
+@RequiresPermission(ACCESS_NETWORK_STATE)
fun Context.isOnline(): Boolean {
val cm = getSystemService(CONNECTIVITY_SERVICE) as ConnectivityManager
return if (SDK_INT < 29) {