aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Shrauner <shrauner@google.com>2013-07-02 17:01:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-07-02 17:01:58 +0000
commit321d81dcc008d4d7b3ad02272960a9972a141c90 (patch)
tree870291a4aa173d510f76df635edf48f0cbd32f4f
parent75a0a0b0ece29241b4712126af53841d5dcdb442 (diff)
parentb646ef018cff47aa5583b92b39bdb121b4bf45e5 (diff)
downloadContactsProvider-jb-mr1.1-dev-plus-aosp.tar.gz
Merge "Change method to determine if the table is empty"jb-mr1.1-dev-plus-aosp
-rw-r--r--src/com/android/providers/contacts/ContactsProvider2.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index c9c7f2ff..2855305f 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -1685,13 +1685,12 @@ public class ContactsProvider2 extends AbstractContactsProvider
// No accounts/no contacts status is true if there are no account and
// there are no contacts or one profile contact
if (mContactsAccountCount == 0) {
- long contactsNum = DatabaseUtils.queryNumEntries(mContactsHelper.getReadableDatabase(),
- Tables.CONTACTS, null);
+ boolean isContactsEmpty = DatabaseUtils.queryIsEmpty(mContactsHelper.getReadableDatabase(), Tables.CONTACTS);
long profileNum = DatabaseUtils.queryNumEntries(mProfileHelper.getReadableDatabase(),
Tables.CONTACTS, null);
// TODO: Different status if there is a profile but no contacts?
- if (contactsNum == 0 && profileNum <= 1) {
+ if (isContactsEmpty && profileNum <= 1) {
setProviderStatus(ProviderStatus.STATUS_NO_ACCOUNTS_NO_CONTACTS);
} else {
setProviderStatus(ProviderStatus.STATUS_NORMAL);