signalapp / Flock

Private contact and calendar sync for Android.
https://signal.org/blog/flock
358 stars 80 forks source link

Can't import local contacts #85

Open paride opened 9 years ago

paride commented 9 years ago

I'm running Flock on Cyanogenmod 11m12. Most of my contacts are local, I'm sure about this as when I edit them I see that it is "Phone-only, unsynced contact". I would like to import these contacts in Flock, but the "Local storage" option says that I have 0 contacts to import. Even if I try anyway no contact is imported. I'll be happy to provide any further information. Thanks!

rhodey commented 9 years ago

hello @legovini,

I tried to reproduce on stock Android Lollipop after a factory reset but was unable. My process for testing this was:

  1. factory reset my nexus 7
  2. import my google account on device setup
  3. export contacts to external storage via the native feature
  4. remove my google account from the device
  5. import contacts from external storage via the native feature
  6. install flock and import local contacts

I can think of a couple reasons why this didn't work for you:

I'll poke around Cyanogenmod's code base and see if I can clear up the first of these two possibilities.

paride commented 9 years ago

Hello @rhodey,

thanks for trying to find out where the problem is. The steps you made to reproduce the problem are the same I did, the only difference is that I skipped the Google account part (I already had the .vcf file with the contacts). Just to be clear this is what I did:

  1. Install Cyanogenmod 11 (Android 4.4.4)
  2. Import a .vcf file with the native feature, these contacts were not synced with any account
  3. Setup a Google account. The previously imported contacts were not synced with this account, so this step should not matter.
  4. Install flock, but it says I have 0 local contacts. The Google account also has some contacts, and these are correctly seen by Flock.

I don't know about the ACCOUNT_TYPE, but I would be surprised if they changed it from AOSP. If I have any way to check just let me know. I set up no privacy guard restrictions for Flock

I'll be very happy to subscribe for a Flock account if this will be fixed.

untitaker commented 9 years ago

@legovini You should be able to export your phone-only contacts to sdcard and import them into the Flock account, all with the normal contacts app.

paride commented 9 years ago

You are probably right, thanks for the suggestion, but the Flock function to import the local contacts remains broken. Moreover, there isn't a really convenient way to export only the phone-only contacts to sdcard, but this is another issue.

patcon commented 9 years ago

Was just coming to report the same thing. Seems CM store local contacts with a type of com.android.localphone

root@grouper:/ # sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "SELECT * FROM accounts"                                                                            
1|PHONE|com.android.localphone|

Also, @untitaker's solution doesn't seem to work in my situation, perhaps because I'm no gapps. Adding a new contact gives me a popup that says "Your new contact won't be backed up. Add an account tha backs up contacts online?" with two button options: "Keep Local" or "Add account".

"Keep local" has the problem explained in this issue and choosing "Flock" from the "Add account" popup gives the toast notifcation "Flock users may not have multiple accounts"