1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-14 22:19:29 +01:00

Catch permission errors in K-9 Mail receiver. Closes #175.

This commit is contained in:
Andreas Shimokawa 2015-11-27 22:42:47 +01:00
parent bd0716ba58
commit c768107db8

View File

@ -54,7 +54,17 @@ public class K9Receiver extends BroadcastReceiver {
* So, we will just search our message and match the uri manually.
* It should be the first one returned by the query in most cases,
*/
Cursor c = context.getContentResolver().query(k9Uri, messagesProjection, null, null, null);
Cursor c = null;
try {
c = context.getContentResolver().query(k9Uri, messagesProjection, null, null, null);
} catch (Exception e) {
e.printStackTrace();
notificationSpec.sender = "Permission Error?";
notificationSpec.sender = "Gadgetbridge";
notificationSpec.body = "Please reinstall Gadgerbridge to enable K-9 Mail notifications";
}
try {
if (c != null) {
c.moveToFirst();