nus-yam/ex-repair huggingface dataset:
Program: 194214
Project: 194214
Buggy source:
@Override public int getCount(){
  boolean secureKeyguardShowing=mController.mKeyguardMonitor.isShowing() && mController.mKeyguardMonitor.isSecure() && !mController.mKeyguardMonitor.isTrusted();
  if (!secureKeyguardShowing) {
    return mController.mUsers.size();
  }
  final int N=mController.mUsers.size();
  int count=0;
  for (int i=0; i < N; i++) {
    if (mController.mUsers.get(i).isRestricted) {
      break;
    }
 else {
      count++;
    }
  }
  return count;
}

Fixed version (ground truth):
@Override public int getCount(){
  boolean secureKeyguardShowing=mController.mKeyguardMonitor.isShowing() && mController.mKeyguardMonitor.isSecure() && !mController.mKeyguardMonitor.canSkipBouncer();
  if (!secureKeyguardShowing) {
    return mController.mUsers.size();
  }
  final int N=mController.mUsers.size();
  int count=0;
  for (int i=0; i < N; i++) {
    if (mController.mUsers.get(i).isRestricted) {
      break;
    }
 else {
      count++;
    }
  }
  return count;
}
Program: 194215
Project: 194215
Buggy source:
private RemoteViews generateActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new RemoteViews(mContext.getPackageName(),tombstone ? getActionTombstoneLayoutResource() : getActionLayoutResource());
  button.setTextViewCompoundDrawablesRelative(R.id.action0,action.icon,0,0,0);
  button.setTextViewText(R.id.action0,processLegacyText(action.title));
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  processLegacyAction(action,button);
  return button;
}

Fixed version (ground truth):
private RemoteViews generateActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new BuilderRemoteViews(mContext.getApplicationInfo(),tombstone ? getActionTombstoneLayoutResource() : getActionLayoutResource());
  button.setTextViewCompoundDrawablesRelative(R.id.action0,action.icon,0,0,0);
  button.setTextViewText(R.id.action0,processLegacyText(action.title));
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  processLegacyAction(action,button);
  return button;
}
Program: 194216
Project: 194216
Buggy source:
private RemoteViews generateMediaActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new RemoteViews(mBuilder.mContext.getPackageName(),R.layout.notification_material_media_action);
  button.setImageViewResource(R.id.action0,action.icon);
  button.setDrawableParameters(R.id.action0,false,-1,0xFFFFFFFF,PorterDuff.Mode.SRC_ATOP,-1);
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  return button;
}

Fixed version (ground truth):
private RemoteViews generateMediaActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new BuilderRemoteViews(mBuilder.mContext.getApplicationInfo(),R.layout.notification_material_media_action);
  button.setImageViewResource(R.id.action0,action.icon);
  button.setDrawableParameters(R.id.action0,false,-1,0xFFFFFFFF,PorterDuff.Mode.SRC_ATOP,-1);
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  return button;
}
Program: 194217
Project: 194217
Buggy source:
/** 
 * Shows the next security screen if there is one.
 * @param authenticated true if the user entered the correct authentication
 * @return true if keyguard is done
 */
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (mUpdateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser())) {
    finish=true;
  }
 else   if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None || !mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}

Fixed version (ground truth):
/** 
 * Shows the next security screen if there is one.
 * @param authenticated true if the user entered the correct authentication
 * @return true if keyguard is done
 */
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (mUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser())) {
    finish=true;
  }
 else   if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None || !mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}
Program: 194218
Project: 194218
Buggy source:
public boolean getUserHasTrust(int userId){
  return !isTrustDisabled(userId) && mUserHasTrust.get(userId) || mUserFingerprintAuthenticated.get(userId);
}

Fixed version (ground truth):
public boolean getUserHasTrust(int userId){
  return !isTrustDisabled(userId) && mUserHasTrust.get(userId);
}
Program: 194219
Project: 194219
Buggy source:
@Override protected void handleUpdateState(BooleanState state,Object arg){
  state.visible=!(mKeyguard.isSecure() && mKeyguard.isShowing() && !mKeyguard.isTrusted());
  state.label=mContext.getString(R.string.quick_settings_cast_title);
  state.value=false;
  state.autoMirrorDrawable=false;
  final Set<CastDevice> devices=mController.getCastDevices();
  boolean connecting=false;
  for (  CastDevice device : devices) {
    if (device.state == CastDevice.STATE_CONNECTED) {
      state.value=true;
      state.label=getDeviceName(device);
    }
 else     if (device.state == CastDevice.STATE_CONNECTING) {
      connecting=true;
    }
  }
  if (!state.value && connecting) {
    state.label=mContext.getString(R.string.quick_settings_connecting);
  }
  state.icon=ResourceIcon.get(state.value ? R.drawable.ic_qs_cast_on : R.drawable.ic_qs_cast_off);
  mDetailAdapter.updateItems(devices);
}

Fixed version (ground truth):
@Override protected void handleUpdateState(BooleanState state,Object arg){
  state.visible=!mKeyguard.isSecure() || !mKeyguard.isShowing() || mKeyguard.canSkipBouncer();
  state.label=mContext.getString(R.string.quick_settings_cast_title);
  state.value=false;
  state.autoMirrorDrawable=false;
  final Set<CastDevice> devices=mController.getCastDevices();
  boolean connecting=false;
  for (  CastDevice device : devices) {
    if (device.state == CastDevice.STATE_CONNECTED) {
      state.value=true;
      state.label=getDeviceName(device);
    }
 else     if (device.state == CastDevice.STATE_CONNECTING) {
      connecting=true;
    }
  }
  if (!state.value && connecting) {
    state.label=mContext.getString(R.string.quick_settings_connecting);
  }
  state.icon=ResourceIcon.get(state.value ? R.drawable.ic_qs_cast_on : R.drawable.ic_qs_cast_off);
  mDetailAdapter.updateItems(devices);
}
Program: 194220
Project: 194220
Buggy source:
private Intent getCameraIntent(){
  KeyguardUpdateMonitor updateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  boolean currentUserHasTrust=updateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser());
  boolean secure=mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
  return (secure && !currentUserHasTrust) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
}

Fixed version (ground truth):
private Intent getCameraIntent(){
  KeyguardUpdateMonitor updateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  boolean canSkipBouncer=updateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser());
  boolean secure=mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
  return (secure && !canSkipBouncer) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
}
Program: 194221
Project: 194221
Buggy source:
private int getAnimationResForTransition(int oldState,int newState,boolean oldScreenOn,boolean screenOn){
  if (oldState == STATE_FINGERPRINT && newState == STATE_FINGERPRINT_ERROR) {
    return R.drawable.lockscreen_fingerprint_fp_to_error_state_animation;
  }
 else   if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
    return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
  }
 else   if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN && !mUnlockMethodCache.isCurrentlyInsecure()) {
    return R.drawable.lockscreen_fingerprint_draw_off_animation;
  }
 else   if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
    return R.drawable.lockscreen_fingerprint_draw_on_animation;
  }
 else {
    return -1;
  }
}

Fixed version (ground truth):
private int getAnimationResForTransition(int oldState,int newState,boolean oldScreenOn,boolean screenOn){
  if (oldState == STATE_FINGERPRINT && newState == STATE_FINGERPRINT_ERROR) {
    return R.drawable.lockscreen_fingerprint_fp_to_error_state_animation;
  }
 else   if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
    return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
  }
 else   if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN && !mUnlockMethodCache.isTrusted()) {
    return R.drawable.lockscreen_fingerprint_draw_off_animation;
  }
 else   if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
    return R.drawable.lockscreen_fingerprint_draw_on_animation;
  }
 else {
    return -1;
  }
}
Program: 194222
Project: 194222
Buggy source:
private int getState(){
  boolean fingerprintRunning=KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
  if (mUnlockMethodCache.isCurrentlyInsecure()) {
    return STATE_LOCK_OPEN;
  }
 else   if (mTransientFpError) {
    return STATE_FINGERPRINT_ERROR;
  }
 else   if (fingerprintRunning) {
    return STATE_FINGERPRINT;
  }
 else   if (mUnlockMethodCache.isFaceUnlockRunning()) {
    return STATE_FACE_UNLOCK;
  }
 else {
    return STATE_LOCKED;
  }
}

Fixed version (ground truth):
private int getState(){
  boolean fingerprintRunning=KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
  if (mUnlockMethodCache.canSkipBouncer()) {
    return STATE_LOCK_OPEN;
  }
 else   if (mTransientFpError) {
    return STATE_FINGERPRINT_ERROR;
  }
 else   if (fingerprintRunning) {
    return STATE_FINGERPRINT;
  }
 else   if (mUnlockMethodCache.isFaceUnlockRunning()) {
    return STATE_FACE_UNLOCK;
  }
 else {
    return STATE_LOCKED;
  }
}
Program: 194223
Project: 194223
Buggy source:
public void onTrackingStopped(boolean expand){
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    if (!expand && !mUnlockMethodCache.isCurrentlyInsecure()) {
      showBouncer();
    }
  }
}

Fixed version (ground truth):
public void onTrackingStopped(boolean expand){
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    if (!expand && !mUnlockMethodCache.canSkipBouncer()) {
      showBouncer();
    }
  }
}
Program: 194224
Project: 194224
Buggy source:
private void logStateToEventlog(){
  boolean isShowing=mStatusBarKeyguardViewManager.isShowing();
  boolean isOccluded=mStatusBarKeyguardViewManager.isOccluded();
  boolean isBouncerShowing=mStatusBarKeyguardViewManager.isBouncerShowing();
  boolean isSecure=mUnlockMethodCache.isMethodSecure();
  boolean isCurrentlyInsecure=mUnlockMethodCache.isCurrentlyInsecure();
  int stateFingerprint=getLoggingFingerprint(mState,isShowing,isOccluded,isBouncerShowing,isSecure,isCurrentlyInsecure);
  if (stateFingerprint != mLastLoggedStateFingerprint) {
    EventLogTags.writeSysuiStatusBarState(mState,isShowing ? 1 : 0,isOccluded ? 1 : 0,isBouncerShowing ? 1 : 0,isSecure ? 1 : 0,isCurrentlyInsecure ? 1 : 0);
    mLastLoggedStateFingerprint=stateFingerprint;
  }
}

Fixed version (ground truth):
private void logStateToEventlog(){
  boolean isShowing=mStatusBarKeyguardViewManager.isShowing();
  boolean isOccluded=mStatusBarKeyguardViewManager.isOccluded();
  boolean isBouncerShowing=mStatusBarKeyguardViewManager.isBouncerShowing();
  boolean isSecure=mUnlockMethodCache.isMethodSecure();
  boolean canSkipBouncer=mUnlockMethodCache.canSkipBouncer();
  int stateFingerprint=getLoggingFingerprint(mState,isShowing,isOccluded,isBouncerShowing,isSecure,canSkipBouncer);
  if (stateFingerprint != mLastLoggedStateFingerprint) {
    EventLogTags.writeSysuiStatusBarState(mState,isShowing ? 1 : 0,isOccluded ? 1 : 0,isBouncerShowing ? 1 : 0,isSecure ? 1 : 0,canSkipBouncer ? 1 : 0);
    mLastLoggedStateFingerprint=stateFingerprint;
  }
}
Program: 194225
Project: 194225
Buggy source:
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.isCurrentlyInsecure();
}

Fixed version (ground truth):
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.canSkipBouncer();
}
Program: 194226
Project: 194226
Buggy source:
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.isCurrentlyInsecure();
}

Fixed version (ground truth):
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.canSkipBouncer();
}
Program: 194227
Project: 194227
Buggy source:
private void update(boolean updateAlways){
  int user=KeyguardUpdateMonitor.getCurrentUser();
  boolean secure=mLockPatternUtils.isSecure(user);
  boolean currentlyInsecure=!secure || mKeyguardUpdateMonitor.getUserHasTrust(user);
  boolean trustManaged=mKeyguardUpdateMonitor.getUserTrustIsManaged(user);
  boolean faceUnlockRunning=mKeyguardUpdateMonitor.isFaceUnlockRunning(user) && trustManaged;
  boolean changed=secure != mSecure || currentlyInsecure != mCurrentlyInsecure || trustManaged != mTrustManaged || faceUnlockRunning != mFaceUnlockRunning;
  if (changed || updateAlways) {
    mSecure=secure;
    mCurrentlyInsecure=currentlyInsecure;
    mTrustManaged=trustManaged;
    mFaceUnlockRunning=faceUnlockRunning;
    notifyListeners();
  }
}

Fixed version (ground truth):
private void update(boolean updateAlways){
  int user=KeyguardUpdateMonitor.getCurrentUser();
  boolean secure=mLockPatternUtils.isSecure(user);
  boolean canSkipBouncer=!secure || mKeyguardUpdateMonitor.getUserCanSkipBouncer(user);
  boolean trustManaged=mKeyguardUpdateMonitor.getUserTrustIsManaged(user);
  boolean trusted=mKeyguardUpdateMonitor.getUserHasTrust(user);
  boolean faceUnlockRunning=mKeyguardUpdateMonitor.isFaceUnlockRunning(user) && trustManaged;
  boolean changed=secure != mSecure || canSkipBouncer != mCanSkipBouncer || trustManaged != mTrustManaged || faceUnlockRunning != mFaceUnlockRunning;
  if (changed || updateAlways) {
    mSecure=secure;
    mCanSkipBouncer=canSkipBouncer;
    mTrusted=trusted;
    mTrustManaged=trustManaged;
    mFaceUnlockRunning=faceUnlockRunning;
    notifyListeners();
  }
}
Program: 194228
Project: 194228
Buggy source:
public KeyguardMonitor(Context context){
  mContext=context;
  mKeyguardUpdateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  mUserTracker=new CurrentUserTracker(mContext){
    @Override public void onUserSwitched(    int newUserId){
      mCurrentUser=newUserId;
      updateTrustedState();
    }
  }
;
}

Fixed version (ground truth):
public KeyguardMonitor(Context context){
  mContext=context;
  mKeyguardUpdateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  mUserTracker=new CurrentUserTracker(mContext){
    @Override public void onUserSwitched(    int newUserId){
      mCurrentUser=newUserId;
      updateCanSkipBouncerState();
    }
  }
;
}
Program: 194229
Project: 194229
Buggy source:
@Override public void onTrustChanged(int userId){
  updateTrustedState();
  notifyKeyguardChanged();
}

Fixed version (ground truth):
@Override public void onTrustChanged(int userId){
  updateCanSkipBouncerState();
  notifyKeyguardChanged();
}
Program: 194230
Project: 194230
Buggy source:
@Override public void onUserSwitched(int newUserId){
  mCurrentUser=newUserId;
  updateTrustedState();
}

Fixed version (ground truth):
@Override public void onUserSwitched(int newUserId){
  mCurrentUser=newUserId;
  updateCanSkipBouncerState();
}
Program: 194231
Project: 194231
Buggy source:
public void addCallback(Callback callback){
  mCallbacks.add(callback);
  if (mCallbacks.size() != 0 && !mListening) {
    mListening=true;
    mCurrentUser=ActivityManager.getCurrentUser();
    updateTrustedState();
    mKeyguardUpdateMonitor.registerCallback(this);
    mUserTracker.startTracking();
  }
}

