Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support setting ContactsContract.DataColumns.IS_READ_ONLY when inserting any NewDataEntity (e.g. name, email, phone, etc) #306

Closed
8 tasks done
vestrel00 opened this issue Sep 1, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@vestrel00
Copy link
Owner

vestrel00 commented Sep 1, 2023

Problem

As discussed in #301, there is currently no way to specify the value of ContactsContract.DataColumns.IS_READ_ONLY when inserting data rows using the insert APIs provided in this library.

Solution

Add isReadOnly property to NewDataEntity interface and incorporate it when inserting new data rows.

Note that including the IS_READ_ONLY column in the projection array of queries result in an exception being thrown. This means that we are unable to read the value of it and in turn we are unable to add the isReadOnly property to the more generalized DataEntity. However, it is possible to refer to the column in selection/WHERE clause of queries. We can at least provide an extension function to check its value; #307

  • Create public Fields.DataIsReadOnly, which should be added to Fields.All list but should NOT be included in the final projection array passed to any query APIs!
  • Check that Fields.DataIsReadOnly can be used in WHERE clauses of query and delete APIs
  • Add extension function to NewRawContact that sets the read-only property of all data in it.
  • Update relevant in-code documentation.
  • Document the side-effects of setting this to true and that it should not really be used in general application use cases.
  • Update relevant docs (about-api-entities.md)
  • Update gh-page branch
  • Close NewCustomDataEntity implementations now require additional property isReadOnly #311
@vestrel00 vestrel00 added the enhancement New feature or request label Sep 1, 2023
@vestrel00 vestrel00 self-assigned this Sep 1, 2023
@vestrel00 vestrel00 changed the title Support setting ContactsContract.DataColumns.IS_READ_ONLY when inserting any NewDataEntity (e.g. name, email, phone, etc). Support setting ContactsContract.DataColumns.IS_READ_ONLY when inserting any NewDataEntity (e.g. name, email, phone, etc) Sep 1, 2023
vestrel00 added a commit that referenced this issue Sep 1, 2023
… ReadOnly of GroupsFields to GroupIsReadOnly (related to #305 and #306)
vestrel00 added a commit that referenced this issue Sep 3, 2023
@vestrel00
Copy link
Owner Author

🔥 🔥 🔥 🔥 🔥 🔥 🔥 🔥
This is now release in 0.3.1!
🔥 🔥 🔥 🔥 🔥 🔥 🔥 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant