Example usage for android.content ContentResolver setMasterSyncAutomatically

List of usage examples for android.content ContentResolver setMasterSyncAutomatically

Introduction

In this page you can find the example usage for android.content ContentResolver setMasterSyncAutomatically.

Prototype

public static void setMasterSyncAutomatically(boolean sync) 

Source Link

Document

Sets the master auto-sync setting that applies to all the providers and accounts.

Usage

From source file:com.sentaroh.android.TaskAutomation.TaskExecutor.java

final static public boolean setAutoSyncDisabled(TaskManagerParms taskMgrParms, EnvironmentParms envParms,
        CommonUtilities util, TaskResponse taskResponse, ActionResponse ar) {
    if (ContentResolver.getMasterSyncAutomatically()) {
        ContentResolver.setMasterSyncAutomatically(false);
        return true;
    } else {/*w  w w.j a va2s  . c o m*/
        ar.action_resp = ActionResponse.ACTION_WARNING;
        ar.resp_msg_text = "AutoSync was already disabled, action ignored";
        return false;
    }
}