Android 10+ only allows SAF -> Respect that in the dialog
This commit is contained in:
parent
b9ee14ac30
commit
e806f8c4e6
2 changed files with 14 additions and 4 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue