nus-yam/ex-repair huggingface dataset:
Program: 196128
Project: 196128
Buggy source:
private void cleanUpRemovedTaskLocked(TaskRecord tr,int flags){
  mRecentTasks.remove(tr);
  tr.removedFromRecents(mTaskPersister);
  final boolean killProcesses=(flags & ActivityManager.REMOVE_TASK_KILL_PROCESS) != 0;
  Intent baseIntent=new Intent(tr.intent != null ? tr.intent : tr.affinityIntent);
  ComponentName component=baseIntent.getComponent();
  if (component == null) {
    Slog.w(TAG,"String_Node_Str" + tr);
    return;
  }
  mServices.cleanUpRemovedTaskLocked(tr,component,baseIntent);
  if (killProcesses) {
    final String pkg=component.getPackageName();
    ArrayList<ProcessRecord> procs=new ArrayList<ProcessRecord>();
    ArrayMap<String,SparseArray<ProcessRecord>> pmap=mProcessNames.getMap();
    for (int i=0; i < pmap.size(); i++) {
      SparseArray<ProcessRecord> uids=pmap.valueAt(i);
      for (int j=0; j < uids.size(); j++) {
        ProcessRecord proc=uids.valueAt(j);
        if (proc.userId != tr.userId) {
          continue;
        }
        if (!proc.pkgList.containsKey(pkg)) {
          continue;
        }
        procs.add(proc);
      }
    }
    for (int i=0; i < procs.size(); i++) {
      ProcessRecord pr=procs.get(i);
      if (pr == mHomeProcess) {
        continue;
      }
      if (pr.setSchedGroup == Process.THREAD_GROUP_BG_NONINTERACTIVE) {
        pr.kill("String_Node_Str",true);
      }
 else {
        pr.waitingToKill="String_Node_Str";
      }
    }
  }
}

Fixed version (ground truth):
private void cleanUpRemovedTaskLocked(TaskRecord tr,boolean killProcess){
  mRecentTasks.remove(tr);
  tr.removedFromRecents(mTaskPersister);
  ComponentName component=tr.getBaseIntent().getComponent();
  if (component == null) {
    Slog.w(TAG,"String_Node_Str" + tr);
    return;
  }
  if (!killProcess) {
    return;
  }
  final String pkg=component.getPackageName();
  ArrayList<ProcessRecord> procsToKill=new ArrayList<ProcessRecord>();
  ArrayMap<String,SparseArray<ProcessRecord>> pmap=mProcessNames.getMap();
  for (int i=0; i < pmap.size(); i++) {
    SparseArray<ProcessRecord> uids=pmap.valueAt(i);
    for (int j=0; j < uids.size(); j++) {
      ProcessRecord proc=uids.valueAt(j);
      if (proc.userId != tr.userId) {
        continue;
      }
      if (proc == mHomeProcess) {
        continue;
      }
      if (!proc.pkgList.containsKey(pkg)) {
        continue;
      }
      for (int k=0; k < proc.activities.size(); k++) {
        TaskRecord otherTask=proc.activities.get(k).task;
        if (tr.taskId != otherTask.taskId && otherTask.inRecents) {
          return;
        }
      }
      procsToKill.add(proc);
    }
  }
  mServices.cleanUpRemovedTaskLocked(tr,component,new Intent(tr.getBaseIntent()));
  for (int i=0; i < procsToKill.size(); i++) {
    ProcessRecord pr=procsToKill.get(i);
    if (pr.setSchedGroup == Process.THREAD_GROUP_BG_NONINTERACTIVE) {
      pr.kill("String_Node_Str",true);
    }
 else {
      pr.waitingToKill="String_Node_Str";
    }
  }
}
Program: 196129
Project: 196129
Buggy source:
@Override public boolean onLongClick(View v){
  if (task.id >= 0 && thumbs != null) {
    mAm.removeTask(task.id,ActivityManager.REMOVE_TASK_KILL_PROCESS);
    buildUi();
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onLongClick(View v){
  if (task.id >= 0 && thumbs != null) {
    mAm.removeTask(task.id);
    buildUi();
    return true;
  }
  return false;
}
Program: 196130
Project: 196130
Buggy source:
private void addThumbnail(LinearLayout container,Bitmap bm,final ActivityManager.RecentTaskInfo task,final ActivityManager.TaskThumbnail thumbs){
  ImageView iv=new ImageView(this);
  if (bm != null) {
    iv.setImageBitmap(bm);
  }
  iv.setBackgroundResource(android.R.drawable.gallery_thumb);
  int w=getResources().getDimensionPixelSize(android.R.dimen.thumbnail_width);
  int h=getResources().getDimensionPixelSize(android.R.dimen.thumbnail_height);
  container.addView(iv,new LinearLayout.LayoutParams(w,h));
  iv.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (task.id >= 0 && thumbs != null) {
        mAm.moveTaskToFront(task.id,ActivityManager.MOVE_TASK_WITH_HOME);
      }
 else {
        try {
          startActivity(task.baseIntent);
        }
 catch (        ActivityNotFoundException e) {
          Log.w("String_Node_Str","String_Node_Str" + e);
        }
      }
      buildUi();
    }
  }
);
  iv.setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View v){
      if (task.id >= 0 && thumbs != null) {
        mAm.removeTask(task.id,ActivityManager.REMOVE_TASK_KILL_PROCESS);
        buildUi();
        return true;
      }
      return false;
    }
  }
);
}