Fixed version (ground truth):
public void addCallback(Callback callback){
  mCallbacks.add(callback);
  if (mCallbacks.size() != 0 && !mListening) {
    mListening=true;
    mCurrentUser=ActivityManager.getCurrentUser();
    updateCanSkipBouncerState();
    mKeyguardUpdateMonitor.registerCallback(this);
    mUserTracker.startTracking();
  }
}
Program: 194232
Project: 194232
Buggy source:
@Override public int getCount(){
  boolean secureKeyguardShowing=mController.mKeyguardMonitor.isShowing() && mController.mKeyguardMonitor.isSecure() && !mController.mKeyguardMonitor.isTrusted();
  if (!secureKeyguardShowing) {
    return mController.mUsers.size();
  }
  final int N=mController.mUsers.size();
  int count=0;
  for (int i=0; i < N; i++) {
    if (mController.mUsers.get(i).isRestricted) {
      break;
    }
 else {
      count++;
    }
  }
  return count;
}

Fixed version (ground truth):
@Override public int getCount(){
  boolean secureKeyguardShowing=mController.mKeyguardMonitor.isShowing() && mController.mKeyguardMonitor.isSecure() && !mController.mKeyguardMonitor.canSkipBouncer();
  if (!secureKeyguardShowing) {
    return mController.mUsers.size();
  }
  final int N=mController.mUsers.size();
  int count=0;
  for (int i=0; i < N; i++) {
    if (mController.mUsers.get(i).isRestricted) {
      break;
    }
 else {
      count++;
    }
  }
  return count;
}
Program: 194233
Project: 194233
Buggy source:
private RemoteViews generateActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new RemoteViews(mContext.getPackageName(),tombstone ? getActionTombstoneLayoutResource() : getActionLayoutResource());
  button.setTextViewCompoundDrawablesRelative(R.id.action0,action.icon,0,0,0);
  button.setTextViewText(R.id.action0,processLegacyText(action.title));
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  processLegacyAction(action,button);
  return button;
}

Fixed version (ground truth):
private RemoteViews generateActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new BuilderRemoteViews(mContext.getApplicationInfo(),tombstone ? getActionTombstoneLayoutResource() : getActionLayoutResource());
  button.setTextViewCompoundDrawablesRelative(R.id.action0,action.icon,0,0,0);
  button.setTextViewText(R.id.action0,processLegacyText(action.title));
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  processLegacyAction(action,button);
  return button;
}
Program: 194234
Project: 194234
Buggy source:
private RemoteViews generateMediaActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new RemoteViews(mBuilder.mContext.getPackageName(),R.layout.notification_material_media_action);
  button.setImageViewResource(R.id.action0,action.icon);
  button.setDrawableParameters(R.id.action0,false,-1,0xFFFFFFFF,PorterDuff.Mode.SRC_ATOP,-1);
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  return button;
}

Fixed version (ground truth):
private RemoteViews generateMediaActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new BuilderRemoteViews(mBuilder.mContext.getApplicationInfo(),R.layout.notification_material_media_action);
  button.setImageViewResource(R.id.action0,action.icon);
  button.setDrawableParameters(R.id.action0,false,-1,0xFFFFFFFF,PorterDuff.Mode.SRC_ATOP,-1);
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  return button;
}
Program: 194235
Project: 194235
Buggy source:
/** 
 * Shows the next security screen if there is one.
 * @param authenticated true if the user entered the correct authentication
 * @return true if keyguard is done
 */
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (mUpdateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser())) {
    finish=true;
  }
 else   if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None || !mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}

Fixed version (ground truth):
/** 
 * Shows the next security screen if there is one.
 * @param authenticated true if the user entered the correct authentication
 * @return true if keyguard is done
 */
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (mUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser())) {
    finish=true;
  }
 else   if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None || !mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}
Program: 194236
Project: 194236
Buggy source:
public boolean getUserHasTrust(int userId){
  return !isTrustDisabled(userId) && mUserHasTrust.get(userId) || mUserFingerprintAuthenticated.get(userId);
}

Fixed version (ground truth):
public boolean getUserHasTrust(int userId){
  return !isTrustDisabled(userId) && mUserHasTrust.get(userId);
}
Program: 194237
Project: 194237
Buggy source:
@Override protected void handleUpdateState(BooleanState state,Object arg){
  state.visible=!(mKeyguard.isSecure() && mKeyguard.isShowing() && !mKeyguard.isTrusted());
  state.label=mContext.getString(R.string.quick_settings_cast_title);
  state.value=false;
  state.autoMirrorDrawable=false;
  final Set<CastDevice> devices=mController.getCastDevices();
  boolean connecting=false;
  for (  CastDevice device : devices) {
    if (device.state == CastDevice.STATE_CONNECTED) {
      state.value=true;
      state.label=getDeviceName(device);
    }
 else     if (device.state == CastDevice.STATE_CONNECTING) {
      connecting=true;
    }
  }
  if (!state.value && connecting) {
    state.label=mContext.getString(R.string.quick_settings_connecting);
  }
  state.icon=ResourceIcon.get(state.value ? R.drawable.ic_qs_cast_on : R.drawable.ic_qs_cast_off);
  mDetailAdapter.updateItems(devices);
}

