summaryrefslogtreecommitdiff
path: root/Source/Android
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2021-05-08 16:10:39 +0200
committerJosJuice <josjuice@gmail.com>2021-09-16 20:12:20 +0200
commit3adb07ac74aa8d5d2ee46dc71990c464b16e1bdc (patch)
treeed1aaa66fd306bdaded3e0d0710a4ec51b5c2212 /Source/Android
parent820420c5f5afb6c7317320fc9bda4ba6cd68b5a6 (diff)
Android: Show a dialog for scoped storage incompatible settings
The following settings are currently not SAF compatible, and might never be due to the performance impact: Dump Path Load Path Resource Pack Path Wii NAND Root This commit makes us show a message to the user if they try to change one of these settings while scoped storage is active. I don't want to entirely remove the settings from being listed in the settings activity, because it's important that the user is able to reset them if they were set to something custom in a previous version of Dolphin.
Diffstat (limited to 'Source/Android')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java13
-rw-r--r--Source/Android/app/src/main/res/values/strings.xml1
2 files changed, 13 insertions, 1 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java
index 753dddf522..a26be57754 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java
@@ -44,6 +44,7 @@ import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.SubmenuViewHold
import org.dolphinemu.dolphinemu.utils.DirectoryInitialization;
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
import org.dolphinemu.dolphinemu.utils.Log;
+import org.dolphinemu.dolphinemu.utils.PermissionsHandler;
import java.io.File;
import java.io.IOException;
@@ -300,7 +301,17 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
mClickedItem = item;
mClickedPosition = position;
- FileBrowserHelper.openDirectoryPicker(mView.getActivity(), FileBrowserHelper.GAME_EXTENSIONS);
+ if (!PermissionsHandler.isExternalStorageLegacy())
+ {
+ AlertDialog.Builder builder = new AlertDialog.Builder(mContext, R.style.DolphinDialogBase);
+ builder.setMessage(R.string.path_not_changeable_scoped_storage);
+ builder.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss());
+ builder.show();
+ }
+ else
+ {
+ FileBrowserHelper.openDirectoryPicker(mView.getActivity(), FileBrowserHelper.GAME_EXTENSIONS);
+ }
}
public void onFilePickerFileClick(SettingsItem item, int position)
diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml
index 897aa639e5..6671023dea 100644
--- a/Source/Android/app/src/main/res/values/strings.xml
+++ b/Source/Android/app/src/main/res/values/strings.xml
@@ -481,6 +481,7 @@ It can efficiently compress both junk data and encrypted Wii data.
<!-- Rumble -->
<string name="rumble_not_found">Device rumble not found</string>
+ <string name="path_not_changeable_scoped_storage">Due to the Scoped Storage policy in Android 11 and newer, you can\'t change this path.</string>
<string name="load_settings">Loading Settings...</string>
<string name="setting_not_runtime_editable">This setting can\'t be changed while a game is running.</string>
<string name="setting_clear_info">Long press a setting to clear it.</string>