diff --git a/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt
index 2849725e..8ced7425 100644
--- a/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt
+++ b/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt
@@ -209,12 +209,9 @@ class ConfigActivity : AppCompatActivity() {
if (certificateFile.isChecked != oldCertificateFile) {
if (certificateFile.isChecked) {
- if (!Utils.checkPermission(applicationContext,
- android.Manifest.permission.READ_EXTERNAL_STORAGE)) {
- Utils.alertView(this, getString(R.string.error),
- getString(R.string.no_storage_space_permission))
+ if (!Utils.requestPermission(this,
+ android.Manifest.permission.READ_EXTERNAL_STORAGE))
return false
- }
val content = Utils.getFileContents(File(downloadsDir, "cert.pem"))
if (content == "Failed") {
Utils.alertView(this, getString(R.string.error),
@@ -234,12 +231,9 @@ class ConfigActivity : AppCompatActivity() {
if (caFile.isChecked != oldCAFile) {
if (caFile.isChecked) {
- if (!Utils.checkPermission(applicationContext,
- android.Manifest.permission.READ_EXTERNAL_STORAGE)) {
- Utils.alertView(this, getString(R.string.error),
- getString(R.string.no_storage_space_permission))
+ if (!Utils.requestPermission(this,
+ android.Manifest.permission.READ_EXTERNAL_STORAGE))
return false
- }
val content = Utils.getFileContents(File(downloadsDir, "ca_certs.crt"))
if (content == "Failed") {
Utils.alertView(this, getString(R.string.error),
diff --git a/app/src/main/kotlin/com/tutpro/baresip/Utils.kt b/app/src/main/kotlin/com/tutpro/baresip/Utils.kt
index 9ee11661..27b4dc2d 100644
--- a/app/src/main/kotlin/com/tutpro/baresip/Utils.kt
+++ b/app/src/main/kotlin/com/tutpro/baresip/Utils.kt
@@ -320,10 +320,6 @@ object Utils {
}
}
- fun checkPermission(ctx: Context, permission: String) : Boolean {
- return ContextCompat.checkSelfPermission(ctx, permission) == PackageManager.PERMISSION_GRANTED
- }
-
fun requestPermission(ctx: Context, permission: String) : Boolean {
if (ContextCompat.checkSelfPermission(ctx, permission) != PackageManager.PERMISSION_GRANTED) {
Log.w("Baresip", "Baresip does not have $permission permission")
diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml
index fed8c209..830b797b 100644
--- a/app/src/main/res/values-fi/strings.xml
+++ b/app/src/main/res/values-fi/strings.xml
@@ -315,8 +315,7 @@
Tämä pulelu on turvallinen ja kohde on
todennettu! Haluatko poistaa todennuksen?
Poista todennus
- Et ole antanut käyttölupaa tallennustilaan. Tarkista Sovellukset → baresip → Käyttöluvat → Tallennustila.
- TLS CA-tiedosto
+qqqq TLS CA-tiedosto
Jos merkitty, tiedosto \'ca_certs.crt\', joka sisältää todennusauktoriteettien TLS-sertifikaatit, on ladattu tai ladataan Download-kansiosta.
TLS sertifikaattitiedosto
"Jos merkitty, tiedosto \'cert.pem\', joka sisältää tämän baresip-sovelluksen TLS-sertifikaatin ja yksityisen avaimen, on ladattu tai ladataan Download-kansiosta."
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index cb19d93a..1e313c53 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -144,10 +144,6 @@ Check Apps → baresip → Permissions → Storage and that file \'accounts.bs\'
add peer to contacts?
Do you want to delete chat with \'%1$s\'?
-
- You have not granted storage space permission.
- Check Apps → baresip → Permissions → Storage.
-
Configuration
Start Automatically
@@ -212,12 +208,10 @@ Check Apps → baresip → Permissions → Storage and that file \'accounts.bs\'
Your maximum number of contacts %1%d has been exceeded.
Exported contacts to Download folder file \'contacts.bs\'.
"Failed to export contacts to Download folder.
-Check Apps → baresip → Permissions → Storage."
-
+ Check Apps → baresip → Permissions → Storage."
Imported contacts from Download folder.
- Failed to import contacts from Download folder.
-Check Apps → baresip → Permissions → Storage and that file \'contacts.bs\' exists in the folder.
-
+ Failed to import contacts from Download folder. Check Apps →
+ baresip → Permissions → Storage and that file \'contacts.bs\' exists in the folder.
Alert