nus-yam/ex-repair huggingface dataset:
Program: 194729
Project: 194729
Buggy source:
@Override public boolean onHandleForceStop(Intent intent,String[] packages,int uid,boolean doit){
  return super.onHandleForceStop(intent,packages,uid,doit);
}

Fixed version (ground truth):
@Override public boolean onHandleForceStop(Intent intent,String[] packages,int uid,boolean doit){
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + uid + "String_Node_Str"+ doit);
  int userHandle=UserHandle.getUserId(uid);
  ComponentName curInteractor=getCurInteractor(userHandle);
  ComponentName curRecognizer=getCurRecognizer(userHandle);
  boolean hit=false;
  for (  String pkg : packages) {
    if (curInteractor != null && pkg.equals(curInteractor.getPackageName())) {
      hit=true;
      break;
    }
 else     if (curRecognizer != null && pkg.equals(curRecognizer.getPackageName())) {
      hit=true;
      break;
    }
  }
  if (hit && doit) {
synchronized (VoiceInteractionManagerService.this) {
      mSoundTriggerHelper.stopAllRecognitions();
      if (mImpl != null) {
        mImpl.shutdownLocked();
        mImpl=null;
      }
      setCurInteractor(null,userHandle);
      setCurRecognizer(null,userHandle);
      initForUser(userHandle);
      switchImplementationIfNeededLocked(true);
    }
  }
  return hit;
}
Program: 194730
Project: 194730
Buggy source:
@Override public void onSomePackagesChanged(){
  int userHandle=getChangingUserId();
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + userHandle);
  ComponentName curInteractor=getCurInteractor(userHandle);
  ComponentName curRecognizer=getCurRecognizer(userHandle);
  if (curRecognizer == null) {
    if (anyPackagesAppearing()) {
      curRecognizer=findAvailRecognizer(null,userHandle);
      if (curRecognizer != null) {
        setCurRecognizer(curRecognizer,userHandle);
      }
    }
    return;
  }
  if (curInteractor != null) {
    int change=isPackageDisappearing(curInteractor.getPackageName());
    if (change == PACKAGE_PERMANENT_CHANGE) {
      setCurInteractor(null,userHandle);
      setCurRecognizer(null,userHandle);
      initForUser(userHandle);
      return;
    }
    change=isPackageAppearing(curInteractor.getPackageName());
    if (change != PACKAGE_UNCHANGED) {
      if (mImpl != null && curInteractor.getPackageName().equals(mImpl.mComponent.getPackageName())) {
        switchImplementationIfNeededLocked(true);
      }
    }
    return;
  }
  int change=isPackageDisappearing(curRecognizer.getPackageName());
  if (change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE) {
    setCurRecognizer(findAvailRecognizer(null,userHandle),userHandle);
  }
 else   if (isPackageModified(curRecognizer.getPackageName())) {
    setCurRecognizer(findAvailRecognizer(curRecognizer.getPackageName(),userHandle),userHandle);
  }
}

