FossifyOrg / Contacts

Easy and quick contact management with no ads, handles groups and favorites too.
https://www.fossify.org
GNU General Public License v3.0
245 stars 22 forks source link

Not showing synced contact storage after upgrading to LOS21 (Android 14) #83

Open nucular8 opened 4 months ago

nucular8 commented 4 months ago

Checklist

Affected app version

1.0.1.

Affected Android/Custom ROM version

LineageOS 21 (Android 14)

Affected device model

Moto G7 Plus (lake)

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug

Open the contacts app. Go to contacts or favorites pane. Click on filter button to choose contact storage to be shown.

Expected behavior

Filtering option in contacts app (and phone app as well) should show synced contact storage.

Actual behavior

Filtering option in contacts app (and phone app as well) only showing phone storage and phone storage (not visible by other apps).

Screenshots/Screen recordings

No response

Additional information

On LOS20 (Android 13) everything was fine. After upgrading to LOS21 (Android 14) the synced contacts are not shown in contacts app (and phone app as well). Syncing of contacts is done with davx5 (https://github.com/bitfireAT/davx5-ose).

Aga-C commented 4 months ago

It's related to https://github.com/FossifyOrg/Phone/issues/28.

nucular8 commented 4 months ago

You are right. I found this issue and posted my "me too". I guess it's the same piece of code that affects both apps.

Mrothyr commented 4 months ago

I think is the same problem:

https://github.com/stephanritscher/Simple-Contacts/issues/20

After test: Simple contacts have this issue too.

nucular8 commented 4 months ago

Quite possible as it seems to be a fork of the same code base.

Mrothyr commented 4 months ago

Yes. But it's possible to narrow down the part of the code.

I think its an API issue. Whatsapp is showed in the filter and is also updated to targetSdk 34. Nine and Outlook are not showed and be at targetSdk 33. I use Android 14 (GrapheneOS) and the old version works without problem (targetSdk 33 of the contact app).

czarnyckm commented 4 months ago

I have the same problem with CARDDAV contacts. Works fine with 'koler' or 'contacts you' as well as 'Simple Contacts Pro SE' f-droid version 6.22.4.2 Pro (the Github version is broken since January update)

jurdabur commented 4 months ago

I think I have an issue related to this too. My contacts stored in Tuta are not syncing to Fossify Contacts, but they do sync to Google Contacts.

In my filter list I have tickboxes to display contacts from the following apps:

Contacts from Tuta (Tutanota/Tuta Mail - recently rebranded) should also be shown as an option in this list but aren't.

Device: Oppo A54 5G Android OS: ColorOS 13.0 (Android 13) Version: Fossify Contacts 1.0.1 (F-Droid)

cpontvieux-systra commented 3 months ago

getIsSyncable check is wrong here: https://github.com/FossifyOrg/Commons/blob/master/commons/src/main/kotlin/org/fossify/commons/helpers/ContactsHelper.kt#L825 It should probably be just >0: https://developer.android.com/reference/android/content/ContentResolver#getIsSyncable(android.accounts.Account,%20java.lang.String)

naveensingh commented 3 months ago

I haven't investigated this but here are the definitions: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/services/core/java/com/android/server/content/SyncStorageEngine.java;l=260-289

Vysp3r commented 2 months ago

For me the problem was contact not working without Google Services Framework installed. I don't know why it would depend on that though.

schklom commented 2 months ago

I'd like to add that allowing access to groups / individual contacts using the Contact Scopes feature (on GrapheneOS, maybe not available on LineageOS) lets the app show these groups / contacts.

But the general Contacts permission does not work, and I also do not have Google Services Framework installed.

Vysp3r commented 2 months ago

@schklom You're right I just tested on GrapheneOS and that works. It's not great though, because I would have to go in there and add each contact manually each time I add some. It makes me wonder why they would show up properly with Google Services Framework installed.

schklom commented 2 months ago

@Vysp3r A hacky inconvenient workaround is to create a group "All", put every contact in it, and allow that group. You would need to remember to add that group to each new contact in the future though, so far from ideal.

Mrothyr commented 1 month ago

OK, I give it a try. Installing Google Services Framework, nothing changed. Installing Google Play Services - the other accounts materialized magically in the app.

So Google changed somewhat in the API? But Whatsapp is listed in the filters.

GPS is not a option for me. And the work around from schklom is not a option too - anything delete the tags at the contacts randomly. I have no idea what ist happen.

cpontvieux-systra commented 1 month ago

For now, I use the contact app of LineageOS as a temporary solution. But yes, Google services are not an option for me either.

I can provide debug log or other information, provided someone explain me how to get it. I’m a developper, but not a Android developper…

Mrothyr commented 1 month ago

I use an older version of Stephans fork (https://github.com/stephanritscher/Simple-Contacts/releases/tag/6.22.4.2). A contact app with structured addresses is very rare...

arkdae commented 1 month ago

I also have this problem and I have attempted to debug it. I wish I had better news, as in isolating the root cause, but Android development has become wildly complicated (at least since I last looked at it). Here's what I (think I) know so far.

I installed and run the debug with a breakpoint just before the line @cpontvieux-systra mentioned. From there I used Android Studio's "evaluation expression" to see what getIsSyncable returns and if I did it correctly, it is returning zero. So I don't think the suggested change would matter for us.

In addition, I also loaded DavX5. When I look at every location in the code that sets setIsSyncable, it only sets it to either zero or one. These two things lead me to believe that perhaps the code should not be checking for syncable.

I also loaded the code for the LineageOS contacts program from https://github.com/LineageOS/android_packages_apps_Contacts Unfortunately, unlike either Fossfy Contacts or DavX5, when I pull the Git repo into Android Studio, it is not in whatever form it needs to be to automagically be compilable and debuggable on my device. However, I did look at the code, and it seems that they only care about syncability specifically for Google contacts. Since I am not using Google anything, I suspect this code is not used for my contacts list.

To be clear on this issue, I want to list my situation. It seems there may be more than one problem being described here. I am running LineageOS 21 on a Google Pixel 8. I did not install any Google services. I am using DavX5 to provide access to my Nextcloud server. Lineage's provided Contacts program can see my contacts, but Fossify can't.

If anyone has any suggestions, perhaps how to get that LineageOS contacts program built so I can debug it and see why it works while Fossify doesn't, please share.