forked from github/cordova-android
CB-2208 Fix crash on File mobile-spec tests
Crash seems to not happen on every platform, but was showin up on the x86 4.0.3 emulator.
This commit is contained in:
parent
29230d0316
commit
0311f0db38
@ -239,9 +239,15 @@ public class FileUtils extends CordovaPlugin {
|
|||||||
*/
|
*/
|
||||||
private void notifyDelete(String filePath) {
|
private void notifyDelete(String filePath) {
|
||||||
String newFilePath = stripFileProtocol(filePath);
|
String newFilePath = stripFileProtocol(filePath);
|
||||||
this.cordova.getActivity().getContentResolver().delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
try {
|
||||||
MediaStore.Images.Media.DATA + " = ?",
|
this.cordova.getActivity().getContentResolver().delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
||||||
new String[] { newFilePath });
|
MediaStore.Images.Media.DATA + " = ?",
|
||||||
|
new String[] { newFilePath });
|
||||||
|
} catch (UnsupportedOperationException t) {
|
||||||
|
// Was seeing this on the File mobile-spec tests on 4.0.3 x86 emulator.
|
||||||
|
// The ContentResolver applies only when the file was registered in the
|
||||||
|
// first case, which is generally only the case with images.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user