Check granted URI permisions

This commit is contained in:
M66B
2023-01-18 09:01:00 +01:00
parent 241778348a
commit c7a8855cd7
5 changed files with 28 additions and 0 deletions

View File

@@ -817,6 +817,9 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
if ("content".equals(uri.getScheme())) {
try {
getContext().getContentResolver().takePersistableUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
if (!Helper.isPersisted(getContext(), uri, true, false))
Log.unexpectedError(getParentFragmentManager(),
new IllegalStateException("No permission granted to access selected sound " + uri));
} catch (Throwable ex) {
Log.w(ex);
}