nus-yam/ex-repair huggingface dataset:
Program: 194165
Project: 194165
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: 194166
Project: 194166
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: 194167
Project: 194167
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: 194168
Project: 194168
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: 194169
Project: 194169
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: 194170
Project: 194170
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: 194171
Project: 194171
Buggy source:
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.isCurrentlyInsecure();
}

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

Fixed version (ground truth):
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.canSkipBouncer();
}
Program: 194173
Project: 194173
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: 194174
Project: 194174
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: 194175
Project: 194175
Buggy source:
@Override public void onTrustChanged(int userId){
  updateTrustedState();
  notifyKeyguardChanged();
}

Fixed version (ground truth):
@Override public void onTrustChanged(int userId){
  updateCanSkipBouncerState();
  notifyKeyguardChanged();
}
Program: 194176
Project: 194176
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: 194177
Project: 194177
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: 194178
Project: 194178
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: 194179
Project: 194179
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: 194180
Project: 194180
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: 194181
Project: 194181
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: 194182
Project: 194182
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: 194183
Project: 194183
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: 194184
Project: 194184
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: 194185
Project: 194185
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: 194186
Project: 194186
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: 194187
Project: 194187
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: 194188
Project: 194188
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: 194189
Project: 194189
Buggy source:
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.isCurrentlyInsecure();
}

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

Fixed version (ground truth):
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.canSkipBouncer();
}
Program: 194191
Project: 194191
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: 194192
Project: 194192
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: 194193
Project: 194193
Buggy source:
@Override public void onTrustChanged(int userId){
  updateTrustedState();
  notifyKeyguardChanged();
}

Fixed version (ground truth):
@Override public void onTrustChanged(int userId){
  updateCanSkipBouncerState();
  notifyKeyguardChanged();
}
Program: 194194
Project: 194194
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: 194195
Project: 194195
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: 194196
Project: 194196
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: 194197
Project: 194197
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: 194198
Project: 194198
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: 194199
Project: 194199
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: 194200
Project: 194200
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: 194201
Project: 194201
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: 194202
Project: 194202
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: 194203
Project: 194203
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: 194204
Project: 194204
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: 194205
Project: 194205
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: 194206
Project: 194206
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: 194207
Project: 194207
Buggy source:
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.isCurrentlyInsecure();
}

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

Fixed version (ground truth):
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.canSkipBouncer();
}
Program: 194209
Project: 194209
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: 194210
Project: 194210
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: 194211
Project: 194211
Buggy source:
@Override public void onTrustChanged(int userId){
  updateTrustedState();
  notifyKeyguardChanged();
}

Fixed version (ground truth):
@Override public void onTrustChanged(int userId){
  updateCanSkipBouncerState();
  notifyKeyguardChanged();
}
Program: 194212
Project: 194212
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: 194213
Project: 194213
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();
  }
}