mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-07-03 21:21:12 +08:00
Catch possible exception in getDownloadsUri
This commit is contained in:
parent
4bd4223333
commit
3618f1e211
@ -803,9 +803,16 @@ public class Utils {
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
|
||||
Uri newUri = context.getContentResolver().insert(externalUri, values);
|
||||
Log.d(TAG, "getDownloadsUri: new file " + newUri);
|
||||
return newUri;
|
||||
try {
|
||||
Uri newUri = context.getContentResolver().insert(externalUri, values);
|
||||
Log.d(TAG, "getDownloadsUri: new file " + newUri);
|
||||
return newUri;
|
||||
} catch (Exception e) {
|
||||
// On some devices, it may trigger "IllegalArgumentException: Volume external_primary not found"
|
||||
Log.e(TAG, "getDownloadsUri failed:" + e.getMessage());
|
||||
Utils.showToastLong(context, R.string.write_ext_storage_failed);
|
||||
return(null);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isRootAvailable() {
|
||||
|
||||
@ -453,4 +453,5 @@
|
||||
<string name="pcapng_format_summary">Dump packets in the pcapng dump format, which allows embedding TLS decryption secrets</string>
|
||||
<string name="sort_by">Sort by</string>
|
||||
<string name="total_bytes">Total bytes</string>
|
||||
<string name="write_ext_storage_failed">Write to external storage failed. Check the app log for details</string>
|
||||
</resources>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user