CB-12010 (android) Catch FileUriExposedException

This commit is contained in:
Alexander Sorokin 2016-10-13 13:29:23 +03:00
parent 32253b96a6
commit ab696f6ebd

View File

@ -383,7 +383,8 @@ public class InAppBrowser extends CordovaPlugin {
intent.putExtra(Browser.EXTRA_APPLICATION_ID, cordova.getActivity().getPackageName());
this.cordova.getActivity().startActivity(intent);
return "";
} catch (android.content.ActivityNotFoundException e) {
// not catching FileUriExposedException explicitly because buildtools<24 doesn't know about it
} catch (java.lang.RuntimeException e) {
LOG.d(LOG_TAG, "InAppBrowser: Error loading url "+url+":"+ e.toString());
return e.toString();
}
@ -524,7 +525,7 @@ public class InAppBrowser extends CordovaPlugin {
hadwareBackButton = hardwareBack.booleanValue();
} else {
hadwareBackButton = DEFAULT_HARDWARE_BACK;
}
}
Boolean mediaPlayback = features.get(MEDIA_PLAYBACK_REQUIRES_USER_ACTION);
if (mediaPlayback != null) {
mediaPlaybackRequiresUserGesture = mediaPlayback.booleanValue();