Fixed version (ground truth):
@Override public void onSomePackagesChanged(){
  int userHandle=getChangingUserId();
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + userHandle);
synchronized (VoiceInteractionManagerService.this) {
    ComponentName curInteractor=getCurInteractor(userHandle);
    ComponentName curRecognizer=getCurRecognizer(userHandle);
    if (curRecognizer == null) {
      if (anyPackagesAppearing()) {
        curRecognizer=findAvailRecognizer(null,userHandle);
        if (curRecognizer != null) {
          setCurRecognizer(curRecognizer,userHandle);
        }
      }
      return;
    }
    if (curInteractor != null) {
      int change=isPackageDisappearing(curInteractor.getPackageName());
      if (change == PACKAGE_PERMANENT_CHANGE) {
        setCurInteractor(null,userHandle);
        setCurRecognizer(null,userHandle);
        initForUser(userHandle);
        return;
      }
      change=isPackageAppearing(curInteractor.getPackageName());
      if (change != PACKAGE_UNCHANGED) {
        if (mImpl != null && curInteractor.getPackageName().equals(mImpl.mComponent.getPackageName())) {
          switchImplementationIfNeededLocked(true);
        }
      }
      return;
    }
    int change=isPackageDisappearing(curRecognizer.getPackageName());
    if (change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE) {
      setCurRecognizer(findAvailRecognizer(null,userHandle),userHandle);
    }
 else     if (isPackageModified(curRecognizer.getPackageName())) {
      setCurRecognizer(findAvailRecognizer(curRecognizer.getPackageName(),userHandle),userHandle);
    }
  }
}
Program: 194731
Project: 194731
Buggy source:
private void maybeUpdateUsageStatsLocked(ProcessRecord app){
  if (DEBUG_USAGE_STATS) {
    Slog.d(TAG,"String_Node_Str" + Arrays.toString(app.getPackageList()) + "String_Node_Str"+ app.setProcState+ "String_Node_Str"+ app.curProcState);
  }
  if (mUsageStatsService == null) {
    return;
  }
  boolean isInteraction;
  if (!mSleeping) {
    isInteraction=app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
    app.fgInteractionTime=0;
  }
 else {
    if (app.curProcState <= ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE) {
      isInteraction=true;
      app.fgInteractionTime=0;
    }
 else     if (app.curProcState <= ActivityManager.PROCESS_STATE_TOP_SLEEPING) {
      final long now=SystemClock.elapsedRealtime();
      if (app.fgInteractionTime == 0) {
        app.fgInteractionTime=now;
        isInteraction=false;
      }
 else {
        isInteraction=now > app.fgInteractionTime + SERVICE_USAGE_INTERACTION_TIME;
      }
    }
 else {
      isInteraction=app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
      app.fgInteractionTime=0;
    }
  }
  if (isInteraction && !app.reportedInteraction) {
    String[] packages=app.getPackageList();
    if (packages != null) {
      for (int i=0; i < packages.length; i++) {
        mUsageStatsService.reportEvent(packages[i],app.userId,UsageEvents.Event.SYSTEM_INTERACTION);
      }
    }
  }
  app.reportedInteraction=isInteraction;
}

Fixed version (ground truth):
private void maybeUpdateUsageStatsLocked(ProcessRecord app){
  if (DEBUG_USAGE_STATS) {
    Slog.d(TAG,"String_Node_Str" + Arrays.toString(app.getPackageList()) + "String_Node_Str"+ app.setProcState+ "String_Node_Str"+ app.curProcState);
  }
  if (mUsageStatsService == null) {
    return;
  }
  boolean isInteraction;
  if (app.curProcState <= ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE) {
    isInteraction=true;
    app.fgInteractionTime=0;
  }
 else   if (app.curProcState <= ActivityManager.PROCESS_STATE_TOP_SLEEPING) {
    final long now=SystemClock.elapsedRealtime();
    if (app.fgInteractionTime == 0) {
      app.fgInteractionTime=now;
      isInteraction=false;
    }
 else {
      isInteraction=now > app.fgInteractionTime + SERVICE_USAGE_INTERACTION_TIME;
    }
  }
 else {
    isInteraction=app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
    app.fgInteractionTime=0;
  }
  if (isInteraction && !app.reportedInteraction) {
    String[] packages=app.getPackageList();
    if (packages != null) {
      for (int i=0; i < packages.length; i++) {
        mUsageStatsService.reportEvent(packages[i],app.userId,UsageEvents.Event.SYSTEM_INTERACTION);
      }
    }
  }
  app.reportedInteraction=isInteraction;
}
Program: 194732
Project: 194732
Buggy source:
void startRunningVoiceLocked(IVoiceInteractionSession session,int targetUid){
  mVoiceWakeLock.setWorkSource(new WorkSource(targetUid));
  if (mRunningVoice == null || mRunningVoice.asBinder() != session.asBinder()) {
    if (mRunningVoice == null) {
      mVoiceWakeLock.acquire();
      updateSleepIfNeededLocked();
    }
    mRunningVoice=session;
  }
}

Fixed version (ground truth):
void startRunningVoiceLocked(IVoiceInteractionSession session,int targetUid){
  mVoiceWakeLock.setWorkSource(new WorkSource(targetUid));
  if (mRunningVoice == null || mRunningVoice.asBinder() != session.asBinder()) {
    boolean wasRunningVoice=mRunningVoice != null;
    mRunningVoice=session;
    if (!wasRunningVoice) {
      mVoiceWakeLock.acquire();
      updateSleepIfNeededLocked();
    }
  }
}
Program: 194733
Project: 194733
Buggy source:
@Override public boolean onHandleForceStop(Intent intent,String[] packages,int uid,boolean doit){
  return super.onHandleForceStop(intent,packages,uid,doit);
}

