联系人组 GROUP_VISIBLE 和 GROUP_IS_READ_ONLY 被忽略了吗?

Contacts group GROUP_VISIBLE and GROUP_IS_READ_ONLY ignored?

有人能解释一下为什么在创建我的组时会忽略此参数 GROUP_IS_READ_ONLY(设置为 0)和 GROUP_VISIBLE(设置为 false)吗?

我仍然可以在里面看到群组和联系人,我也可以delete/modify在里面看到我的群组和联系人。

编辑

这是我创建群组的方式:

ArrayList<ContentProviderOperation> ops = new ArrayList<>();

ops.add(ContentProviderOperation.newInsert(Groups.CONTENT_URI)
                    .withValue(Groups.TITLE, groupName)
                    .withValue(Groups.ACCOUNT_NAME, accountName)
                    .withValue(Groups.ACCOUNT_TYPE, AccountGeneral.ACCOUNT_TYPE)
                    .withValue(Groups.GROUP_VISIBLE, false)
                    .withValue(Groups.GROUP_IS_READ_ONLY, 1)
                    .build());

mContentResolver.applyBatch(ContactsContract.AUTHORITY, ops);

这就是官方开发者 android 页面所说的:

GROUP_VISIBLE - Flag indicating if the contacts belonging to this group should be visible in any user interface.

GROUP_IS_READ_ONLY - The "read-only" flag: "0" by default, "1" if the row cannot be modified or deleted except by a sync adapter. See ContactsContract.CALLER_IS_SYNCADAPTER.

谢谢!

所以,从评论部分继续,答案是您的输入值没问题,并按要求保留。

但是,联系人应用程序(或任何其他读取联系人的应用程序)可以忽略 GROUP_VISIBLE 处的值并显示 phone 处的所有联系人。 通常应用程序会为用户提供一些过滤功能,因此用户可以选择只查看可见群组中的联系人、phone 上的所有联系人,还是特定群组。

如果您使用 IN_VISIBLE_GROUP 选择查询联系人,那么您不应在光标响应中获取在您的群组下创建的联系人。