diff options
author | Brad Ebinger <breadley@google.com> | 2016-08-17 04:52:02 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-08-17 04:52:02 +0000 |
commit | 04ddd5c036eab3e5375b5d54ba8ba360d34bf3c9 (patch) | |
tree | 14c991c729c901ac3c32983ecad5343dbf0c39ad | |
parent | 3fd6d7701d063ea59541b6efe1a6777639ef214e (diff) | |
parent | 7c314b85f4de1bf563fc3ed04386d409f3ebe0d6 (diff) | |
download | ims-04ddd5c036eab3e5375b5d54ba8ba360d34bf3c9.tar.gz |
RCS NPE when uppgrading to N am: 0ba8619e7c am: 3feb36f386
am: 7c314b85f4
Change-Id: Idb0c6bc59dd1def4920abe3e7077208fb5440db2
-rw-r--r-- | rcs/presencepolling/AndroidManifest.xml | 3 | ||||
-rw-r--r-- | rcs/presencepolling/src/com/android/service/ims/presence/EABDbUtil.java | 15 |
2 files changed, 14 insertions, 4 deletions
diff --git a/rcs/presencepolling/AndroidManifest.xml b/rcs/presencepolling/AndroidManifest.xml index 8780c11..8d69796 100644 --- a/rcs/presencepolling/AndroidManifest.xml +++ b/rcs/presencepolling/AndroidManifest.xml @@ -35,6 +35,9 @@ <uses-sdk android:minSdkVersion="19"/> + <permission android:name="com.android.rcs.eab.permission.READ_WRITE_EAB" + android:protectionLevel="signatureOrSystem" /> + <protected-broadcast android:name="android.provider.rcs.eab.EAB_NEW_CONTACT_INSERTED" /> <protected-broadcast android:name="com.android.service.ims.presence.capability_polling_retry" /> <protected-broadcast android:name="com.android.service.ims.presence.periodical_capability_discovery" /> diff --git a/rcs/presencepolling/src/com/android/service/ims/presence/EABDbUtil.java b/rcs/presencepolling/src/com/android/service/ims/presence/EABDbUtil.java index 44ab61e..64d7343 100644 --- a/rcs/presencepolling/src/com/android/service/ims/presence/EABDbUtil.java +++ b/rcs/presencepolling/src/com/android/service/ims/presence/EABDbUtil.java @@ -72,8 +72,13 @@ public class EABDbUtil { null, sortOrder); ArrayList<PresenceContact> allEligibleContacts = new ArrayList<PresenceContact>(); - logger.debug("cursor count : " + cursor.getCount()); - if (cursor.moveToFirst()) { + if (cursor != null) { + logger.debug("cursor count : " + cursor.getCount()); + } else { + logger.debug("cursor = null"); + } + + if (cursor != null && cursor.moveToFirst()) { do { String id = cursor.getString(cursor.getColumnIndex(Contacts._ID)); Long time = cursor.getLong(cursor.getColumnIndex( @@ -94,7 +99,7 @@ public class EABDbUtil { + " = ?", new String[] { id }, null); ArrayList<String> phoneNumList = new ArrayList<String>(); - if (pCur.moveToFirst()) { + if (pCur != null && pCur.moveToFirst()) { do { String contactNumber = pCur.getString(pCur.getColumnIndex( ContactsContract.CommonDataKinds.Phone.NUMBER)); @@ -121,7 +126,9 @@ public class EABDbUtil { } } while (pCur.moveToNext()); } - pCur.close(); + if (pCur != null) { + pCur.close(); + } } while (cursor.moveToNext()); } if (null != cursor) { |