Fixed version (ground truth):
@Override public boolean onHandleForceStop(Intent intent,String[] packages,int uid,boolean doit){
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + uid + "String_Node_Str"+ doit);
  int userHandle=UserHandle.getUserId(uid);
  ComponentName curInteractor=getCurInteractor(userHandle);
  ComponentName curRecognizer=getCurRecognizer(userHandle);
  boolean hit=false;
  for (  String pkg : packages) {
    if (curInteractor != null && pkg.equals(curInteractor.getPackageName())) {
      hit=true;
      break;
    }
 else     if (curRecognizer != null && pkg.equals(curRecognizer.getPackageName())) {
      hit=true;
      break;
    }
  }
  if (hit && doit) {
synchronized (VoiceInteractionManagerService.this) {
      mSoundTriggerHelper.stopAllRecognitions();
      if (mImpl != null) {
        mImpl.shutdownLocked();
        mImpl=null;
      }
      setCurInteractor(null,userHandle);
      setCurRecognizer(null,userHandle);
      initForUser(userHandle);
      switchImplementationIfNeededLocked(true);
    }
  }
  return hit;
}
Program: 194734
Project: 194734
Buggy source:
@Override public void onSomePackagesChanged(){
  int userHandle=getChangingUserId();
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + userHandle);
  ComponentName curInteractor=getCurInteractor(userHandle);
  ComponentName curRecognizer=getCurRecognizer(userHandle);
  if (curRecognizer == null) {
    if (anyPackagesAppearing()) {
      curRecognizer=findAvailRecognizer(null,userHandle);
      if (curRecognizer != null) {
        setCurRecognizer(curRecognizer,userHandle);
      }
    }
    return;
  }
  if (curInteractor != null) {
    int change=isPackageDisappearing(curInteractor.getPackageName());
    if (change == PACKAGE_PERMANENT_CHANGE) {
      setCurInteractor(null,userHandle);
      setCurRecognizer(null,userHandle);
      initForUser(userHandle);
      return;
    }
    change=isPackageAppearing(curInteractor.getPackageName());
    if (change != PACKAGE_UNCHANGED) {
      if (mImpl != null && curInteractor.getPackageName().equals(mImpl.mComponent.getPackageName())) {
        switchImplementationIfNeededLocked(true);
      }
    }
    return;
  }
  int change=isPackageDisappearing(curRecognizer.getPackageName());
  if (change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE) {
    setCurRecognizer(findAvailRecognizer(null,userHandle),userHandle);
  }
 else   if (isPackageModified(curRecognizer.getPackageName())) {
    setCurRecognizer(findAvailRecognizer(curRecognizer.getPackageName(),userHandle),userHandle);
  }
}

Fixed version (ground truth):
@Override public void onSomePackagesChanged(){
  int userHandle=getChangingUserId();
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + userHandle);
synchronized (VoiceInteractionManagerService.this) {
    ComponentName curInteractor=getCurInteractor(userHandle);
    ComponentName curRecognizer=getCurRecognizer(userHandle);
    if (curRecognizer == null) {
      if (anyPackagesAppearing()) {
        curRecognizer=findAvailRecognizer(null,userHandle);
        if (curRecognizer != null) {
          setCurRecognizer(curRecognizer,userHandle);
        }
      }
      return;
    }
    if (curInteractor != null) {
      int change=isPackageDisappearing(curInteractor.getPackageName());
      if (change == PACKAGE_PERMANENT_CHANGE) {
        setCurInteractor(null,userHandle);
        setCurRecognizer(null,userHandle);
        initForUser(userHandle);
        return;
      }
      change=isPackageAppearing(curInteractor.getPackageName());
      if (change != PACKAGE_UNCHANGED) {
        if (mImpl != null && curInteractor.getPackageName().equals(mImpl.mComponent.getPackageName())) {
          switchImplementationIfNeededLocked(true);
        }
      }
      return;
    }
    int change=isPackageDisappearing(curRecognizer.getPackageName());
    if (change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE) {
      setCurRecognizer(findAvailRecognizer(null,userHandle),userHandle);
    }
 else     if (isPackageModified(curRecognizer.getPackageName())) {
      setCurRecognizer(findAvailRecognizer(curRecognizer.getPackageName(),userHandle),userHandle);
    }
  }
}
Program: 194735
Project: 194735
Buggy source:
private void maybeUpdateUsageStatsLocked(ProcessRecord app){
  if (DEBUG_USAGE_STATS) {
    Slog.d(TAG,"String_Node_Str" + Arrays.toString(app.getPackageList()) + "String_Node_Str"+ app.setProcState+ "String_Node_Str"+ app.curProcState);
  }
  if (mUsageStatsService == null) {
    return;
  }
  boolean isInteraction;
  if (!mSleeping) {
    isInteraction=app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
    app.fgInteractionTime=0;
  }
 else {
    if (app.curProcState <= ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE) {
      isInteraction=true;
      app.fgInteractionTime=0;
    }
 else     if (app.curProcState <= ActivityManager.PROCESS_STATE_TOP_SLEEPING) {
      final long now=SystemClock.elapsedRealtime();
      if (app.fgInteractionTime == 0) {
        app.fgInteractionTime=now;
        isInteraction=false;
      }
 else {
        isInteraction=now > app.fgInteractionTime + SERVICE_USAGE_INTERACTION_TIME;
      }
    }
 else {
      isInteraction=app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
      app.fgInteractionTime=0;
    }
  }
  if (isInteraction && !app.reportedInteraction) {
    String[] packages=app.getPackageList();
    if (packages != null) {
      for (int i=0; i < packages.length; i++) {
        mUsageStatsService.reportEvent(packages[i],app.userId,UsageEvents.Event.SYSTEM_INTERACTION);
      }
    }
  }
  app.reportedInteraction=isInteraction;
}

