Hi Jonathan,
do you mind sharing your solution with us?
I've managed to change the contacts sync settings like this:
final Uri CONTENT_URI = Uri.parse("content://sync/settings");
//disable google sync
ContentValues values = new ContentValues();
values.put("name", "sync_provider_contacts");
values.put("value", false);
context.getContentResolver().insert(CONTENT_URI, values);
//enable google sync
values = new ContentValues();
values.put("name", "sync_provider_contacts");
values.put("value", true);
context.getContentResolver().insert(CONTENT_URI, values);
is there a better way to do it?
On Oct 7, 5:04 pm, Jonathan Herriott <[email protected]> wrote:
> So, I figured out a way to do it. It's a way that things shouldn't be
> done since it requires using APIs that have @hide.
>
> On Oct 6, 4:18 pm, Jonathan Herriott <[email protected]> wrote:
>
>
>
> > Hi,
>
> > So, I'm trying to figure out a way to disable Auto-Sync of the
> > Contacts database because there may be cases where my application
> > tries to write 1000 contacts to the database, which can take a very
> > long time. I've noticed that some apps on the market have the ability
> > to disable syncing, but I can't find a way to do it. I've noticed
> > that there are two permission:
>
> > android.permission.WRITE_SYNC_SETTINGS
> > android.permission.READ_SYNC_SETTINGS
>
> > but I can't find where these are used in the Android source code. I
> > don't even need to disable gmail/calendar syncing, I just need to
> > disable Contact syncing. Any help would be great.
>
> > Thanks,
> > Jonathan Herriott
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---