mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-27 12:26:48 +01:00
Catch securtiy exception if contacts can't be read on Android 6.0. Closes #182
This commit is contained in:
parent
a8db606240
commit
112dfa184a
@ -1,5 +1,8 @@
|
||||
###Changelog
|
||||
|
||||
####Next Version
|
||||
* Fix crash when contacts cannot be read on Android 6.0 (non-granted pemissions)
|
||||
|
||||
####Version 0.6.7
|
||||
* Pebble: Allow installation of 3.x apps on OG Pebble (FW will be released soon)
|
||||
* Fix crashes on startup when logging is enabled or when entering the app manager on some phones
|
||||
|
@ -430,7 +430,13 @@ public class DeviceCommunicationService extends Service {
|
||||
}
|
||||
|
||||
ContentResolver contentResolver = getContentResolver();
|
||||
Cursor contactLookup = contentResolver.query(uri, null, null, null, null);
|
||||
|
||||
Cursor contactLookup = null;
|
||||
try {
|
||||
contentResolver.query(uri, null, null, null, null);
|
||||
} catch (SecurityException e) {
|
||||
return name;
|
||||
}
|
||||
|
||||
try {
|
||||
if (contactLookup != null && contactLookup.getCount() > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user