Fixed version (ground truth):
private void addThumbnail(LinearLayout container,Bitmap bm,final ActivityManager.RecentTaskInfo task,final ActivityManager.TaskThumbnail thumbs){
  ImageView iv=new ImageView(this);
  if (bm != null) {
    iv.setImageBitmap(bm);
  }
  iv.setBackgroundResource(android.R.drawable.gallery_thumb);
  int w=getResources().getDimensionPixelSize(android.R.dimen.thumbnail_width);
  int h=getResources().getDimensionPixelSize(android.R.dimen.thumbnail_height);
  container.addView(iv,new LinearLayout.LayoutParams(w,h));
  iv.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (task.id >= 0 && thumbs != null) {
        mAm.moveTaskToFront(task.id,ActivityManager.MOVE_TASK_WITH_HOME);
      }
 else {
        try {
          startActivity(task.baseIntent);
        }
 catch (        ActivityNotFoundException e) {
          Log.w("String_Node_Str","String_Node_Str" + e);
        }
      }
      buildUi();
    }
  }
);
  iv.setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View v){
      if (task.id >= 0 && thumbs != null) {
        mAm.removeTask(task.id);
        buildUi();
        return true;
      }
      return false;
    }
  }
);
}
Program: 196131
Project: 196131
Buggy source:
/** 
 * Given the state of the keyguard, is the input restricted? Input is restricted when the keyguard is showing, or when the keyguard was suppressed by an app that disabled the keyguard or we haven't been provisioned yet.
 */
public boolean isInputRestricted(){
  return mShowing || mNeedToReshowWhenReenabled || !mUpdateMonitor.isDeviceProvisioned();
}

Fixed version (ground truth):
/** 
 * Given the state of the keyguard, is the input restricted? Input is restricted when the keyguard is showing, or when the keyguard was suppressed by an app that disabled the keyguard or we haven't been provisioned yet.
 */
public boolean isInputRestricted(){
  return mShowing || mNeedToReshowWhenReenabled || shouldWaitForProvisioning();
}
Program: 196132
Project: 196132
Buggy source:
@Override public void onSimStateChanged(IccCardConstants.State simState){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + simState);
switch (simState) {
case NOT_READY:
case ABSENT:
synchronized (this) {
      if (!mUpdateMonitor.isDeviceProvisioned()) {
        if (!isShowing()) {
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          doKeyguardLocked(null);
        }
 else {
          resetStateLocked();
        }
      }
    }
  break;
case PIN_REQUIRED:
case PUK_REQUIRED:
synchronized (this) {
  if (!isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    doKeyguardLocked(null);
  }
 else {
    resetStateLocked();
  }
}
break;
case PERM_DISABLED:
synchronized (this) {
if (!isShowing()) {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
doKeyguardLocked(null);
}
 else {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
resetStateLocked();
}
}
break;
case READY:
synchronized (this) {
if (isShowing()) {
resetStateLocked();
}
}
break;
}
}

