Skip to content

Commit

Permalink
Android 10+ only allows SAF -> Respect that in the dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
litetex committed Dec 8, 2021
1 parent b9ee14a commit e806f8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.os.Build;
import android.util.Log;

import androidx.activity.result.ActivityResultLauncher;
Expand All @@ -27,12 +28,20 @@ private static void showActivityNotFoundAlert(final Context context) {
"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();
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit e806f8c

Please sign in to comment.