1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00

Android 10+ only allows SAF -> Respect that in the dialog

This commit is contained in:
litetex 2021-12-08 20:22:26 +01:00
parent b9ee14ac30
commit e806f8c4e6
2 changed files with 14 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package org.schabi.newpipe.streams.io;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.os.Build;
import android.util.Log;
import androidx.activity.result.ActivityResultLauncher;
@ -27,12 +28,20 @@ public final class NoFileManagerSafeGuard {
"Unable to open no file manager alert dialog: Context is null");
}
final String message;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
// Android 10+ only allows SAF
message = context.getString(R.string.no_appropriate_file_manager_message_android_10);
} else {
message = context.getString(
R.string.no_appropriate_file_manager_message,
context.getString(R.string.downloads_storage_use_saf_title));
}
new AlertDialog.Builder(context)
.setTitle(R.string.no_app_to_open_intent)
.setMessage(
context.getString(
R.string.no_appropriate_file_manager_message,
context.getString(R.string.downloads_storage_use_saf_title)))
.setMessage(message)
.setPositiveButton(R.string.ok, null)
.show();
}

View File

@ -672,6 +672,7 @@
<string name="chapters">Chapters</string>
<string name="no_app_to_open_intent">No app on your device can open this</string>
<string name="no_appropriate_file_manager_message">No appropriate file manager was found for this action.\nPlease install a file manager or try to disable \'%s\' in the download settings.</string>
<string name="no_appropriate_file_manager_message_android_10">No appropriate file manager was found for this action.\nPlease install a Storage Access Framework compatible file manager.</string>
<string name="georestricted_content">This content is not available in your country.</string>
<string name="soundcloud_go_plus_content">This is a SoundCloud Go+ track, at least in your country, so it cannot be streamed or downloaded by NewPipe.</string>
<string name="private_content">This content is private, so it cannot be streamed or downloaded by NewPipe.</string>