From a5ca64b3365951e8ac0f98160a41f2de9b426d1a Mon Sep 17 00:00:00 2001 From: Jakob Nixdorf Date: Thu, 28 May 2020 20:37:41 +0200 Subject: [PATCH] Minor cleanup and improvement --- .../flocke/andotp/Activities/SettingsActivity.java | 7 +++++++ app/src/main/res/values/strings_backup.xml | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/shadowice/flocke/andotp/Activities/SettingsActivity.java b/app/src/main/java/org/shadowice/flocke/andotp/Activities/SettingsActivity.java index b3201f70..7693f6be 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/Activities/SettingsActivity.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/Activities/SettingsActivity.java @@ -28,6 +28,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.EditTextPreference; @@ -37,6 +38,8 @@ import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import androidx.appcompat.widget.Toolbar; + +import android.provider.DocumentsContract; import android.view.ViewStub; import android.widget.Toast; @@ -240,6 +243,10 @@ public class SettingsActivity extends BaseActivity | Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION); + + if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && settings.isBackupLocationSet()) + intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, settings.getBackupLocation()); + startActivityForResult(intent, Constants.INTENT_SETTINGS_BACKUP_LOCATION); } diff --git a/app/src/main/res/values/strings_backup.xml b/app/src/main/res/values/strings_backup.xml index 82119c89..dada8222 100644 --- a/app/src/main/res/values/strings_backup.xml +++ b/app/src/main/res/values/strings_backup.xml @@ -84,7 +84,6 @@ Failed to access backup location! Failed to create backup file! - Failed to create backup directory Export to external storage successful Export to external storage failed% Import from external storage successful @@ -92,7 +91,6 @@ Decryption of the backup failed No entries found in imported data External storage currently not accessible - Storage permissions not granted OpenPGP Error: %s No verified signature detected Password not set, check the Settings