nus-yam/ex-repair huggingface dataset:
Program: 781
Project: 781
Buggy source:
private void serviceDoneExecutingLocked(ServiceRecord r,boolean inDestroying,boolean finishing){
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.executeNesting+ "String_Node_Str"+ inDestroying+ "String_Node_Str"+ r.app);
 else   if (DEBUG_SERVICE_EXECUTING)   Slog.v(TAG,"String_Node_Str" + r.shortName);
  r.executeNesting--;
  if (r.executeNesting <= 0) {
    if (r.app != null) {
      if (DEBUG_SERVICE)       Slog.v(TAG,"String_Node_Str" + r.shortName);
      r.app.execServicesFg=false;
      r.app.executingServices.remove(r);
      if (r.app.executingServices.size() == 0) {
        if (DEBUG_SERVICE || DEBUG_SERVICE_EXECUTING)         Slog.v(TAG,"String_Node_Str" + r.shortName);
        mAm.mHandler.removeMessages(ActivityManagerService.SERVICE_TIMEOUT_MSG,r.app);
      }
 else       if (r.executeFg) {
        for (int i=r.app.executingServices.size() - 1; i >= 0; i--) {
          if (r.app.executingServices.valueAt(i).executeFg) {
            r.app.execServicesFg=true;
            break;
          }
        }
      }
      if (inDestroying) {
        if (DEBUG_SERVICE)         Slog.v(TAG,"String_Node_Str" + r);
        mDestroyingServices.remove(r);
        r.bindings.clear();
      }
      mAm.updateOomAdjLocked(r.app);
    }
    r.executeFg=false;
    if (r.tracker != null) {
      r.tracker.setExecuting(false,mAm.mProcessStats.getMemFactorLocked(),SystemClock.uptimeMillis());
      if (finishing) {
        r.tracker.clearCurrentOwner(r);
        r.tracker=null;
      }
    }
  }
}

Fixed version (ground truth):
private void serviceDoneExecutingLocked(ServiceRecord r,boolean inDestroying,boolean finishing){
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.executeNesting+ "String_Node_Str"+ inDestroying+ "String_Node_Str"+ r.app);
 else   if (DEBUG_SERVICE_EXECUTING)   Slog.v(TAG,"String_Node_Str" + r.shortName);
  r.executeNesting--;
  if (r.executeNesting <= 0) {
    if (r.app != null) {
      if (DEBUG_SERVICE)       Slog.v(TAG,"String_Node_Str" + r.shortName);
      r.app.execServicesFg=false;
      r.app.executingServices.remove(r);
      if (r.app.executingServices.size() == 0) {
        if (DEBUG_SERVICE || DEBUG_SERVICE_EXECUTING)         Slog.v(TAG,"String_Node_Str" + r.shortName);
        mAm.mHandler.removeMessages(ActivityManagerService.SERVICE_TIMEOUT_MSG,r.app);
      }
 else       if (r.executeFg) {
        for (int i=r.app.executingServices.size() - 1; i >= 0; i--) {
          if (r.app.executingServices.valueAt(i).executeFg) {
            r.app.execServicesFg=true;
            break;
          }
        }
      }
      if (inDestroying) {
        if (DEBUG_SERVICE)         Slog.v(TAG,"String_Node_Str" + r);
        mDestroyingServices.remove(r);
        r.bindings.clear();
      }
      mAm.updateOomAdjLocked(r.app);
    }
    r.executeFg=false;
    if (r.tracker != null) {
      r.tracker.setExecuting(false,mAm.mProcessStats.getMemFactorLocked(),SystemClock.uptimeMillis());
      if (finishing) {
        r.tracker.clearCurrentOwner(r,false);
        r.tracker=null;
      }
    }
  }
}
Program: 784
Project: 784
Buggy source:
public void forceClearTracker(){
  if (tracker != null) {
    int memFactor=ams.mProcessStats.getMemFactorLocked();
    long now=SystemClock.uptimeMillis();
    tracker.setStarted(false,memFactor,now);
    tracker.setBound(false,memFactor,now);
    tracker.setExecuting(false,memFactor,now);
    tracker.clearCurrentOwner(this);
    tracker=null;
  }
}

Fixed version (ground truth):
public void forceClearTracker(){
  if (tracker != null) {
    tracker.clearCurrentOwner(this,true);
    tracker=null;
  }
}
Program: 786
Project: 786
Buggy source:
/** 
 * Updates the PAC Manager with current Proxy information. This is called by the ConnectivityService directly before a broadcast takes place to allow the PacManager to indicate that the broadcast should not be sent and the PacManager will trigger a new broadcast when it is ready.
 * @param proxy Proxy information that is about to be broadcast.
 * @return Returns true when the broadcast should not be sent
 */