Fixed version (ground truth):
@Override protected void handleUpdateState(BooleanState state,Object arg){
  state.visible=!mKeyguard.isSecure() || !mKeyguard.isShowing() || mKeyguard.canSkipBouncer();
  state.label=mContext.getString(R.string.quick_settings_cast_title);
  state.value=false;
  state.autoMirrorDrawable=false;
  final Set<CastDevice> devices=mController.getCastDevices();
  boolean connecting=false;
  for (  CastDevice device : devices) {
    if (device.state == CastDevice.STATE_CONNECTED) {
      state.value=true;
      state.label=getDeviceName(device);
    }
 else     if (device.state == CastDevice.STATE_CONNECTING) {
      connecting=true;
    }
  }
  if (!state.value && connecting) {
    state.label=mContext.getString(R.string.quick_settings_connecting);
  }
  state.icon=ResourceIcon.get(state.value ? R.drawable.ic_qs_cast_on : R.drawable.ic_qs_cast_off);
  mDetailAdapter.updateItems(devices);
}
Program: 194238
Project: 194238
Buggy source:
private Intent getCameraIntent(){
  KeyguardUpdateMonitor updateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  boolean currentUserHasTrust=updateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser());
  boolean secure=mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
  return (secure && !currentUserHasTrust) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
}

Fixed version (ground truth):
private Intent getCameraIntent(){
  KeyguardUpdateMonitor updateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  boolean canSkipBouncer=updateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser());
  boolean secure=mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
  return (secure && !canSkipBouncer) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
}
Program: 194239
Project: 194239
Buggy source:
private int getAnimationResForTransition(int oldState,int newState,boolean oldScreenOn,boolean screenOn){
  if (oldState == STATE_FINGERPRINT && newState == STATE_FINGERPRINT_ERROR) {
    return R.drawable.lockscreen_fingerprint_fp_to_error_state_animation;
  }
 else   if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
    return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
  }
 else   if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN && !mUnlockMethodCache.isCurrentlyInsecure()) {
    return R.drawable.lockscreen_fingerprint_draw_off_animation;
  }
 else   if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
    return R.drawable.lockscreen_fingerprint_draw_on_animation;
  }
 else {
    return -1;
  }
}

Fixed version (ground truth):
private int getAnimationResForTransition(int oldState,int newState,boolean oldScreenOn,boolean screenOn){
  if (oldState == STATE_FINGERPRINT && newState == STATE_FINGERPRINT_ERROR) {
    return R.drawable.lockscreen_fingerprint_fp_to_error_state_animation;
  }
 else   if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
    return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
  }
 else   if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN && !mUnlockMethodCache.isTrusted()) {
    return R.drawable.lockscreen_fingerprint_draw_off_animation;
  }
 else   if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
    return R.drawable.lockscreen_fingerprint_draw_on_animation;
  }
 else {
    return -1;
  }
}
Program: 194240
Project: 194240
Buggy source:
private int getState(){
  boolean fingerprintRunning=KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
  if (mUnlockMethodCache.isCurrentlyInsecure()) {
    return STATE_LOCK_OPEN;
  }
 else   if (mTransientFpError) {
    return STATE_FINGERPRINT_ERROR;
  }
 else   if (fingerprintRunning) {
    return STATE_FINGERPRINT;
  }
 else   if (mUnlockMethodCache.isFaceUnlockRunning()) {
    return STATE_FACE_UNLOCK;
  }
 else {
    return STATE_LOCKED;
  }
}

Fixed version (ground truth):
private int getState(){
  boolean fingerprintRunning=KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
  if (mUnlockMethodCache.canSkipBouncer()) {
    return STATE_LOCK_OPEN;
  }
 else   if (mTransientFpError) {
    return STATE_FINGERPRINT_ERROR;
  }
 else   if (fingerprintRunning) {
    return STATE_FINGERPRINT;
  }
 else   if (mUnlockMethodCache.isFaceUnlockRunning()) {
    return STATE_FACE_UNLOCK;
  }
 else {
    return STATE_LOCKED;
  }
}
Program: 194241
Project: 194241
Buggy source:
public void onTrackingStopped(boolean expand){
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    if (!expand && !mUnlockMethodCache.isCurrentlyInsecure()) {
      showBouncer();
    }
  }
}

Fixed version (ground truth):
public void onTrackingStopped(boolean expand){
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    if (!expand && !mUnlockMethodCache.canSkipBouncer()) {
      showBouncer();
    }
  }
}
Program: 194242
Project: 194242
Buggy source:
private void logStateToEventlog(){
  boolean isShowing=mStatusBarKeyguardViewManager.isShowing();
  boolean isOccluded=mStatusBarKeyguardViewManager.isOccluded();
  boolean isBouncerShowing=mStatusBarKeyguardViewManager.isBouncerShowing();
  boolean isSecure=mUnlockMethodCache.isMethodSecure();
  boolean isCurrentlyInsecure=mUnlockMethodCache.isCurrentlyInsecure();
  int stateFingerprint=getLoggingFingerprint(mState,isShowing,isOccluded,isBouncerShowing,isSecure,isCurrentlyInsecure);
  if (stateFingerprint != mLastLoggedStateFingerprint) {
    EventLogTags.writeSysuiStatusBarState(mState,isShowing ? 1 : 0,isOccluded ? 1 : 0,isBouncerShowing ? 1 : 0,isSecure ? 1 : 0,isCurrentlyInsecure ? 1 : 0);
    mLastLoggedStateFingerprint=stateFingerprint;
  }
}

Fixed version (ground truth):
private void logStateToEventlog(){
  boolean isShowing=mStatusBarKeyguardViewManager.isShowing();
  boolean isOccluded=mStatusBarKeyguardViewManager.isOccluded();
  boolean isBouncerShowing=mStatusBarKeyguardViewManager.isBouncerShowing();
  boolean isSecure=mUnlockMethodCache.isMethodSecure();
  boolean canSkipBouncer=mUnlockMethodCache.canSkipBouncer();
  int stateFingerprint=getLoggingFingerprint(mState,isShowing,isOccluded,isBouncerShowing,isSecure,canSkipBouncer);
  if (stateFingerprint != mLastLoggedStateFingerprint) {
    EventLogTags.writeSysuiStatusBarState(mState,isShowing ? 1 : 0,isOccluded ? 1 : 0,isBouncerShowing ? 1 : 0,isSecure ? 1 : 0,canSkipBouncer ? 1 : 0);
    mLastLoggedStateFingerprint=stateFingerprint;
  }
}
Program: 194243
Project: 194243
Buggy source:
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.isCurrentlyInsecure();
}

Fixed version (ground truth):
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.canSkipBouncer();
}
Program: 194244
Project: 194244
Buggy source:
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.isCurrentlyInsecure();
}

Fixed version (ground truth):
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.canSkipBouncer();
}
Program: 194245
Project: 194245
Buggy source:
private void update(boolean updateAlways){
  int user=KeyguardUpdateMonitor.getCurrentUser();
  boolean secure=mLockPatternUtils.isSecure(user);
  boolean currentlyInsecure=!secure || mKeyguardUpdateMonitor.getUserHasTrust(user);
  boolean trustManaged=mKeyguardUpdateMonitor.getUserTrustIsManaged(user);
  boolean faceUnlockRunning=mKeyguardUpdateMonitor.isFaceUnlockRunning(user) && trustManaged;
  boolean changed=secure != mSecure || currentlyInsecure != mCurrentlyInsecure || trustManaged != mTrustManaged || faceUnlockRunning != mFaceUnlockRunning;
  if (changed || updateAlways) {
    mSecure=secure;
    mCurrentlyInsecure=currentlyInsecure;
    mTrustManaged=trustManaged;
    mFaceUnlockRunning=faceUnlockRunning;
    notifyListeners();
  }
}

Fixed version (ground truth):
private void update(boolean updateAlways){
  int user=KeyguardUpdateMonitor.getCurrentUser();
  boolean secure=mLockPatternUtils.isSecure(user);
  boolean canSkipBouncer=!secure || mKeyguardUpdateMonitor.getUserCanSkipBouncer(user);
  boolean trustManaged=mKeyguardUpdateMonitor.getUserTrustIsManaged(user);
  boolean trusted=mKeyguardUpdateMonitor.getUserHasTrust(user);
  boolean faceUnlockRunning=mKeyguardUpdateMonitor.isFaceUnlockRunning(user) && trustManaged;
  boolean changed=secure != mSecure || canSkipBouncer != mCanSkipBouncer || trustManaged != mTrustManaged || faceUnlockRunning != mFaceUnlockRunning;
  if (changed || updateAlways) {
    mSecure=secure;
    mCanSkipBouncer=canSkipBouncer;
    mTrusted=trusted;
    mTrustManaged=trustManaged;
    mFaceUnlockRunning=faceUnlockRunning;
    notifyListeners();
  }
}
Program: 194246
Project: 194246
Buggy source:
public KeyguardMonitor(Context context){
  mContext=context;
  mKeyguardUpdateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  mUserTracker=new CurrentUserTracker(mContext){
    @Override public void onUserSwitched(    int newUserId){
      mCurrentUser=newUserId;
      updateTrustedState();
    }
  }
;
}

Fixed version (ground truth):
public KeyguardMonitor(Context context){
  mContext=context;
  mKeyguardUpdateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  mUserTracker=new CurrentUserTracker(mContext){
    @Override public void onUserSwitched(    int newUserId){
      mCurrentUser=newUserId;
      updateCanSkipBouncerState();
    }
  }
;
}
Program: 194247
Project: 194247
Buggy source:
@Override public void onTrustChanged(int userId){
  updateTrustedState();
  notifyKeyguardChanged();
}

Fixed version (ground truth):
@Override public void onTrustChanged(int userId){
  updateCanSkipBouncerState();
  notifyKeyguardChanged();
}
Program: 194248
Project: 194248
Buggy source:
@Override public void onUserSwitched(int newUserId){
  mCurrentUser=newUserId;
  updateTrustedState();
}

Fixed version (ground truth):
@Override public void onUserSwitched(int newUserId){
  mCurrentUser=newUserId;
  updateCanSkipBouncerState();
}
Program: 194249
Project: 194249
Buggy source:
public void addCallback(Callback callback){
  mCallbacks.add(callback);
  if (mCallbacks.size() != 0 && !mListening) {
    mListening=true;
    mCurrentUser=ActivityManager.getCurrentUser();
    updateTrustedState();
    mKeyguardUpdateMonitor.registerCallback(this);
    mUserTracker.startTracking();
  }
}

Fixed version (ground truth):
public void addCallback(Callback callback){
  mCallbacks.add(callback);
  if (mCallbacks.size() != 0 && !mListening) {
    mListening=true;
    mCurrentUser=ActivityManager.getCurrentUser();
    updateCanSkipBouncerState();
    mKeyguardUpdateMonitor.registerCallback(this);
    mUserTracker.startTracking();
  }
}
Program: 194250
Project: 194250
Buggy source:
@Override public int getCount(){
  boolean secureKeyguardShowing=mController.mKeyguardMonitor.isShowing() && mController.mKeyguardMonitor.isSecure() && !mController.mKeyguardMonitor.isTrusted();
  if (!secureKeyguardShowing) {
    return mController.mUsers.size();
  }
  final int N=mController.mUsers.size();
  int count=0;
  for (int i=0; i < N; i++) {
    if (mController.mUsers.get(i).isRestricted) {
      break;
    }
 else {
      count++;
    }
  }
  return count;
}

Fixed version (ground truth):
@Override public int getCount(){
  boolean secureKeyguardShowing=mController.mKeyguardMonitor.isShowing() && mController.mKeyguardMonitor.isSecure() && !mController.mKeyguardMonitor.canSkipBouncer();
  if (!secureKeyguardShowing) {
    return mController.mUsers.size();
  }
  final int N=mController.mUsers.size();
  int count=0;
  for (int i=0; i < N; i++) {
    if (mController.mUsers.get(i).isRestricted) {
      break;
    }
 else {
      count++;
    }
  }
  return count;
}
Program: 194251
Project: 194251
Buggy source:
/** 
 * Shows the next security screen if there is one.
 * @param authenticated true if the user entered the correct authentication
 * @return true if keyguard is done
 */
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (mUpdateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser())) {
    finish=true;
  }
 else   if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None || !mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}

Fixed version (ground truth):
/** 
 * Shows the next security screen if there is one.
 * @param authenticated true if the user entered the correct authentication
 * @return true if keyguard is done
 */
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (mUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser())) {
    finish=true;
  }
 else   if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None || !mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}
Program: 194252
Project: 194252
Buggy source:
public boolean getUserHasTrust(int userId){
  return !isTrustDisabled(userId) && mUserHasTrust.get(userId) || mUserFingerprintAuthenticated.get(userId);
}

Fixed version (ground truth):
public boolean getUserHasTrust(int userId){
  return !isTrustDisabled(userId) && mUserHasTrust.get(userId);
}
Program: 194253
Project: 194253
Buggy source:
@Override protected void handleUpdateState(BooleanState state,Object arg){
  state.visible=!(mKeyguard.isSecure() && mKeyguard.isShowing() && !mKeyguard.isTrusted());
  state.label=mContext.getString(R.string.quick_settings_cast_title);
  state.value=false;
  state.autoMirrorDrawable=false;
  final Set<CastDevice> devices=mController.getCastDevices();
  boolean connecting=false;
  for (  CastDevice device : devices) {
    if (device.state == CastDevice.STATE_CONNECTED) {
      state.value=true;
      state.label=getDeviceName(device);
    }
 else     if (device.state == CastDevice.STATE_CONNECTING) {
      connecting=true;
    }
  }
  if (!state.value && connecting) {
    state.label=mContext.getString(R.string.quick_settings_connecting);
  }
  state.icon=ResourceIcon.get(state.value ? R.drawable.ic_qs_cast_on : R.drawable.ic_qs_cast_off);
  mDetailAdapter.updateItems(devices);
}

Fixed version (ground truth):
@Override protected void handleUpdateState(BooleanState state,Object arg){
  state.visible=!mKeyguard.isSecure() || !mKeyguard.isShowing() || mKeyguard.canSkipBouncer();
  state.label=mContext.getString(R.string.quick_settings_cast_title);
  state.value=false;
  state.autoMirrorDrawable=false;
  final Set<CastDevice> devices=mController.getCastDevices();
  boolean connecting=false;
  for (  CastDevice device : devices) {
    if (device.state == CastDevice.STATE_CONNECTED) {
      state.value=true;
      state.label=getDeviceName(device);
    }
 else     if (device.state == CastDevice.STATE_CONNECTING) {
      connecting=true;
    }
  }
  if (!state.value && connecting) {
    state.label=mContext.getString(R.string.quick_settings_connecting);
  }
  state.icon=ResourceIcon.get(state.value ? R.drawable.ic_qs_cast_on : R.drawable.ic_qs_cast_off);
  mDetailAdapter.updateItems(devices);
}
Program: 194254
Project: 194254
Buggy source:
private Intent getCameraIntent(){
  KeyguardUpdateMonitor updateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  boolean currentUserHasTrust=updateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser());
  boolean secure=mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
  return (secure && !currentUserHasTrust) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
}

