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

Fix synchronized contacts not appearing in some contact apps #7487

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

rezbyte
Copy link
Contributor

@rezbyte rezbyte commented Aug 30, 2024

Certain contact apps require the account to be syncable. In order to do this, we implement a stubbed sync service and adapter which does nothing and ask Android not to call it. Preexisting installations of the app will need to turn contact synchronization off and on again to receive this fix.

Closes #6568.

@rezbyte rezbyte linked an issue Aug 30, 2024 that may be closed by this pull request
13 tasks
@charlag charlag force-pushed the dev-mail branch 2 times, most recently from c763e8c to def698a Compare August 30, 2024 16:16
* It is used to mark Tuta accounts as syncable as a fix for #6568 */
class StubSyncService : Service() {
override fun onCreate() {
synchronized(syncAdapterLock) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's never overwritten again wouldn't it be enough to either make it lazy or mark it as volatile?

@@ -249,6 +252,10 @@ class AndroidMobileContactsFacade(private val activity: MainActivity) : MobileCo
activity.getPermission(Manifest.permission.WRITE_CONTACTS)
}

private suspend fun checkSyncPermission() {
activity.getPermission(Manifest.permission.WRITE_SYNC_SETTINGS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is user prompted for this or is it automatically given?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my testing, it is automatically given.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it does not hurt to check although for the same target API it shouldn't change.

@charlag
Copy link
Contributor

charlag commented Aug 30, 2024

Looks good, one mistery is solved! Maybe one day we can also do a "real" sync adapter

Certain contact apps require the account to be syncable.
In order to do this, we implement a stubbed sync service
and adapter which does nothing and ask Android not to
call it. Preexisting installations of the app will need
to turn contact synchronization off and on again to
receive this fix.
Closes #6568.

Co-authored-by: paw <[email protected]>
@charlag charlag merged commit 47f031a into dev-mail Sep 2, 2024
2 checks passed
@charlag charlag deleted the 6568-contacts-not-listed branch September 2, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contact syncing not working on Android with some contact apps
2 participants