Query APIs do not return local contacts in Samsung devices when passing null to accounts
functions
#257
Closed
6 tasks done
accounts
functions
#257
Problem
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 Samsung devices running OneUI.The following will NOT return any contacts;
query.accounts(null).find()
This issue occurs because "Phone contacts" (local contacts and groups) in Samsung devices are assigned to the following accoun";
vnd.sec.contact.phone
(the account name and type are the same). 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 AndroidAccountManager
. 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 Samsung devices instead of just null when null is passed.Apply this solution to all query APIs with an
accounts
function;Query
BroadQuery
ProfileQuery
AccountsRawContactsQuery
DataQuery
GroupsQuery
(related to Remove Account restrictions for Group, GroupMembership, Relation, and Event #167)Other considerations
Given that Samsung is automatically assigning local RawContacts to the
vnd.sec.contact.phone
"account", there is no need to refactor insert and update APIs.The text was updated successfully, but these errors were encountered: