Example usage for android.content SyncResult madeSomeProgress

List of usage examples for android.content SyncResult madeSomeProgress

Introduction

In this page you can find the example usage for android.content SyncResult madeSomeProgress.

Prototype

public boolean madeSomeProgress() 

Source Link

Document

Convenience method for determining if the Sync should be rescheduled after failing for some reason.

Usage

From source file:com.android.providers.contacts.ContactsSyncAdapter.java

@Override
public void sendClientDiffs(SyncContext context, SyncableContentProvider clientDiffs,
        SyncableContentProvider serverDiffs, SyncResult syncResult, boolean dontSendDeletes) {
    initTempProvider(clientDiffs);// ww  w .  j  ava  2s.  c  om

    sendClientDiffsImpl(context, clientDiffs, new GroupEntry(), null /* no syncInfo */, serverDiffs, syncResult,
            dontSendDeletes);

    // lets go ahead and commit what we have if we successfully made a change
    if (syncResult.madeSomeProgress()) {
        return;
    }

    sendClientPhotos(context, clientDiffs, null /* no syncInfo */, syncResult);

    // lets go ahead and commit what we have if we successfully made a change
    if (syncResult.madeSomeProgress()) {
        return;
    }

    sendClientDiffsImpl(context, clientDiffs, new ContactEntry(), null /* no syncInfo */, serverDiffs,
            syncResult, dontSendDeletes);
}