From bdc53defb77ce63d906b9566e56e46e6acbab9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hock?= Date: Fri, 7 Jun 2024 16:10:36 +0200 Subject: [PATCH] Delete ApplicationPermissions.kt --- .../voicesmith/etc/ApplicationPermissions.kt | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 voicesmith/src/main/java/de/jurihock/voicesmith/etc/ApplicationPermissions.kt diff --git a/voicesmith/src/main/java/de/jurihock/voicesmith/etc/ApplicationPermissions.kt b/voicesmith/src/main/java/de/jurihock/voicesmith/etc/ApplicationPermissions.kt deleted file mode 100644 index 4223f07..0000000 --- a/voicesmith/src/main/java/de/jurihock/voicesmith/etc/ApplicationPermissions.kt +++ /dev/null @@ -1,28 +0,0 @@ -package de.jurihock.voicesmith.etc - -import android.app.Activity -import android.content.pm.PackageManager -import androidx.core.app.ActivityCompat -import androidx.core.content.ContextCompat - -class ApplicationPermissions(val activity: Activity) { - - fun granted(grantResults: IntArray) : Boolean { - return grantResults.isNotEmpty() and grantResults.all { - grantResult -> grantResult == PackageManager.PERMISSION_GRANTED - } - } - - fun granted(permission: String) : Boolean { - return ContextCompat.checkSelfPermission(activity, permission) == PackageManager.PERMISSION_GRANTED - } - - fun rationale(permission: String) : Boolean { - return ActivityCompat.shouldShowRequestPermissionRationale(activity, permission) - } - - fun request(permission: String, requestCode: Int) { - ActivityCompat.requestPermissions(activity, arrayOf(permission), requestCode) - } - -}