From 32d7e509e1274526498961c04775fb419ecb129e Mon Sep 17 00:00:00 2001 From: anthony restaino Date: Mon, 5 Jun 2017 20:08:53 -0400 Subject: [PATCH] Catch fileuriexposedexception for now --- .../main/java/acr/browser/lightning/utils/IntentUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/acr/browser/lightning/utils/IntentUtils.java b/app/src/main/java/acr/browser/lightning/utils/IntentUtils.java index 17eba2b..7f953f4 100644 --- a/app/src/main/java/acr/browser/lightning/utils/IntentUtils.java +++ b/app/src/main/java/acr/browser/lightning/utils/IntentUtils.java @@ -8,6 +8,7 @@ import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.net.Uri; import android.os.Build; +import android.os.FileUriExposedException; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.Log; @@ -75,8 +76,9 @@ public class IntentUtils { if (mActivity.startActivityIfNeeded(intent, -1)) { return true; } - } catch (ActivityNotFoundException ex) { - ex.printStackTrace(); + } catch (Exception exception) { + exception.printStackTrace(); + // TODO: 6/5/17 fix case where this could throw a FileUriExposedException due to file:// urls } return false; }