You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #257, using query APIs' accounts function to match local (Raw)Contacts (and groups), those that have a null Account and are not synced outside of the device, does not work for Xiaomi devices running MiUI.
The following will NOT return any contacts;
query.accounts(null).find()
This issue occurs because "Phone contacts" (local contacts and groups) in Xiaomi devices are assigned to the following "account"; name "default", type "com.android.contacts.default". RawContacts that are inserted with a null account will, immediately or at a later time, be automatically associated to this local account. This account is not returned by the Android AccountManager. Either because 3rd party apps do not have access to it or it is not an actual real account.
Solution
Update the accounts function of all query APIs to also match the local account name and type of Xiaomi devices instead of just null when null is passed.
Apply this solution to all query APIs with an accounts function;
Query
BroadQuery
ProfileQuery
RawContactsQuery
DataQuery
GroupsQuery
Other considerations
Given that Xiaomi is automatically assigning local RawContacts to account name "default", type "com.android.contacts.default", there is no need to refactor insert and update APIs.
The text was updated successfully, but these errors were encountered:
Problem
Similar to #257, using query APIs'
accounts
function to match local (Raw)Contacts (and groups), those that have a null Account and are not synced outside of the device, does not work for Xiaomi devices running MiUI.The following will NOT return any contacts;
query.accounts(null).find()
This issue occurs because "Phone contacts" (local contacts and groups) in Xiaomi devices are assigned to the following "account"; name "default", type "com.android.contacts.default". RawContacts that are inserted with a null account will, immediately or at a later time, be automatically associated to this local account. This account is not returned by the Android
AccountManager
. Either because 3rd party apps do not have access to it or it is not an actual real account.Solution
Update the
accounts
function of all query APIs to also match the local account name and type of Xiaomi devices instead of just null when null is passed.Apply this solution to all query APIs with an
accounts
function;Query
BroadQuery
ProfileQuery
RawContactsQuery
DataQuery
GroupsQuery
Other considerations
Given that Xiaomi is automatically assigning local RawContacts to account name "default", type "com.android.contacts.default", there is no need to refactor insert and update APIs.
The text was updated successfully, but these errors were encountered: