summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorNicolas Fella <nicolas.fella@kdab.com>2019-06-17 21:59:13 +0200
committerNicolas Fella <nicolas.fella@kdab.com>2019-07-05 21:46:06 +0200
commit5ca2b081fe8089990dd87c5d9081d90ed170283a (patch)
tree3b585d4b16db5b89017bbf8f4180093ecb3ff321 /src/android
parent298f750cdba2bd15e735a47ba8d3b9c093367ba3 (diff)
[androidcontentfileengine] Catch SecurityException during file opening
resolver.openFileDescriptor throws a SecurityException when the caller doesn't have sufficient permissions to access the URL. This will make an application crash. We should handle this case gracefully and report it to the user. I'm unsure if there is a better way to do this than simply logging the exception. Change-Id: I36bfbd3e398c8176e57042a27740aa15bce63a7c Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index 9679fd40f4..c33d5016ce 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -178,6 +178,9 @@ public class QtNative
return fdDesc.detachFd();
} catch (FileNotFoundException e) {
return -1;
+ } catch (SecurityException e) {
+ Log.e(QtTAG, "Exception when opening file", e);
+ return -1;
}
}