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
|
###Changelog
|
||||||
|
|
||||||
|
####Next Version
|
||||||
|
* Fix crash when contacts cannot be read on Android 6.0 (non-granted pemissions)
|
||||||
|
|
||||||
####Version 0.6.7
|
####Version 0.6.7
|
||||||
* Pebble: Allow installation of 3.x apps on OG Pebble (FW will be released soon)
|
* 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
|
* 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();
|
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 {
|
try {
|
||||||
if (contactLookup != null && contactLookup.getCount() > 0) {
|
if (contactLookup != null && contactLookup.getCount() > 0) {
|
||||||
|
|
Loading…
Reference in New Issue