Fixed version (ground truth):
private void maybeUpdateUsageStatsLocked(ProcessRecord app){
  if (DEBUG_USAGE_STATS) {
    Slog.d(TAG,"String_Node_Str" + Arrays.toString(app.getPackageList()) + "String_Node_Str"+ app.setProcState+ "String_Node_Str"+ app.curProcState);
  }
  if (mUsageStatsService == null) {
    return;
  }
  boolean isInteraction;
  if (app.curProcState <= ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE) {
    isInteraction=true;
    app.fgInteractionTime=0;
  }
 else   if (app.curProcState <= ActivityManager.PROCESS_STATE_TOP_SLEEPING) {
    final long now=SystemClock.elapsedRealtime();
    if (app.fgInteractionTime == 0) {
      app.fgInteractionTime=now;
      isInteraction=false;
    }
 else {
      isInteraction=now > app.fgInteractionTime + SERVICE_USAGE_INTERACTION_TIME;
    }
  }
 else {
    isInteraction=app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
    app.fgInteractionTime=0;
  }
  if (isInteraction && !app.reportedInteraction) {
    String[] packages=app.getPackageList();
    if (packages != null) {
      for (int i=0; i < packages.length; i++) {
        mUsageStatsService.reportEvent(packages[i],app.userId,UsageEvents.Event.SYSTEM_INTERACTION);
      }
    }
  }
  app.reportedInteraction=isInteraction;
}
Program: 194736
Project: 194736
Buggy source:
void startRunningVoiceLocked(IVoiceInteractionSession session,int targetUid){
  mVoiceWakeLock.setWorkSource(new WorkSource(targetUid));
  if (mRunningVoice == null || mRunningVoice.asBinder() != session.asBinder()) {
    if (mRunningVoice == null) {
      mVoiceWakeLock.acquire();
      updateSleepIfNeededLocked();
    }
    mRunningVoice=session;
  }
}

Fixed version (ground truth):
void startRunningVoiceLocked(IVoiceInteractionSession session,int targetUid){
  mVoiceWakeLock.setWorkSource(new WorkSource(targetUid));
  if (mRunningVoice == null || mRunningVoice.asBinder() != session.asBinder()) {
    boolean wasRunningVoice=mRunningVoice != null;
    mRunningVoice=session;
    if (!wasRunningVoice) {
      mVoiceWakeLock.acquire();
      updateSleepIfNeededLocked();
    }
  }
}
Program: 194737
Project: 194737
Buggy source:
@Override public boolean onHandleForceStop(Intent intent,String[] packages,int uid,boolean doit){
  return super.onHandleForceStop(intent,packages,uid,doit);
}

Fixed version (ground truth):
@Override public boolean onHandleForceStop(Intent intent,String[] packages,int uid,boolean doit){
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + uid + "String_Node_Str"+ doit);
  int userHandle=UserHandle.getUserId(uid);
  ComponentName curInteractor=getCurInteractor(userHandle);
  ComponentName curRecognizer=getCurRecognizer(userHandle);
  boolean hit=false;
  for (  String pkg : packages) {
    if (curInteractor != null && pkg.equals(curInteractor.getPackageName())) {
      hit=true;
      break;
    }
 else     if (curRecognizer != null && pkg.equals(curRecognizer.getPackageName())) {
      hit=true;
      break;
    }
  }
  if (hit && doit) {
synchronized (VoiceInteractionManagerService.this) {
      mSoundTriggerHelper.stopAllRecognitions();
      if (mImpl != null) {
        mImpl.shutdownLocked();
        mImpl=null;
      }
      setCurInteractor(null,userHandle);
      setCurRecognizer(null,userHandle);
      initForUser(userHandle);
      switchImplementationIfNeededLocked(true);
    }
  }
  return hit;
}
Program: 194738
Project: 194738
Buggy source:
@Override public void onSomePackagesChanged(){
  int userHandle=getChangingUserId();
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + userHandle);
  ComponentName curInteractor=getCurInteractor(userHandle);
  ComponentName curRecognizer=getCurRecognizer(userHandle);
  if (curRecognizer == null) {
    if (anyPackagesAppearing()) {
      curRecognizer=findAvailRecognizer(null,userHandle);
      if (curRecognizer != null) {
        setCurRecognizer(curRecognizer,userHandle);
      }
    }
    return;
  }
  if (curInteractor != null) {
    int change=isPackageDisappearing(curInteractor.getPackageName());
    if (change == PACKAGE_PERMANENT_CHANGE) {
      setCurInteractor(null,userHandle);
      setCurRecognizer(null,userHandle);
      initForUser(userHandle);
      return;
    }
    change=isPackageAppearing(curInteractor.getPackageName());
    if (change != PACKAGE_UNCHANGED) {
      if (mImpl != null && curInteractor.getPackageName().equals(mImpl.mComponent.getPackageName())) {
        switchImplementationIfNeededLocked(true);
      }
    }
    return;
  }
  int change=isPackageDisappearing(curRecognizer.getPackageName());
  if (change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE) {
    setCurRecognizer(findAvailRecognizer(null,userHandle),userHandle);
  }
 else   if (isPackageModified(curRecognizer.getPackageName())) {
    setCurRecognizer(findAvailRecognizer(curRecognizer.getPackageName(),userHandle),userHandle);
  }
}

Fixed version (ground truth):
@Override public void onSomePackagesChanged(){
  int userHandle=getChangingUserId();
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + userHandle);
synchronized (VoiceInteractionManagerService.this) {
    ComponentName curInteractor=getCurInteractor(userHandle);
    ComponentName curRecognizer=getCurRecognizer(userHandle);
    if (curRecognizer == null) {
      if (anyPackagesAppearing()) {
        curRecognizer=findAvailRecognizer(null,userHandle);
        if (curRecognizer != null) {
          setCurRecognizer(curRecognizer,userHandle);
        }
      }
      return;
    }
    if (curInteractor != null) {
      int change=isPackageDisappearing(curInteractor.getPackageName());
      if (change == PACKAGE_PERMANENT_CHANGE) {
        setCurInteractor(null,userHandle);
        setCurRecognizer(null,userHandle);
        initForUser(userHandle);
        return;
      }
      change=isPackageAppearing(curInteractor.getPackageName());
      if (change != PACKAGE_UNCHANGED) {
        if (mImpl != null && curInteractor.getPackageName().equals(mImpl.mComponent.getPackageName())) {
          switchImplementationIfNeededLocked(true);
        }
      }
      return;
    }
    int change=isPackageDisappearing(curRecognizer.getPackageName());
    if (change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE) {
      setCurRecognizer(findAvailRecognizer(null,userHandle),userHandle);
    }
 else     if (isPackageModified(curRecognizer.getPackageName())) {
      setCurRecognizer(findAvailRecognizer(curRecognizer.getPackageName(),userHandle),userHandle);
    }
  }
}
Program: 194739
Project: 194739
Buggy source:
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.VISIBLE);
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}

Fixed version (ground truth):
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    if (!mDozing) {
      mKeyguardBottomArea.setVisibility(View.VISIBLE);
    }
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}
Program: 194740
Project: 194740
Buggy source:
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}

Fixed version (ground truth):
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f && !mDozing ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}
Program: 194741
Project: 194741
Buggy source:
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.VISIBLE);
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}

Fixed version (ground truth):
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    if (!mDozing) {
      mKeyguardBottomArea.setVisibility(View.VISIBLE);
    }
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}
Program: 194742
Project: 194742
Buggy source:
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}

Fixed version (ground truth):
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f && !mDozing ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}
Program: 194743
Project: 194743
Buggy source:
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.VISIBLE);
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}

Fixed version (ground truth):
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    if (!mDozing) {
      mKeyguardBottomArea.setVisibility(View.VISIBLE);
    }
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}
Program: 194744
Project: 194744
Buggy source:
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}

Fixed version (ground truth):
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f && !mDozing ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}
Program: 194745
Project: 194745
Buggy source:
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.VISIBLE);
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}

Fixed version (ground truth):
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    if (!mDozing) {
      mKeyguardBottomArea.setVisibility(View.VISIBLE);
    }
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}
Program: 194746
Project: 194746
Buggy source:
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}

Fixed version (ground truth):
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f && !mDozing ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}
Program: 194747
Project: 194747
Buggy source:
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.VISIBLE);
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}

Fixed version (ground truth):
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    if (!mDozing) {
      mKeyguardBottomArea.setVisibility(View.VISIBLE);
    }
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}
Program: 194748
Project: 194748
Buggy source:
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}

Fixed version (ground truth):
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f && !mDozing ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}
Program: 194749
Project: 194749
Buggy source:
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.VISIBLE);
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}

Fixed version (ground truth):
private void setKeyguardBottomAreaVisibility(int statusBarState,boolean goingToFullShade){
  if (goingToFullShade) {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.animate().alpha(0f).setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()).setDuration(mStatusBar.getKeyguardFadingAwayDuration() / 2).setInterpolator(PhoneStatusBar.ALPHA_OUT).withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable).start();
  }
 else   if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) {
    mKeyguardBottomArea.animate().cancel();
    if (!mDozing) {
      mKeyguardBottomArea.setVisibility(View.VISIBLE);
    }
    mKeyguardBottomArea.setAlpha(1f);
  }
 else {
    mKeyguardBottomArea.animate().cancel();
    mKeyguardBottomArea.setVisibility(View.GONE);
    mKeyguardBottomArea.setAlpha(1f);
  }
}
Program: 194750
Project: 194750
Buggy source:
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}

Fixed version (ground truth):
private void updateHeaderKeyguard(){
  float alphaQsExpansion=1 - Math.min(1,getQsExpansionFraction() * 2);
  mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(),alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha);
  mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f && !mDozing ? VISIBLE : INVISIBLE);
  setQsTranslation(mQsExpansionHeight);
}
Program: 194751
Project: 194751
Buggy source:
private void maybeUpdateUsageStatsLocked(ProcessRecord app){
  if (DEBUG_USAGE_STATS) {
    Slog.d(TAG,"String_Node_Str" + Arrays.toString(app.getPackageList()) + "String_Node_Str"+ app.setProcState+ "String_Node_Str"+ app.curProcState);
  }
  if (mUsageStatsService == null) {
    return;
  }
  boolean isInteraction;
  if (!mSleeping) {
    isInteraction=app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
    app.fgInteractionTime=0;
  }
 else {
    if (app.curProcState <= ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE) {
      isInteraction=true;
      app.fgInteractionTime=0;
    }
 else     if (app.curProcState <= ActivityManager.PROCESS_STATE_TOP_SLEEPING) {
      final long now=SystemClock.elapsedRealtime();
      if (app.fgInteractionTime == 0) {
        app.fgInteractionTime=now;
        isInteraction=false;
      }
 else {
        isInteraction=now > app.fgInteractionTime + SERVICE_USAGE_INTERACTION_TIME;
      }
    }
 else {
      isInteraction=app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
      app.fgInteractionTime=0;
    }
  }
  if (isInteraction && !app.reportedInteraction) {
    String[] packages=app.getPackageList();
    if (packages != null) {
      for (int i=0; i < packages.length; i++) {
        mUsageStatsService.reportEvent(packages[i],app.userId,UsageEvents.Event.SYSTEM_INTERACTION);
      }
    }
  }
  app.reportedInteraction=isInteraction;
}

Fixed version (ground truth):
private void maybeUpdateUsageStatsLocked(ProcessRecord app){
  if (DEBUG_USAGE_STATS) {
    Slog.d(TAG,"String_Node_Str" + Arrays.toString(app.getPackageList()) + "String_Node_Str"+ app.setProcState+ "String_Node_Str"+ app.curProcState);
  }
  if (mUsageStatsService == null) {
    return;
  }
  boolean isInteraction;
  if (app.curProcState <= ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE) {
    isInteraction=true;
    app.fgInteractionTime=0;
  }
 else   if (app.curProcState <= ActivityManager.PROCESS_STATE_TOP_SLEEPING) {
    final long now=SystemClock.elapsedRealtime();
    if (app.fgInteractionTime == 0) {
      app.fgInteractionTime=now;
      isInteraction=false;
    }
 else {
      isInteraction=now > app.fgInteractionTime + SERVICE_USAGE_INTERACTION_TIME;
    }
  }
 else {
    isInteraction=app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
    app.fgInteractionTime=0;
  }
  if (isInteraction && !app.reportedInteraction) {
    String[] packages=app.getPackageList();
    if (packages != null) {
      for (int i=0; i < packages.length; i++) {
        mUsageStatsService.reportEvent(packages[i],app.userId,UsageEvents.Event.SYSTEM_INTERACTION);
      }
    }
  }
  app.reportedInteraction=isInteraction;
}
Program: 194752
Project: 194752
Buggy source:
void startRunningVoiceLocked(IVoiceInteractionSession session,int targetUid){
  mVoiceWakeLock.setWorkSource(new WorkSource(targetUid));
  if (mRunningVoice == null || mRunningVoice.asBinder() != session.asBinder()) {
    if (mRunningVoice == null) {
      mVoiceWakeLock.acquire();
      updateSleepIfNeededLocked();
    }
    mRunningVoice=session;
  }
}

Fixed version (ground truth):
void startRunningVoiceLocked(IVoiceInteractionSession session,int targetUid){
  mVoiceWakeLock.setWorkSource(new WorkSource(targetUid));
  if (mRunningVoice == null || mRunningVoice.asBinder() != session.asBinder()) {
    boolean wasRunningVoice=mRunningVoice != null;
    mRunningVoice=session;
    if (!wasRunningVoice) {
      mVoiceWakeLock.acquire();
      updateSleepIfNeededLocked();
    }
  }
}
Program: 194753
Project: 194753
Buggy source:
@Override public boolean onHandleForceStop(Intent intent,String[] packages,int uid,boolean doit){
  return super.onHandleForceStop(intent,packages,uid,doit);
}

Fixed version (ground truth):
@Override public boolean onHandleForceStop(Intent intent,String[] packages,int uid,boolean doit){
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + uid + "String_Node_Str"+ doit);
  int userHandle=UserHandle.getUserId(uid);
  ComponentName curInteractor=getCurInteractor(userHandle);
  ComponentName curRecognizer=getCurRecognizer(userHandle);
  boolean hit=false;
  for (  String pkg : packages) {
    if (curInteractor != null && pkg.equals(curInteractor.getPackageName())) {
      hit=true;
      break;
    }
 else     if (curRecognizer != null && pkg.equals(curRecognizer.getPackageName())) {
      hit=true;
      break;
    }
  }
  if (hit && doit) {
synchronized (VoiceInteractionManagerService.this) {
      mSoundTriggerHelper.stopAllRecognitions();
      if (mImpl != null) {
        mImpl.shutdownLocked();
        mImpl=null;
      }
      setCurInteractor(null,userHandle);
      setCurRecognizer(null,userHandle);
      initForUser(userHandle);
      switchImplementationIfNeededLocked(true);
    }
  }
  return hit;
}
Program: 194754
Project: 194754
Buggy source:
@Override public void onSomePackagesChanged(){
  int userHandle=getChangingUserId();
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + userHandle);
  ComponentName curInteractor=getCurInteractor(userHandle);
  ComponentName curRecognizer=getCurRecognizer(userHandle);
  if (curRecognizer == null) {
    if (anyPackagesAppearing()) {
      curRecognizer=findAvailRecognizer(null,userHandle);
      if (curRecognizer != null) {
        setCurRecognizer(curRecognizer,userHandle);
      }
    }
    return;
  }
  if (curInteractor != null) {
    int change=isPackageDisappearing(curInteractor.getPackageName());
    if (change == PACKAGE_PERMANENT_CHANGE) {
      setCurInteractor(null,userHandle);
      setCurRecognizer(null,userHandle);
      initForUser(userHandle);
      return;
    }
    change=isPackageAppearing(curInteractor.getPackageName());
    if (change != PACKAGE_UNCHANGED) {
      if (mImpl != null && curInteractor.getPackageName().equals(mImpl.mComponent.getPackageName())) {
        switchImplementationIfNeededLocked(true);
      }
    }
    return;
  }
  int change=isPackageDisappearing(curRecognizer.getPackageName());
  if (change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE) {
    setCurRecognizer(findAvailRecognizer(null,userHandle),userHandle);
  }
 else   if (isPackageModified(curRecognizer.getPackageName())) {
    setCurRecognizer(findAvailRecognizer(curRecognizer.getPackageName(),userHandle),userHandle);
  }
}

Fixed version (ground truth):
@Override public void onSomePackagesChanged(){
  int userHandle=getChangingUserId();
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + userHandle);
synchronized (VoiceInteractionManagerService.this) {
    ComponentName curInteractor=getCurInteractor(userHandle);
    ComponentName curRecognizer=getCurRecognizer(userHandle);
    if (curRecognizer == null) {
      if (anyPackagesAppearing()) {
        curRecognizer=findAvailRecognizer(null,userHandle);
        if (curRecognizer != null) {
          setCurRecognizer(curRecognizer,userHandle);
        }
      }
      return;
    }
    if (curInteractor != null) {
      int change=isPackageDisappearing(curInteractor.getPackageName());
      if (change == PACKAGE_PERMANENT_CHANGE) {
        setCurInteractor(null,userHandle);
        setCurRecognizer(null,userHandle);
        initForUser(userHandle);
        return;
      }
      change=isPackageAppearing(curInteractor.getPackageName());
      if (change != PACKAGE_UNCHANGED) {
        if (mImpl != null && curInteractor.getPackageName().equals(mImpl.mComponent.getPackageName())) {
          switchImplementationIfNeededLocked(true);
        }
      }
      return;
    }
    int change=isPackageDisappearing(curRecognizer.getPackageName());
    if (change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE) {
      setCurRecognizer(findAvailRecognizer(null,userHandle),userHandle);
    }
 else     if (isPackageModified(curRecognizer.getPackageName())) {
      setCurRecognizer(findAvailRecognizer(curRecognizer.getPackageName(),userHandle),userHandle);
    }
  }
}
Program: 194759
Project: 194759
Buggy source:
public DismissViewButton(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  mAnimatedDismissDrawable=(AnimatedVectorDrawable)getContext().getResources().getDrawable(R.drawable.dismiss_all_shape_animation).mutate();
  mAnimatedDismissDrawable.setCallback(this);
  mAnimatedDismissDrawable.setBounds(0,0,mAnimatedDismissDrawable.getIntrinsicWidth(),mAnimatedDismissDrawable.getIntrinsicHeight());
  mStaticDismissDrawable=getContext().getResources().getDrawable(R.drawable.dismiss_all_shape);
  mStaticDismissDrawable.setBounds(0,0,mStaticDismissDrawable.getIntrinsicWidth(),mStaticDismissDrawable.getIntrinsicHeight());
  mStaticDismissDrawable.setCallback(this);
  mActiveDrawable=mStaticDismissDrawable;
}

Fixed version (ground truth):
public DismissViewButton(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  mAnimatedDismissDrawable=(AnimatedVectorDrawable)getContext().getDrawable(R.drawable.dismiss_all_shape_animation).mutate();
  mAnimatedDismissDrawable.setCallback(this);
  mAnimatedDismissDrawable.setBounds(0,0,mAnimatedDismissDrawable.getIntrinsicWidth(),mAnimatedDismissDrawable.getIntrinsicHeight());
  mStaticDismissDrawable=getContext().getDrawable(R.drawable.dismiss_all_shape);
  mStaticDismissDrawable.setBounds(0,0,mStaticDismissDrawable.getIntrinsicWidth(),mStaticDismissDrawable.getIntrinsicHeight());
  mStaticDismissDrawable.setCallback(this);
  mActiveDrawable=mStaticDismissDrawable;
}
Program: 194761
Project: 194761
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 > when2) {
    return 1;
  }
  if (when1 < when2) {
    return -1;
  }
  return 0;
}
Program: 194762
Project: 194762
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 > when2) {
    return 1;
  }
  if (when1 < when2) {
    return -1;
  }
  return 0;
}
Program: 194763
Project: 194763
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 > when2) {
    return 1;
  }
  if (when1 < when2) {
    return -1;
  }
  return 0;
}
Program: 194764
Project: 194764
Buggy source:
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link Build.VERSION.SDK_INT} is greater than {@link VERSION_CODES.LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}

Fixed version (ground truth):
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link android.os.Build.VERSION#SDK_INT} is greater than{@link android.os.Build.VERSION_CODES#LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}