Fixed version (ground truth):
@Override public void onSimStateChanged(IccCardConstants.State simState){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + simState);
switch (simState) {
case NOT_READY:
case ABSENT:
synchronized (this) {
      if (shouldWaitForProvisioning()) {
        if (!isShowing()) {
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          doKeyguardLocked(null);
        }
 else {
          resetStateLocked();
        }
      }
    }
  break;
case PIN_REQUIRED:
case PUK_REQUIRED:
synchronized (this) {
  if (!isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    doKeyguardLocked(null);
  }
 else {
    resetStateLocked();
  }
}
break;
case PERM_DISABLED:
synchronized (this) {
if (!isShowing()) {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
doKeyguardLocked(null);
}
 else {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
resetStateLocked();
}
}
break;
case READY:
synchronized (this) {
if (isShowing()) {
resetStateLocked();
}
}
break;
}
}
Program: 196133
Project: 196133
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(IKeyguardExitCallback callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExitSecureCallback != null) {
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(IKeyguardExitCallback callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (shouldWaitForProvisioning()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExitSecureCallback != null) {
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 196134
Project: 196134
Buggy source:
/** 
 * Enable the keyguard if the settings are appropriate.
 */
private void doKeyguardLocked(Bundle options){
  if (!mExternallyEnabled) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mStatusBarKeyguardViewManager.isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  final boolean requireSim=!SystemProperties.getBoolean("String_Node_Str",false);
  final boolean provisioned=mUpdateMonitor.isDeviceProvisioned();
  final IccCardConstants.State state=mUpdateMonitor.getSimState();
  final boolean lockedOrMissing=state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim);
  if (!lockedOrMissing && !provisioned) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mLockPatternUtils.checkVoldPassword()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mShowing=false;
    hideLocked();
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  showLocked(options);
}

Fixed version (ground truth):
/** 
 * Enable the keyguard if the settings are appropriate.
 */
private void doKeyguardLocked(Bundle options){
  if (!mExternallyEnabled) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mStatusBarKeyguardViewManager.isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  final boolean requireSim=!SystemProperties.getBoolean("String_Node_Str",false);
  final IccCardConstants.State state=mUpdateMonitor.getSimState();
  final boolean lockedOrMissing=state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim);
  if (!lockedOrMissing && shouldWaitForProvisioning()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mLockPatternUtils.checkVoldPassword()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mShowing=false;
    hideLocked();
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  showLocked(options);
}
Program: 196136
Project: 196136
Buggy source:
/** 
 * Given the state of the keyguard, is the input restricted? Input is restricted when the keyguard is showing, or when the keyguard was suppressed by an app that disabled the keyguard or we haven't been provisioned yet.
 */
public boolean isInputRestricted(){
  return mShowing || mNeedToReshowWhenReenabled || !mUpdateMonitor.isDeviceProvisioned();
}

Fixed version (ground truth):
/** 
 * Given the state of the keyguard, is the input restricted? Input is restricted when the keyguard is showing, or when the keyguard was suppressed by an app that disabled the keyguard or we haven't been provisioned yet.
 */
public boolean isInputRestricted(){
  return mShowing || mNeedToReshowWhenReenabled || shouldWaitForProvisioning();
}
Program: 196137
Project: 196137
Buggy source:
@Override public void onSimStateChanged(IccCardConstants.State simState){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + simState);
switch (simState) {
case NOT_READY:
case ABSENT:
synchronized (this) {
      if (!mUpdateMonitor.isDeviceProvisioned()) {
        if (!isShowing()) {
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          doKeyguardLocked(null);
        }
 else {
          resetStateLocked();
        }
      }
    }
  break;
case PIN_REQUIRED:
case PUK_REQUIRED:
synchronized (this) {
  if (!isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    doKeyguardLocked(null);
  }
 else {
    resetStateLocked();
  }
}
break;
case PERM_DISABLED:
synchronized (this) {
if (!isShowing()) {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
doKeyguardLocked(null);
}
 else {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
resetStateLocked();
}
}
break;
case READY:
synchronized (this) {
if (isShowing()) {
resetStateLocked();
}
}
break;
}
}

Fixed version (ground truth):
@Override public void onSimStateChanged(IccCardConstants.State simState){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + simState);
switch (simState) {
case NOT_READY:
case ABSENT:
synchronized (this) {
      if (shouldWaitForProvisioning()) {
        if (!isShowing()) {
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          doKeyguardLocked(null);
        }
 else {
          resetStateLocked();
        }
      }
    }
  break;
case PIN_REQUIRED:
case PUK_REQUIRED:
synchronized (this) {
  if (!isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    doKeyguardLocked(null);
  }
 else {
    resetStateLocked();
  }
}
break;
case PERM_DISABLED:
synchronized (this) {
if (!isShowing()) {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
doKeyguardLocked(null);
}
 else {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
resetStateLocked();
}
}
break;
case READY:
synchronized (this) {
if (isShowing()) {
resetStateLocked();
}
}
break;
}
}
Program: 196138
Project: 196138
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(IKeyguardExitCallback callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExitSecureCallback != null) {
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(IKeyguardExitCallback callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (shouldWaitForProvisioning()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExitSecureCallback != null) {
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 196139
Project: 196139
Buggy source:
/** 
 * Enable the keyguard if the settings are appropriate.
 */
private void doKeyguardLocked(Bundle options){
  if (!mExternallyEnabled) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mStatusBarKeyguardViewManager.isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  final boolean requireSim=!SystemProperties.getBoolean("String_Node_Str",false);
  final boolean provisioned=mUpdateMonitor.isDeviceProvisioned();
  final IccCardConstants.State state=mUpdateMonitor.getSimState();
  final boolean lockedOrMissing=state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim);
  if (!lockedOrMissing && !provisioned) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mLockPatternUtils.checkVoldPassword()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mShowing=false;
    hideLocked();
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  showLocked(options);
}

Fixed version (ground truth):
/** 
 * Enable the keyguard if the settings are appropriate.
 */
private void doKeyguardLocked(Bundle options){
  if (!mExternallyEnabled) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mStatusBarKeyguardViewManager.isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  final boolean requireSim=!SystemProperties.getBoolean("String_Node_Str",false);
  final IccCardConstants.State state=mUpdateMonitor.getSimState();
  final boolean lockedOrMissing=state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim);
  if (!lockedOrMissing && shouldWaitForProvisioning()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mLockPatternUtils.checkVoldPassword()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mShowing=false;
    hideLocked();
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  showLocked(options);
}
Program: 196141
Project: 196141
Buggy source:
/** 
 * Given the state of the keyguard, is the input restricted? Input is restricted when the keyguard is showing, or when the keyguard was suppressed by an app that disabled the keyguard or we haven't been provisioned yet.
 */
public boolean isInputRestricted(){
  return mShowing || mNeedToReshowWhenReenabled || !mUpdateMonitor.isDeviceProvisioned();
}

Fixed version (ground truth):
/** 
 * Given the state of the keyguard, is the input restricted? Input is restricted when the keyguard is showing, or when the keyguard was suppressed by an app that disabled the keyguard or we haven't been provisioned yet.
 */
public boolean isInputRestricted(){
  return mShowing || mNeedToReshowWhenReenabled || shouldWaitForProvisioning();
}
Program: 196142
Project: 196142
Buggy source:
@Override public void onSimStateChanged(IccCardConstants.State simState){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + simState);
switch (simState) {
case NOT_READY:
case ABSENT:
synchronized (this) {
      if (!mUpdateMonitor.isDeviceProvisioned()) {
        if (!isShowing()) {
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          doKeyguardLocked(null);
        }
 else {
          resetStateLocked();
        }
      }
    }
  break;
case PIN_REQUIRED:
case PUK_REQUIRED:
synchronized (this) {
  if (!isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    doKeyguardLocked(null);
  }
 else {
    resetStateLocked();
  }
}
break;
case PERM_DISABLED:
synchronized (this) {
if (!isShowing()) {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
doKeyguardLocked(null);
}
 else {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
resetStateLocked();
}
}
break;
case READY:
synchronized (this) {
if (isShowing()) {
resetStateLocked();
}
}
break;
}
}

Fixed version (ground truth):
@Override public void onSimStateChanged(IccCardConstants.State simState){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + simState);
switch (simState) {
case NOT_READY:
case ABSENT:
synchronized (this) {
      if (shouldWaitForProvisioning()) {
        if (!isShowing()) {
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          doKeyguardLocked(null);
        }
 else {
          resetStateLocked();
        }
      }
    }
  break;
case PIN_REQUIRED:
case PUK_REQUIRED:
synchronized (this) {
  if (!isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    doKeyguardLocked(null);
  }
 else {
    resetStateLocked();
  }
}
break;
case PERM_DISABLED:
synchronized (this) {
if (!isShowing()) {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
doKeyguardLocked(null);
}
 else {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
resetStateLocked();
}
}
break;
case READY:
synchronized (this) {
if (isShowing()) {
resetStateLocked();
}
}
break;
}
}
Program: 196143
Project: 196143
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(IKeyguardExitCallback callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExitSecureCallback != null) {
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(IKeyguardExitCallback callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (shouldWaitForProvisioning()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExitSecureCallback != null) {
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 196144
Project: 196144
Buggy source:
/** 
 * Enable the keyguard if the settings are appropriate.
 */
private void doKeyguardLocked(Bundle options){
  if (!mExternallyEnabled) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mStatusBarKeyguardViewManager.isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  final boolean requireSim=!SystemProperties.getBoolean("String_Node_Str",false);
  final boolean provisioned=mUpdateMonitor.isDeviceProvisioned();
  final IccCardConstants.State state=mUpdateMonitor.getSimState();
  final boolean lockedOrMissing=state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim);
  if (!lockedOrMissing && !provisioned) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mLockPatternUtils.checkVoldPassword()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mShowing=false;
    hideLocked();
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  showLocked(options);
}

Fixed version (ground truth):
/** 
 * Enable the keyguard if the settings are appropriate.
 */
private void doKeyguardLocked(Bundle options){
  if (!mExternallyEnabled) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mStatusBarKeyguardViewManager.isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  final boolean requireSim=!SystemProperties.getBoolean("String_Node_Str",false);
  final IccCardConstants.State state=mUpdateMonitor.getSimState();
  final boolean lockedOrMissing=state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim);
  if (!lockedOrMissing && shouldWaitForProvisioning()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mLockPatternUtils.checkVoldPassword()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mShowing=false;
    hideLocked();
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  showLocked(options);
}
Program: 196146
Project: 196146
Buggy source:
/** 
 * Given the state of the keyguard, is the input restricted? Input is restricted when the keyguard is showing, or when the keyguard was suppressed by an app that disabled the keyguard or we haven't been provisioned yet.
 */
public boolean isInputRestricted(){
  return mShowing || mNeedToReshowWhenReenabled || !mUpdateMonitor.isDeviceProvisioned();
}

Fixed version (ground truth):
/** 
 * Given the state of the keyguard, is the input restricted? Input is restricted when the keyguard is showing, or when the keyguard was suppressed by an app that disabled the keyguard or we haven't been provisioned yet.
 */
public boolean isInputRestricted(){
  return mShowing || mNeedToReshowWhenReenabled || shouldWaitForProvisioning();
}
Program: 196147
Project: 196147
Buggy source:
@Override public void onSimStateChanged(IccCardConstants.State simState){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + simState);
switch (simState) {
case NOT_READY:
case ABSENT:
synchronized (this) {
      if (!mUpdateMonitor.isDeviceProvisioned()) {
        if (!isShowing()) {
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          doKeyguardLocked(null);
        }
 else {
          resetStateLocked();
        }
      }
    }
  break;
case PIN_REQUIRED:
case PUK_REQUIRED:
synchronized (this) {
  if (!isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    doKeyguardLocked(null);
  }
 else {
    resetStateLocked();
  }
}
break;
case PERM_DISABLED:
synchronized (this) {
if (!isShowing()) {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
doKeyguardLocked(null);
}
 else {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
resetStateLocked();
}
}
break;
case READY:
synchronized (this) {
if (isShowing()) {
resetStateLocked();
}
}
break;
}
}

Fixed version (ground truth):
@Override public void onSimStateChanged(IccCardConstants.State simState){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + simState);
switch (simState) {
case NOT_READY:
case ABSENT:
synchronized (this) {
      if (shouldWaitForProvisioning()) {
        if (!isShowing()) {
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          doKeyguardLocked(null);
        }
 else {
          resetStateLocked();
        }
      }
    }
  break;
case PIN_REQUIRED:
case PUK_REQUIRED:
synchronized (this) {
  if (!isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    doKeyguardLocked(null);
  }
 else {
    resetStateLocked();
  }
}
break;
case PERM_DISABLED:
synchronized (this) {
if (!isShowing()) {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
doKeyguardLocked(null);
}
 else {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
resetStateLocked();
}
}
break;
case READY:
synchronized (this) {
if (isShowing()) {
resetStateLocked();
}
}
break;
}
}
Program: 196148
Project: 196148
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(IKeyguardExitCallback callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExitSecureCallback != null) {
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(IKeyguardExitCallback callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (shouldWaitForProvisioning()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExitSecureCallback != null) {
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 196149
Project: 196149
Buggy source:
/** 
 * Enable the keyguard if the settings are appropriate.
 */
private void doKeyguardLocked(Bundle options){
  if (!mExternallyEnabled) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mStatusBarKeyguardViewManager.isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  final boolean requireSim=!SystemProperties.getBoolean("String_Node_Str",false);
  final boolean provisioned=mUpdateMonitor.isDeviceProvisioned();
  final IccCardConstants.State state=mUpdateMonitor.getSimState();
  final boolean lockedOrMissing=state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim);
  if (!lockedOrMissing && !provisioned) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mLockPatternUtils.checkVoldPassword()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mShowing=false;
    hideLocked();
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  showLocked(options);
}

Fixed version (ground truth):
/** 
 * Enable the keyguard if the settings are appropriate.
 */
private void doKeyguardLocked(Bundle options){
  if (!mExternallyEnabled) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mStatusBarKeyguardViewManager.isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  final boolean requireSim=!SystemProperties.getBoolean("String_Node_Str",false);
  final IccCardConstants.State state=mUpdateMonitor.getSimState();
  final boolean lockedOrMissing=state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim);
  if (!lockedOrMissing && shouldWaitForProvisioning()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mLockPatternUtils.checkVoldPassword()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mShowing=false;
    hideLocked();
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  showLocked(options);
}
Program: 196153
Project: 196153
Buggy source:
private View updateColorViewInt(View view,int sysUiVis,int systemUiHideFlag,int translucentFlag,int color,int height,int verticalGravity,String transitionName,int id,boolean hiddenByWindowFlag){
  boolean show=height > 0 && (sysUiVis & systemUiHideFlag) == 0 && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
  if (view == null) {
    if (show) {
      view=new View(mContext);
      view.setBackgroundColor(color);
      view.setTransitionName(transitionName);
      view.setId(id);
      addView(view,new LayoutParams(LayoutParams.MATCH_PARENT,height,Gravity.START | verticalGravity));
    }
  }
 else {
    int vis=show ? VISIBLE : INVISIBLE;
    view.setVisibility(vis);
    if (show) {
      LayoutParams lp=(LayoutParams)view.getLayoutParams();
      if (lp.height != height) {
        lp.height=height;
        view.setLayoutParams(lp);
      }
      view.setBackgroundColor(color);
    }
  }
  return view;
}

Fixed version (ground truth):
private View updateColorViewInt(View view,int sysUiVis,int systemUiHideFlag,int translucentFlag,int color,int height,int verticalGravity,String transitionName,int id,boolean hiddenByWindowFlag){
  boolean show=height > 0 && (sysUiVis & systemUiHideFlag) == 0 && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
  if (view == null) {
    if (show) {
      view=new View(mContext);
      view.setBackgroundColor(color);
      view.setTransitionName(transitionName);
      view.setId(id);
      addView(view,new LayoutParams(LayoutParams.MATCH_PARENT,height,Gravity.START | verticalGravity));
      updateColorViewTranslations();
    }
  }
 else {
    int vis=show ? VISIBLE : INVISIBLE;
    view.setVisibility(vis);
    if (show) {
      LayoutParams lp=(LayoutParams)view.getLayoutParams();
      if (lp.height != height) {
        lp.height=height;
        view.setLayoutParams(lp);
      }
      view.setBackgroundColor(color);
    }
  }
  return view;
}
Program: 196156
Project: 196156
Buggy source:
private View updateColorViewInt(View view,int sysUiVis,int systemUiHideFlag,int translucentFlag,int color,int height,int verticalGravity,String transitionName,int id,boolean hiddenByWindowFlag){
  boolean show=height > 0 && (sysUiVis & systemUiHideFlag) == 0 && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
  if (view == null) {
    if (show) {
      view=new View(mContext);
      view.setBackgroundColor(color);
      view.setTransitionName(transitionName);
      view.setId(id);
      addView(view,new LayoutParams(LayoutParams.MATCH_PARENT,height,Gravity.START | verticalGravity));
    }
  }
 else {
    int vis=show ? VISIBLE : INVISIBLE;
    view.setVisibility(vis);
    if (show) {
      LayoutParams lp=(LayoutParams)view.getLayoutParams();
      if (lp.height != height) {
        lp.height=height;
        view.setLayoutParams(lp);
      }
      view.setBackgroundColor(color);
    }
  }
  return view;
}

Fixed version (ground truth):
private View updateColorViewInt(View view,int sysUiVis,int systemUiHideFlag,int translucentFlag,int color,int height,int verticalGravity,String transitionName,int id,boolean hiddenByWindowFlag){
  boolean show=height > 0 && (sysUiVis & systemUiHideFlag) == 0 && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
  if (view == null) {
    if (show) {
      view=new View(mContext);
      view.setBackgroundColor(color);
      view.setTransitionName(transitionName);
      view.setId(id);
      addView(view,new LayoutParams(LayoutParams.MATCH_PARENT,height,Gravity.START | verticalGravity));
      updateColorViewTranslations();
    }
  }
 else {
    int vis=show ? VISIBLE : INVISIBLE;
    view.setVisibility(vis);
    if (show) {
      LayoutParams lp=(LayoutParams)view.getLayoutParams();
      if (lp.height != height) {
        lp.height=height;
        view.setLayoutParams(lp);
      }
      view.setBackgroundColor(color);
    }
  }
  return view;
}
Program: 196159
Project: 196159
Buggy source:
private View updateColorViewInt(View view,int sysUiVis,int systemUiHideFlag,int translucentFlag,int color,int height,int verticalGravity,String transitionName,int id,boolean hiddenByWindowFlag){
  boolean show=height > 0 && (sysUiVis & systemUiHideFlag) == 0 && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
  if (view == null) {
    if (show) {
      view=new View(mContext);
      view.setBackgroundColor(color);
      view.setTransitionName(transitionName);
      view.setId(id);
      addView(view,new LayoutParams(LayoutParams.MATCH_PARENT,height,Gravity.START | verticalGravity));
    }
  }
 else {
    int vis=show ? VISIBLE : INVISIBLE;
    view.setVisibility(vis);
    if (show) {
      LayoutParams lp=(LayoutParams)view.getLayoutParams();
      if (lp.height != height) {
        lp.height=height;
        view.setLayoutParams(lp);
      }
      view.setBackgroundColor(color);
    }
  }
  return view;
}

Fixed version (ground truth):
private View updateColorViewInt(View view,int sysUiVis,int systemUiHideFlag,int translucentFlag,int color,int height,int verticalGravity,String transitionName,int id,boolean hiddenByWindowFlag){
  boolean show=height > 0 && (sysUiVis & systemUiHideFlag) == 0 && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
  if (view == null) {
    if (show) {
      view=new View(mContext);
      view.setBackgroundColor(color);
      view.setTransitionName(transitionName);
      view.setId(id);
      addView(view,new LayoutParams(LayoutParams.MATCH_PARENT,height,Gravity.START | verticalGravity));
      updateColorViewTranslations();
    }
  }
 else {
    int vis=show ? VISIBLE : INVISIBLE;
    view.setVisibility(vis);
    if (show) {
      LayoutParams lp=(LayoutParams)view.getLayoutParams();
      if (lp.height != height) {
        lp.height=height;
        view.setLayoutParams(lp);
      }
      view.setBackgroundColor(color);
    }
  }
  return view;
}
Program: 196162
Project: 196162
Buggy source:
private View updateColorViewInt(View view,int sysUiVis,int systemUiHideFlag,int translucentFlag,int color,int height,int verticalGravity,String transitionName,int id,boolean hiddenByWindowFlag){
  boolean show=height > 0 && (sysUiVis & systemUiHideFlag) == 0 && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
  if (view == null) {
    if (show) {
      view=new View(mContext);
      view.setBackgroundColor(color);
      view.setTransitionName(transitionName);
      view.setId(id);
      addView(view,new LayoutParams(LayoutParams.MATCH_PARENT,height,Gravity.START | verticalGravity));
    }
  }
 else {
    int vis=show ? VISIBLE : INVISIBLE;
    view.setVisibility(vis);
    if (show) {
      LayoutParams lp=(LayoutParams)view.getLayoutParams();
      if (lp.height != height) {
        lp.height=height;
        view.setLayoutParams(lp);
      }
      view.setBackgroundColor(color);
    }
  }
  return view;
}

Fixed version (ground truth):
private View updateColorViewInt(View view,int sysUiVis,int systemUiHideFlag,int translucentFlag,int color,int height,int verticalGravity,String transitionName,int id,boolean hiddenByWindowFlag){
  boolean show=height > 0 && (sysUiVis & systemUiHideFlag) == 0 && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
  if (view == null) {
    if (show) {
      view=new View(mContext);
      view.setBackgroundColor(color);
      view.setTransitionName(transitionName);
      view.setId(id);
      addView(view,new LayoutParams(LayoutParams.MATCH_PARENT,height,Gravity.START | verticalGravity));
      updateColorViewTranslations();
    }
  }
 else {
    int vis=show ? VISIBLE : INVISIBLE;
    view.setVisibility(vis);
    if (show) {
      LayoutParams lp=(LayoutParams)view.getLayoutParams();
      if (lp.height != height) {
        lp.height=height;
        view.setLayoutParams(lp);
      }
      view.setBackgroundColor(color);
    }
  }
  return view;
}
Program: 196163
Project: 196163
Buggy source:
/** 
 * Given the state of the keyguard, is the input restricted? Input is restricted when the keyguard is showing, or when the keyguard was suppressed by an app that disabled the keyguard or we haven't been provisioned yet.
 */
public boolean isInputRestricted(){
  return mShowing || mNeedToReshowWhenReenabled || !mUpdateMonitor.isDeviceProvisioned();
}

Fixed version (ground truth):
/** 
 * Given the state of the keyguard, is the input restricted? Input is restricted when the keyguard is showing, or when the keyguard was suppressed by an app that disabled the keyguard or we haven't been provisioned yet.
 */
public boolean isInputRestricted(){
  return mShowing || mNeedToReshowWhenReenabled || shouldWaitForProvisioning();
}
Program: 196164
Project: 196164
Buggy source:
@Override public void onSimStateChanged(IccCardConstants.State simState){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + simState);
switch (simState) {
case NOT_READY:
case ABSENT:
synchronized (this) {
      if (!mUpdateMonitor.isDeviceProvisioned()) {
        if (!isShowing()) {
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          doKeyguardLocked(null);
        }
 else {
          resetStateLocked();
        }
      }
    }
  break;
case PIN_REQUIRED:
case PUK_REQUIRED:
synchronized (this) {
  if (!isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    doKeyguardLocked(null);
  }
 else {
    resetStateLocked();
  }
}
break;
case PERM_DISABLED:
synchronized (this) {
if (!isShowing()) {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
doKeyguardLocked(null);
}
 else {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
resetStateLocked();
}
}
break;
case READY:
synchronized (this) {
if (isShowing()) {
resetStateLocked();
}
}
break;
}
}

Fixed version (ground truth):
@Override public void onSimStateChanged(IccCardConstants.State simState){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + simState);
switch (simState) {
case NOT_READY:
case ABSENT:
synchronized (this) {
      if (shouldWaitForProvisioning()) {
        if (!isShowing()) {
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          doKeyguardLocked(null);
        }
 else {
          resetStateLocked();
        }
      }
    }
  break;
case PIN_REQUIRED:
case PUK_REQUIRED:
synchronized (this) {
  if (!isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    doKeyguardLocked(null);
  }
 else {
    resetStateLocked();
  }
}
break;
case PERM_DISABLED:
synchronized (this) {
if (!isShowing()) {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
doKeyguardLocked(null);
}
 else {
if (DEBUG) Log.d(TAG,"String_Node_Str" + "String_Node_Str");
resetStateLocked();
}
}
break;
case READY:
synchronized (this) {
if (isShowing()) {
resetStateLocked();
}
}
break;
}
}