Commit 3c97e1c0 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Catch Exception when releasing storage URIs

parent 50dc239d
......@@ -474,7 +474,13 @@ public class SftpSettingsFragment
SftpPlugin.StorageInfo info = storageInfoList.remove(i);
if (Build.VERSION.SDK_INT >= 21) {
requireContext().getContentResolver().releasePersistableUriPermission(info.uri, Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
try {
// This throws when trying to release a URI we don't have access to
requireContext().getContentResolver().releasePersistableUriPermission(info.uri, Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
} catch (SecurityException e) {
// Usually safe to ignore, but who knows?
Log.e("SFTP Settings", "Exception", e);
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment