diff options
| author | Toha <tohenk@yahoo.com> | 2018-02-13 12:58:31 +0700 |
|---|---|---|
| committer | Semavi Ulusoy <doc.divxm@gmail.com> | 2022-02-06 11:02:19 +0300 |
| commit | 326bc45b14a727e0ade13006a36c7df9c57a2542 (patch) | |
| tree | 975736e6ff2c03c97023d019459f9c1e6315a3d2 /src/com/android/contacts/model/DeviceLocalAccountLocator.java | |
| parent | 59afd52c77b0e2d5bc5b1ae9cd60e8da1cc1ef7b (diff) | |
Contacts: Enable support for device contact.s12.0
Change-Id: I8f2e907deadced5316be5a418dab2538476a4033
Signed-off-by: Toha <tohenk@yahoo.com>
Contacts: Ignore device null account.
As of commit 2cb5e0752a8def94c386a02213c54bb1be4b6344 which adds device contact,
the behavior is correct if there is a google account already setup, otherwise
there are two device contacts shown. So, always ignore null account.
Change-Id: I9f18a45efcaa93b8583013beb5995bf85ae58dcd
Signed-off-by: Toha <tohenk@yahoo.com>
Diffstat (limited to 'src/com/android/contacts/model/DeviceLocalAccountLocator.java')
| -rw-r--r-- | src/com/android/contacts/model/DeviceLocalAccountLocator.java | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/com/android/contacts/model/DeviceLocalAccountLocator.java b/src/com/android/contacts/model/DeviceLocalAccountLocator.java index e8a2ba0ff..89f1ce2db 100644 --- a/src/com/android/contacts/model/DeviceLocalAccountLocator.java +++ b/src/com/android/contacts/model/DeviceLocalAccountLocator.java @@ -21,7 +21,6 @@ import android.content.Context; import android.provider.ContactsContract; import com.android.contacts.model.account.AccountWithDataSet; -import com.android.contacts.model.account.GoogleAccountType; import java.util.Collections; import java.util.List; @@ -32,12 +31,10 @@ import java.util.List; public final class DeviceLocalAccountLocator { private final Context mContext; - private final AccountManager mAccountManager; private final List<AccountWithDataSet> mLocalAccount; - public DeviceLocalAccountLocator(Context context, AccountManager accountManager) { + public DeviceLocalAccountLocator(Context context) { mContext = context; - mAccountManager = accountManager; mLocalAccount = Collections.singletonList(AccountWithDataSet.getLocalAccount(context)); } @@ -45,10 +42,7 @@ public final class DeviceLocalAccountLocator { * Returns a list of device local accounts */ public List<AccountWithDataSet> getDeviceLocalAccounts() { - @SuppressWarnings("MissingPermission") final Account[] accounts = mAccountManager - .getAccountsByType(GoogleAccountType.ACCOUNT_TYPE); - - if (accounts.length > 0 && !mLocalAccount.get(0).hasData(mContext)) { + if (!mLocalAccount.get(0).hasData(mContext)) { return Collections.emptyList(); } else { return mLocalAccount; |