Fixed version (ground truth):
private Intent getCameraIntent(){
  KeyguardUpdateMonitor updateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  boolean canSkipBouncer=updateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser());
  boolean secure=mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
  return (secure && !canSkipBouncer) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
}
Program: 194255
Project: 194255
Buggy source:
private int getAnimationResForTransition(int oldState,int newState,boolean oldScreenOn,boolean screenOn){
  if (oldState == STATE_FINGERPRINT && newState == STATE_FINGERPRINT_ERROR) {
    return R.drawable.lockscreen_fingerprint_fp_to_error_state_animation;
  }
 else   if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
    return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
  }
 else   if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN && !mUnlockMethodCache.isCurrentlyInsecure()) {
    return R.drawable.lockscreen_fingerprint_draw_off_animation;
  }
 else   if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
    return R.drawable.lockscreen_fingerprint_draw_on_animation;
  }
 else {
    return -1;
  }
}

Fixed version (ground truth):
private int getAnimationResForTransition(int oldState,int newState,boolean oldScreenOn,boolean screenOn){
  if (oldState == STATE_FINGERPRINT && newState == STATE_FINGERPRINT_ERROR) {
    return R.drawable.lockscreen_fingerprint_fp_to_error_state_animation;
  }
 else   if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
    return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
  }
 else   if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN && !mUnlockMethodCache.isTrusted()) {
    return R.drawable.lockscreen_fingerprint_draw_off_animation;
  }
 else   if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
    return R.drawable.lockscreen_fingerprint_draw_on_animation;
  }
 else {
    return -1;
  }
}
Program: 194256
Project: 194256
Buggy source:
private int getState(){
  boolean fingerprintRunning=KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
  if (mUnlockMethodCache.isCurrentlyInsecure()) {
    return STATE_LOCK_OPEN;
  }
 else   if (mTransientFpError) {
    return STATE_FINGERPRINT_ERROR;
  }
 else   if (fingerprintRunning) {
    return STATE_FINGERPRINT;
  }
 else   if (mUnlockMethodCache.isFaceUnlockRunning()) {
    return STATE_FACE_UNLOCK;
  }
 else {
    return STATE_LOCKED;
  }
}

Fixed version (ground truth):
private int getState(){
  boolean fingerprintRunning=KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
  if (mUnlockMethodCache.canSkipBouncer()) {
    return STATE_LOCK_OPEN;
  }
 else   if (mTransientFpError) {
    return STATE_FINGERPRINT_ERROR;
  }
 else   if (fingerprintRunning) {
    return STATE_FINGERPRINT;
  }
 else   if (mUnlockMethodCache.isFaceUnlockRunning()) {
    return STATE_FACE_UNLOCK;
  }
 else {
    return STATE_LOCKED;
  }
}
Program: 194257
Project: 194257
Buggy source:
public void onTrackingStopped(boolean expand){
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    if (!expand && !mUnlockMethodCache.isCurrentlyInsecure()) {
      showBouncer();
    }
  }
}

Fixed version (ground truth):
public void onTrackingStopped(boolean expand){
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    if (!expand && !mUnlockMethodCache.canSkipBouncer()) {
      showBouncer();
    }
  }
}
Program: 194258
Project: 194258
Buggy source:
private void logStateToEventlog(){
  boolean isShowing=mStatusBarKeyguardViewManager.isShowing();
  boolean isOccluded=mStatusBarKeyguardViewManager.isOccluded();
  boolean isBouncerShowing=mStatusBarKeyguardViewManager.isBouncerShowing();
  boolean isSecure=mUnlockMethodCache.isMethodSecure();
  boolean isCurrentlyInsecure=mUnlockMethodCache.isCurrentlyInsecure();
  int stateFingerprint=getLoggingFingerprint(mState,isShowing,isOccluded,isBouncerShowing,isSecure,isCurrentlyInsecure);
  if (stateFingerprint != mLastLoggedStateFingerprint) {
    EventLogTags.writeSysuiStatusBarState(mState,isShowing ? 1 : 0,isOccluded ? 1 : 0,isBouncerShowing ? 1 : 0,isSecure ? 1 : 0,isCurrentlyInsecure ? 1 : 0);
    mLastLoggedStateFingerprint=stateFingerprint;
  }
}

Fixed version (ground truth):
private void logStateToEventlog(){
  boolean isShowing=mStatusBarKeyguardViewManager.isShowing();
  boolean isOccluded=mStatusBarKeyguardViewManager.isOccluded();
  boolean isBouncerShowing=mStatusBarKeyguardViewManager.isBouncerShowing();
  boolean isSecure=mUnlockMethodCache.isMethodSecure();
  boolean canSkipBouncer=mUnlockMethodCache.canSkipBouncer();
  int stateFingerprint=getLoggingFingerprint(mState,isShowing,isOccluded,isBouncerShowing,isSecure,canSkipBouncer);
  if (stateFingerprint != mLastLoggedStateFingerprint) {
    EventLogTags.writeSysuiStatusBarState(mState,isShowing ? 1 : 0,isOccluded ? 1 : 0,isBouncerShowing ? 1 : 0,isSecure ? 1 : 0,canSkipBouncer ? 1 : 0);
    mLastLoggedStateFingerprint=stateFingerprint;
  }
}
Program: 194259
Project: 194259
Buggy source:
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.isCurrentlyInsecure();
}

Fixed version (ground truth):
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.canSkipBouncer();
}
Program: 194260
Project: 194260
Buggy source:
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.isCurrentlyInsecure();
}

Fixed version (ground truth):
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.canSkipBouncer();
}