public synchronized boolean setCurrentProxyScriptUrl(ProxyProperties proxy){
  if (!TextUtils.isEmpty(proxy.getPacFileUrl())) {
    if (proxy.getPacFileUrl().equals(mPacUrl)) {
      return false;
    }
synchronized (mProxyLock) {
      mPacUrl=proxy.getPacFileUrl();
    }
    mCurrentDelay=DELAY_1;
    mHasSentBroadcast=false;
    mHasDownloaded=false;
    getAlarmManager().cancel(mPacRefreshIntent);
    bind();
    return true;
  }
 else {
    getAlarmManager().cancel(mPacRefreshIntent);
synchronized (mProxyLock) {
      mPacUrl=null;
      mCurrentPac=null;
      if (mProxyService != null) {
        try {
          mProxyService.stopPacSystem();
        }
 catch (        RemoteException e) {
          Log.w(TAG,"String_Node_Str",e);
        }
 finally {
          unbind();
        }
      }
    }
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Updates the PAC Manager with current Proxy information. This is called by the ConnectivityService directly before a broadcast takes place to allow the PacManager to indicate that the broadcast should not be sent and the PacManager will trigger a new broadcast when it is ready.
 * @param proxy Proxy information that is about to be broadcast.
 * @return Returns true when the broadcast should not be sent
 */
public synchronized boolean setCurrentProxyScriptUrl(ProxyProperties proxy){
  if (!TextUtils.isEmpty(proxy.getPacFileUrl())) {
    if (proxy.getPacFileUrl().equals(mPacUrl) && (proxy.getPort() > 0)) {
      return false;
    }
synchronized (mProxyLock) {
      mPacUrl=proxy.getPacFileUrl();
    }
    mCurrentDelay=DELAY_1;
    mHasSentBroadcast=false;
    mHasDownloaded=false;
    getAlarmManager().cancel(mPacRefreshIntent);
    bind();
    return true;
  }
 else {
    getAlarmManager().cancel(mPacRefreshIntent);
synchronized (mProxyLock) {
      mPacUrl=null;
      mCurrentPac=null;
      if (mProxyService != null) {
        try {
          mProxyService.stopPacSystem();
        }
 catch (        RemoteException e) {
          Log.w(TAG,"String_Node_Str",e);
        }
 finally {
          unbind();
        }
      }
    }
    return false;
  }
}
Program: 787
Project: 787
Buggy source:
public void reset(){
  mPasswordEntry.setText("String_Node_Str");
  mPasswordEntry.requestFocus();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    resetState();
  }
}

Fixed version (ground truth):
public void reset(){
  mPasswordEntry.setText("String_Node_Str");
  mPasswordEntry.requestFocus();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (shouldLockout(deadline)) {
    handleAttemptLockout(deadline);
  }
 else {
    resetState();
  }
}
Program: 791
Project: 791
Buggy source:
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  mScreenOn=true;
  final IBinder token=mKeyguardHost == null ? null : mKeyguardHost.getWindowToken();
  if (mKeyguardView != null) {
    mKeyguardView.onScreenTurnedOn();
    if (callback != null) {
      if (mKeyguardHost.getVisibility() == View.VISIBLE) {
        mKeyguardHost.post(new Runnable(){
          @Override public void run(){
            try {
              callback.onShown(token);
            }
 catch (            RemoteException e) {
              Slog.w(TAG,"String_Node_Str",e);
            }
          }
        }
);
      }
 else {
        try {
          callback.onShown(token);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
      }
    }
  }
 else   if (callback != null) {
    try {
      callback.onShown(token);
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  mScreenOn=true;
  final IBinder token;
  final boolean disabled=mLockPatternUtils.isLockScreenDisabled() && !mLockPatternUtils.isSecure();
  if (mKeyguardHost == null || disabled) {
    token=null;
  }
 else {
    token=mKeyguardHost.getWindowToken();
  }
  if (mKeyguardView != null) {
    mKeyguardView.onScreenTurnedOn();
    if (callback != null) {
      if (mKeyguardHost.getVisibility() == View.VISIBLE) {
        mKeyguardHost.post(new Runnable(){
          @Override public void run(){
            try {
              callback.onShown(token);
            }
 catch (            RemoteException e) {
              Slog.w(TAG,"String_Node_Str",e);
            }
          }
        }
);
      }
 else {
        try {
          callback.onShown(token);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
      }
    }
  }
 else   if (callback != null) {
    try {
      callback.onShown(token);
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}
Program: 792
Project: 792
Buggy source:
/** 
 * {@hide} 
 */
public NetworkInfo(NetworkInfo source){
  if (source != null) {
    mNetworkType=source.mNetworkType;
    mSubtype=source.mSubtype;
    mTypeName=source.mTypeName;
    mSubtypeName=source.mSubtypeName;
    mState=source.mState;
    mDetailedState=source.mDetailedState;
    mReason=source.mReason;
    mExtraInfo=source.mExtraInfo;
    mIsFailover=source.mIsFailover;
    mIsRoaming=source.mIsRoaming;
    mIsAvailable=source.mIsAvailable;
    mIsConnectedToProvisioningNetwork=source.mIsConnectedToProvisioningNetwork;
  }
}

Fixed version (ground truth):
/** 
 * {@hide} 
 */
public NetworkInfo(NetworkInfo source){
  if (source != null) {
synchronized (source) {
      mNetworkType=source.mNetworkType;
      mSubtype=source.mSubtype;
      mTypeName=source.mTypeName;
      mSubtypeName=source.mSubtypeName;
      mState=source.mState;
      mDetailedState=source.mDetailedState;
      mReason=source.mReason;
      mExtraInfo=source.mExtraInfo;
      mIsFailover=source.mIsFailover;
      mIsRoaming=source.mIsRoaming;
      mIsAvailable=source.mIsAvailable;
      mIsConnectedToProvisioningNetwork=source.mIsConnectedToProvisioningNetwork;
    }
  }
}
Program: 796
Project: 796
Buggy source:
public void reset(){
  mPasswordEntry.setText("String_Node_Str");
  mPasswordEntry.requestFocus();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    resetState();
  }
}

Fixed version (ground truth):
public void reset(){
  mPasswordEntry.setText("String_Node_Str");
  mPasswordEntry.requestFocus();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (shouldLockout(deadline)) {
    handleAttemptLockout(deadline);
  }
 else {
    resetState();
  }
}
Program: 800
Project: 800
Buggy source:
public void reset(){
  mPasswordEntry.setText("String_Node_Str");
  mPasswordEntry.requestFocus();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    resetState();
  }
}

Fixed version (ground truth):
public void reset(){
  mPasswordEntry.setText("String_Node_Str");
  mPasswordEntry.requestFocus();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (shouldLockout(deadline)) {
    handleAttemptLockout(deadline);
  }
 else {
    resetState();
  }
}
Program: 804
Project: 804
Buggy source:
public void reset(){
  mPasswordEntry.setText("String_Node_Str");
  mPasswordEntry.requestFocus();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    resetState();
  }
}

Fixed version (ground truth):
public void reset(){
  mPasswordEntry.setText("String_Node_Str");
  mPasswordEntry.requestFocus();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (shouldLockout(deadline)) {
    handleAttemptLockout(deadline);
  }
 else {
    resetState();
  }
}
Program: 808
Project: 808
Buggy source:
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  mScreenOn=true;
  final IBinder token=mKeyguardHost == null ? null : mKeyguardHost.getWindowToken();
  if (mKeyguardView != null) {
    mKeyguardView.onScreenTurnedOn();
    if (callback != null) {
      if (mKeyguardHost.getVisibility() == View.VISIBLE) {
        mKeyguardHost.post(new Runnable(){
          @Override public void run(){
            try {
              callback.onShown(token);
            }
 catch (            RemoteException e) {
              Slog.w(TAG,"String_Node_Str",e);
            }
          }
        }
);
      }
 else {
        try {
          callback.onShown(token);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
      }
    }
  }
 else   if (callback != null) {
    try {
      callback.onShown(token);
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  mScreenOn=true;
  final IBinder token;
  final boolean disabled=mLockPatternUtils.isLockScreenDisabled() && !mLockPatternUtils.isSecure();
  if (mKeyguardHost == null || disabled) {
    token=null;
  }
 else {
    token=mKeyguardHost.getWindowToken();
  }
  if (mKeyguardView != null) {
    mKeyguardView.onScreenTurnedOn();
    if (callback != null) {
      if (mKeyguardHost.getVisibility() == View.VISIBLE) {
        mKeyguardHost.post(new Runnable(){
          @Override public void run(){
            try {
              callback.onShown(token);
            }
 catch (            RemoteException e) {
              Slog.w(TAG,"String_Node_Str",e);
            }
          }
        }
);
      }
 else {
        try {
          callback.onShown(token);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
      }
    }
  }
 else   if (callback != null) {
    try {
      callback.onShown(token);
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}
Program: 809
Project: 809
Buggy source:
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  mScreenOn=true;
  final IBinder token=mKeyguardHost == null ? null : mKeyguardHost.getWindowToken();
  if (mKeyguardView != null) {
    mKeyguardView.onScreenTurnedOn();
    if (callback != null) {
      if (mKeyguardHost.getVisibility() == View.VISIBLE) {
        mKeyguardHost.post(new Runnable(){
          @Override public void run(){
            try {
              callback.onShown(token);
            }
 catch (            RemoteException e) {
              Slog.w(TAG,"String_Node_Str",e);
            }
          }
        }
);
      }
 else {
        try {
          callback.onShown(token);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
      }
    }
  }
 else   if (callback != null) {
    try {
      callback.onShown(token);
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  mScreenOn=true;
  final IBinder token;
  final boolean disabled=mLockPatternUtils.isLockScreenDisabled() && !mLockPatternUtils.isSecure();
  if (mKeyguardHost == null || disabled) {
    token=null;
  }
 else {
    token=mKeyguardHost.getWindowToken();
  }
  if (mKeyguardView != null) {
    mKeyguardView.onScreenTurnedOn();
    if (callback != null) {
      if (mKeyguardHost.getVisibility() == View.VISIBLE) {
        mKeyguardHost.post(new Runnable(){
          @Override public void run(){
            try {
              callback.onShown(token);
            }
 catch (            RemoteException e) {
              Slog.w(TAG,"String_Node_Str",e);
            }
          }
        }
);
      }
 else {
        try {
          callback.onShown(token);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
      }
    }
  }
 else   if (callback != null) {
    try {
      callback.onShown(token);
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}
Program: 810
Project: 810
Buggy source:
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  mScreenOn=true;
  final IBinder token=mKeyguardHost == null ? null : mKeyguardHost.getWindowToken();
  if (mKeyguardView != null) {
    mKeyguardView.onScreenTurnedOn();
    if (callback != null) {
      if (mKeyguardHost.getVisibility() == View.VISIBLE) {
        mKeyguardHost.post(new Runnable(){
          @Override public void run(){
            try {
              callback.onShown(token);
            }
 catch (            RemoteException e) {
              Slog.w(TAG,"String_Node_Str",e);
            }
          }
        }
);
      }
 else {
        try {
          callback.onShown(token);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
      }
    }
  }
 else   if (callback != null) {
    try {
      callback.onShown(token);
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  mScreenOn=true;
  final IBinder token;
  final boolean disabled=mLockPatternUtils.isLockScreenDisabled() && !mLockPatternUtils.isSecure();
  if (mKeyguardHost == null || disabled) {
    token=null;
  }
 else {
    token=mKeyguardHost.getWindowToken();
  }
  if (mKeyguardView != null) {
    mKeyguardView.onScreenTurnedOn();
    if (callback != null) {
      if (mKeyguardHost.getVisibility() == View.VISIBLE) {
        mKeyguardHost.post(new Runnable(){
          @Override public void run(){
            try {
              callback.onShown(token);
            }
 catch (            RemoteException e) {
              Slog.w(TAG,"String_Node_Str",e);
            }
          }
        }
);
      }
 else {
        try {
          callback.onShown(token);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
      }
    }
  }
 else   if (callback != null) {
    try {
      callback.onShown(token);
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}
Program: 811
Project: 811
Buggy source:
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  mScreenOn=true;
  final IBinder token=mKeyguardHost == null ? null : mKeyguardHost.getWindowToken();
  if (mKeyguardView != null) {
    mKeyguardView.onScreenTurnedOn();
    if (callback != null) {
      if (mKeyguardHost.getVisibility() == View.VISIBLE) {
        mKeyguardHost.post(new Runnable(){
          @Override public void run(){
            try {
              callback.onShown(token);
            }
 catch (            RemoteException e) {
              Slog.w(TAG,"String_Node_Str",e);
            }
          }
        }
);
      }
 else {
        try {
          callback.onShown(token);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
      }
    }
  }
 else   if (callback != null) {
    try {
      callback.onShown(token);
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  mScreenOn=true;
  final IBinder token;
  final boolean disabled=mLockPatternUtils.isLockScreenDisabled() && !mLockPatternUtils.isSecure();
  if (mKeyguardHost == null || disabled) {
    token=null;
  }
 else {
    token=mKeyguardHost.getWindowToken();
  }
  if (mKeyguardView != null) {
    mKeyguardView.onScreenTurnedOn();
    if (callback != null) {
      if (mKeyguardHost.getVisibility() == View.VISIBLE) {
        mKeyguardHost.post(new Runnable(){
          @Override public void run(){
            try {
              callback.onShown(token);
            }
 catch (            RemoteException e) {
              Slog.w(TAG,"String_Node_Str",e);
            }
          }
        }
);
      }
 else {
        try {
          callback.onShown(token);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
      }
    }
  }
 else   if (callback != null) {
    try {
      callback.onShown(token);
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}
Program: 812
Project: 812
Buggy source:
public void reset(){
  mPasswordEntry.setText("String_Node_Str");
  mPasswordEntry.requestFocus();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    resetState();
  }
}

Fixed version (ground truth):
public void reset(){
  mPasswordEntry.setText("String_Node_Str");
  mPasswordEntry.requestFocus();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (shouldLockout(deadline)) {
    handleAttemptLockout(deadline);
  }
 else {
    resetState();
  }
}
Program: 813
Project: 813
Buggy source:
/** 
 * Get the list of information about the periodic syncs for the given account and authority. <p>This method requires the caller to hold the permission  {@link android.Manifest.permission#READ_SYNC_SETTINGS}.
 * @param account the account whose periodic syncs we are querying
 * @param authority the provider whose periodic syncs we are querying
 * @return a list of PeriodicSync objects. This list may be empty but will never be null.
 */
public static List<PeriodicSync> getPeriodicSyncs(Account account,String authority){
  if (account == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (authority == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    return getContentService().getPeriodicSyncs(account,authority);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Get the list of information about the periodic syncs for the given account and authority. <p>This method requires the caller to hold the permission  {@link android.Manifest.permission#READ_SYNC_SETTINGS}.
 * @param account the account whose periodic syncs we are querying
 * @param authority the provider whose periodic syncs we are querying
 * @return a list of PeriodicSync objects. This list may be empty but will never be null.
 */
public static List<PeriodicSync> getPeriodicSyncs(Account account,String authority){
  try {
    return getContentService().getPeriodicSyncs(account,authority);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 815
Project: 815
Buggy source:
/** 
 * Remove a periodic sync. Has no affect if account, authority and extras don't match an existing periodic sync. <p>This method requires the caller to hold the permission  {@link android.Manifest.permission#WRITE_SYNC_SETTINGS}.
 * @param account the account of the periodic sync to remove
 * @param authority the provider of the periodic sync to remove
 * @param extras the extras of the periodic sync to remove
 */
public static void removePeriodicSync(Account account,String authority,Bundle extras){
  validateSyncExtrasBundle(extras);
  if (account == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (authority == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    getContentService().removePeriodicSync(account,authority,extras);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Remove a periodic sync. Has no affect if account, authority and extras don't match an existing periodic sync. <p>This method requires the caller to hold the permission  {@link android.Manifest.permission#WRITE_SYNC_SETTINGS}.
 * @param account the account of the periodic sync to remove
 * @param authority the provider of the periodic sync to remove
 * @param extras the extras of the periodic sync to remove
 */
public static void removePeriodicSync(Account account,String authority,Bundle extras){
  validateSyncExtrasBundle(extras);
  try {
    getContentService().removePeriodicSync(account,authority,extras);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 816
Project: 816
Buggy source:
/** 
 * Specify an authority and account for this transfer.
 * @param authority String identifying which content provider to sync.
 * @param account Account to sync. Can be null unless this is a periodic sync.
 */
public Builder setSyncAdapter(Account account,String authority){
  if (mSyncTarget != SYNC_TARGET_UNKNOWN) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mSyncTarget=SYNC_TARGET_ADAPTER;
  mAccount=account;
  mAuthority=authority;
  mComponentName=null;
  return this;
}

Fixed version (ground truth):
/** 
 * Specify an authority and account for this transfer.
 * @param authority String identifying which content provider to sync.
 * @param account Account to sync. Can be null unless this is a periodic sync.
 */
public Builder setSyncAdapter(Account account,String authority){
  if (mSyncTarget != SYNC_TARGET_UNKNOWN) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (authority != null && authority.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mSyncTarget=SYNC_TARGET_ADAPTER;
  mAccount=account;
  mAuthority=authority;
  mComponentName=null;
  return this;
}
Program: 817
Project: 817
Buggy source:
/** 
 * Old API. Schedule periodic sync with default flex time.
 */
@Override public void addPeriodicSync(Account account,String authority,Bundle extras,long pollFrequency){
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  if (pollFrequency < 60) {
    Slog.w(TAG,"String_Node_Str" + pollFrequency + "String_Node_Str");
    pollFrequency=60;
  }
  long identityToken=clearCallingIdentity();
  try {
    PeriodicSync syncToAdd=new PeriodicSync(account,authority,extras,pollFrequency,SyncStorageEngine.calculateDefaultFlexTime(pollFrequency));
    getSyncManager().getSyncStorageEngine().addPeriodicSync(syncToAdd,userId);
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
/** 
 * Old API. Schedule periodic sync with default flex time. 
 */
@Override public void addPeriodicSync(Account account,String authority,Bundle extras,long pollFrequency){
  if (account == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (TextUtils.isEmpty(authority)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  if (pollFrequency < 60) {
    Slog.w(TAG,"String_Node_Str" + pollFrequency + "String_Node_Str");
    pollFrequency=60;
  }
  long identityToken=clearCallingIdentity();
  try {
    PeriodicSync syncToAdd=new PeriodicSync(account,authority,extras,pollFrequency,SyncStorageEngine.calculateDefaultFlexTime(pollFrequency));
    getSyncManager().getSyncStorageEngine().addPeriodicSync(syncToAdd,userId);
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 818
Project: 818
Buggy source:
@Override public void setSyncAutomatically(Account account,String providerName,boolean sync){
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.getSyncStorageEngine().setSyncAutomatically(account,userId,providerName,sync);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
@Override public void setSyncAutomatically(Account account,String providerName,boolean sync){
  if (TextUtils.isEmpty(providerName)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.getSyncStorageEngine().setSyncAutomatically(account,userId,providerName,sync);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 819
Project: 819
Buggy source:
/** 
 * Clear all scheduled sync operations that match the uri and cancel the active sync if they match the authority and account, if they are present.
 * @param account filter the pending and active syncs to cancel using this account
 * @param authority filter the pending and active syncs to cancel using this authority
 */
@Override public void cancelSync(Account account,String authority){
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.clearScheduledSyncOperations(account,userId,authority);
      syncManager.cancelActiveSync(account,userId,authority);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
/** 
 * Clear all scheduled sync operations that match the uri and cancel the active sync if they match the authority and account, if they are present.
 * @param account filter the pending and active syncs to cancel using this account
 * @param authority filter the pending and active syncs to cancel using this authority
 */
@Override public void cancelSync(Account account,String authority){
  if (authority != null && authority.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.clearScheduledSyncOperations(account,userId,authority);
      syncManager.cancelActiveSync(account,userId,authority);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 820
Project: 820
Buggy source:
@Override public void setIsSyncable(Account account,String providerName,int syncable){
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.getSyncStorageEngine().setIsSyncable(account,userId,providerName,syncable);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
@Override public void setIsSyncable(Account account,String providerName,int syncable){
  if (TextUtils.isEmpty(providerName)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.getSyncStorageEngine().setIsSyncable(account,userId,providerName,syncable);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 822
Project: 822
Buggy source:
@Override public List<PeriodicSync> getPeriodicSyncs(Account account,String providerName){
  mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    return getSyncManager().getSyncStorageEngine().getPeriodicSyncs(account,userId,providerName);
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
@Override public List<PeriodicSync> getPeriodicSyncs(Account account,String providerName){
  if (account == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (TextUtils.isEmpty(providerName)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    return getSyncManager().getSyncStorageEngine().getPeriodicSyncs(account,userId,providerName);
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 823
Project: 823
Buggy source:
public SyncStatusInfo getSyncStatus(Account account,String authority){
  mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      return syncManager.getSyncStorageEngine().getStatusByAccountAndAuthority(account,userId,authority);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
  return null;
}

Fixed version (ground truth):
public SyncStatusInfo getSyncStatus(Account account,String authority){
  if (TextUtils.isEmpty(authority)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      return syncManager.getSyncStorageEngine().getStatusByAccountAndAuthority(account,userId,authority);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
  return null;
}
Program: 824
Project: 824
Buggy source:
@Override public void removePeriodicSync(Account account,String authority,Bundle extras){
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    PeriodicSync syncToRemove=new PeriodicSync(account,authority,extras,0,0);
    getSyncManager().getSyncStorageEngine().removePeriodicSync(syncToRemove,userId);
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
@Override public void removePeriodicSync(Account account,String authority,Bundle extras){
  if (account == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (TextUtils.isEmpty(authority)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    PeriodicSync syncToRemove=new PeriodicSync(account,authority,extras,0,0);
    getSyncManager().getSyncStorageEngine().removePeriodicSync(syncToRemove,userId);
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 826
Project: 826
Buggy source:
/** 
 * Returns the status that matches the authority and account.
 * @param account the account we want to check
 * @param authority the authority whose row should be selected
 * @return the SyncStatusInfo for the authority
 */
public SyncStatusInfo getStatusByAccountAndAuthority(Account account,int userId,String authority){
  if (account == null || authority == null) {
    throw new IllegalArgumentException();
  }
synchronized (mAuthorities) {
    final int N=mSyncStatus.size();
    for (int i=0; i < N; i++) {
      SyncStatusInfo cur=mSyncStatus.valueAt(i);
      AuthorityInfo ainfo=mAuthorities.get(cur.authorityId);
      if (ainfo != null && ainfo.authority.equals(authority) && ainfo.userId == userId && account.equals(ainfo.account)) {
        return cur;
      }
    }
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the status that matches the authority and account.
 * @param account the account we want to check
 * @param authority the authority whose row should be selected
 * @return the SyncStatusInfo for the authority or null if none found.
 */
public SyncStatusInfo getStatusByAccountAndAuthority(Account account,int userId,String authority){
  if (account == null || authority == null) {
    return null;
  }
synchronized (mAuthorities) {
    final int N=mSyncStatus.size();
    for (int i=0; i < N; i++) {
      SyncStatusInfo cur=mSyncStatus.valueAt(i);
      AuthorityInfo ainfo=mAuthorities.get(cur.authorityId);
      if (ainfo != null && ainfo.authority.equals(authority) && ainfo.userId == userId && account.equals(ainfo.account)) {
        return cur;
      }
    }
    return null;
  }
}
Program: 827
Project: 827
Buggy source:
/** 
 * Get the list of information about the periodic syncs for the given account and authority. <p>This method requires the caller to hold the permission  {@link android.Manifest.permission#READ_SYNC_SETTINGS}.
 * @param account the account whose periodic syncs we are querying
 * @param authority the provider whose periodic syncs we are querying
 * @return a list of PeriodicSync objects. This list may be empty but will never be null.
 */
public static List<PeriodicSync> getPeriodicSyncs(Account account,String authority){
  if (account == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (authority == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    return getContentService().getPeriodicSyncs(account,authority);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Get the list of information about the periodic syncs for the given account and authority. <p>This method requires the caller to hold the permission  {@link android.Manifest.permission#READ_SYNC_SETTINGS}.
 * @param account the account whose periodic syncs we are querying
 * @param authority the provider whose periodic syncs we are querying
 * @return a list of PeriodicSync objects. This list may be empty but will never be null.
 */
public static List<PeriodicSync> getPeriodicSyncs(Account account,String authority){
  try {
    return getContentService().getPeriodicSyncs(account,authority);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 829
Project: 829
Buggy source:
/** 
 * Remove a periodic sync. Has no affect if account, authority and extras don't match an existing periodic sync. <p>This method requires the caller to hold the permission  {@link android.Manifest.permission#WRITE_SYNC_SETTINGS}.
 * @param account the account of the periodic sync to remove
 * @param authority the provider of the periodic sync to remove
 * @param extras the extras of the periodic sync to remove
 */
public static void removePeriodicSync(Account account,String authority,Bundle extras){
  validateSyncExtrasBundle(extras);
  if (account == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (authority == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    getContentService().removePeriodicSync(account,authority,extras);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Remove a periodic sync. Has no affect if account, authority and extras don't match an existing periodic sync. <p>This method requires the caller to hold the permission  {@link android.Manifest.permission#WRITE_SYNC_SETTINGS}.
 * @param account the account of the periodic sync to remove
 * @param authority the provider of the periodic sync to remove
 * @param extras the extras of the periodic sync to remove
 */
public static void removePeriodicSync(Account account,String authority,Bundle extras){
  validateSyncExtrasBundle(extras);
  try {
    getContentService().removePeriodicSync(account,authority,extras);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 830
Project: 830
Buggy source:
/** 
 * Specify an authority and account for this transfer.
 * @param authority String identifying which content provider to sync.
 * @param account Account to sync. Can be null unless this is a periodic sync.
 */
public Builder setSyncAdapter(Account account,String authority){
  if (mSyncTarget != SYNC_TARGET_UNKNOWN) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mSyncTarget=SYNC_TARGET_ADAPTER;
  mAccount=account;
  mAuthority=authority;
  mComponentName=null;
  return this;
}

Fixed version (ground truth):
/** 
 * Specify an authority and account for this transfer.
 * @param authority String identifying which content provider to sync.
 * @param account Account to sync. Can be null unless this is a periodic sync.
 */
public Builder setSyncAdapter(Account account,String authority){
  if (mSyncTarget != SYNC_TARGET_UNKNOWN) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (authority != null && authority.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mSyncTarget=SYNC_TARGET_ADAPTER;
  mAccount=account;
  mAuthority=authority;
  mComponentName=null;
  return this;
}
Program: 831
Project: 831
Buggy source:
/** 
 * Old API. Schedule periodic sync with default flex time.
 */
@Override public void addPeriodicSync(Account account,String authority,Bundle extras,long pollFrequency){
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  if (pollFrequency < 60) {
    Slog.w(TAG,"String_Node_Str" + pollFrequency + "String_Node_Str");
    pollFrequency=60;
  }
  long identityToken=clearCallingIdentity();
  try {
    PeriodicSync syncToAdd=new PeriodicSync(account,authority,extras,pollFrequency,SyncStorageEngine.calculateDefaultFlexTime(pollFrequency));
    getSyncManager().getSyncStorageEngine().addPeriodicSync(syncToAdd,userId);
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
/** 
 * Old API. Schedule periodic sync with default flex time. 
 */
@Override public void addPeriodicSync(Account account,String authority,Bundle extras,long pollFrequency){
  if (account == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (TextUtils.isEmpty(authority)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  if (pollFrequency < 60) {
    Slog.w(TAG,"String_Node_Str" + pollFrequency + "String_Node_Str");
    pollFrequency=60;
  }
  long identityToken=clearCallingIdentity();
  try {
    PeriodicSync syncToAdd=new PeriodicSync(account,authority,extras,pollFrequency,SyncStorageEngine.calculateDefaultFlexTime(pollFrequency));
    getSyncManager().getSyncStorageEngine().addPeriodicSync(syncToAdd,userId);
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 832
Project: 832
Buggy source:
@Override public void setSyncAutomatically(Account account,String providerName,boolean sync){
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.getSyncStorageEngine().setSyncAutomatically(account,userId,providerName,sync);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
@Override public void setSyncAutomatically(Account account,String providerName,boolean sync){
  if (TextUtils.isEmpty(providerName)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.getSyncStorageEngine().setSyncAutomatically(account,userId,providerName,sync);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 833
Project: 833
Buggy source:
/** 
 * Clear all scheduled sync operations that match the uri and cancel the active sync if they match the authority and account, if they are present.
 * @param account filter the pending and active syncs to cancel using this account
 * @param authority filter the pending and active syncs to cancel using this authority
 */
@Override public void cancelSync(Account account,String authority){
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.clearScheduledSyncOperations(account,userId,authority);
      syncManager.cancelActiveSync(account,userId,authority);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
/** 
 * Clear all scheduled sync operations that match the uri and cancel the active sync if they match the authority and account, if they are present.
 * @param account filter the pending and active syncs to cancel using this account
 * @param authority filter the pending and active syncs to cancel using this authority
 */
@Override public void cancelSync(Account account,String authority){
  if (authority != null && authority.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.clearScheduledSyncOperations(account,userId,authority);
      syncManager.cancelActiveSync(account,userId,authority);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 834
Project: 834
Buggy source:
@Override public void setIsSyncable(Account account,String providerName,int syncable){
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.getSyncStorageEngine().setIsSyncable(account,userId,providerName,syncable);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
@Override public void setIsSyncable(Account account,String providerName,int syncable){
  if (TextUtils.isEmpty(providerName)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,"String_Node_Str");
  int userId=UserHandle.getCallingUserId();
  long identityToken=clearCallingIdentity();
  try {
    SyncManager syncManager=getSyncManager();
    if (syncManager != null) {
      syncManager.getSyncStorageEngine().setIsSyncable(account,userId,providerName,syncable);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}