nus-yam/ex-repair huggingface dataset:
Program: 196994
Project: 196994
Buggy source:
public static ApplicationInfo generateApplicationInfo(Package p,int flags,PackageUserState state,int userId){
  if (p == null)   return null;
  if (!checkUseInstalledOrHidden(flags,state)) {
    return null;
  }
  if (!copyNeeded(flags,p,state,null,userId) && ((flags & PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS) == 0 || state.enabled != PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED)) {
    updateApplicationInfo(p.applicationInfo,flags,state);
    return p.applicationInfo;
  }
  ApplicationInfo ai=new ApplicationInfo(p.applicationInfo);
  if (userId != 0) {
    ai.uid=UserHandle.getUid(userId,ai.uid);
    ai.dataDir=PackageManager.getDataDirForUser(userId,ai.packageName);
  }
  if ((flags & PackageManager.GET_META_DATA) != 0) {
    ai.metaData=p.mAppMetaData;
  }
  if ((flags & PackageManager.GET_SHARED_LIBRARY_FILES) != 0) {
    ai.sharedLibraryFiles=p.usesLibraryFiles;
  }
  if (state.stopped) {
    ai.flags|=ApplicationInfo.FLAG_STOPPED;
  }
 else {
    ai.flags&=~ApplicationInfo.FLAG_STOPPED;
  }
  updateApplicationInfo(ai,flags,state);
  return ai;
}

Fixed version (ground truth):
public static ApplicationInfo generateApplicationInfo(ApplicationInfo ai,int flags,PackageUserState state,int userId){
  if (ai == null)   return null;
  if (!checkUseInstalledOrHidden(flags,state)) {
    return null;
  }
  ai=new ApplicationInfo(ai);
  if (userId != 0) {
    ai.uid=UserHandle.getUid(userId,ai.uid);
    ai.dataDir=PackageManager.getDataDirForUser(userId,ai.packageName);
  }
  if (state.stopped) {
    ai.flags|=ApplicationInfo.FLAG_STOPPED;
  }
 else {
    ai.flags&=~ApplicationInfo.FLAG_STOPPED;
  }
  updateApplicationInfo(ai,flags,state);
  return ai;
}
Program: 196995
Project: 196995
Buggy source:
public static final ActivityInfo generateActivityInfo(Activity a,int flags,PackageUserState state,int userId){
  if (a == null)   return null;
  if (!checkUseInstalledOrHidden(flags,state)) {
    return null;
  }
  if (!copyNeeded(flags,a.owner,state,a.metaData,userId)) {
    return a.info;
  }
  ActivityInfo ai=new ActivityInfo(a.info);
  ai.metaData=a.metaData;
  ai.applicationInfo=generateApplicationInfo(a.owner,flags,state,userId);
  return ai;
}

Fixed version (ground truth):
public static final ActivityInfo generateActivityInfo(ActivityInfo ai,int flags,PackageUserState state,int userId){
  if (ai == null)   return null;
  if (!checkUseInstalledOrHidden(flags,state)) {
    return null;
  }
  ai=new ActivityInfo(ai);
  ai.applicationInfo=generateApplicationInfo(ai.applicationInfo,flags,state,userId);
  return ai;
}
Program: 196996
Project: 196996
Buggy source:
@Override public ActivityInfo getActivityInfo(ComponentName component,int flags,int userId){
  if (!sUserManager.exists(userId))   return null;
  enforceCrossUserPermission(Binder.getCallingUid(),userId,false,false,"String_Node_Str");
synchronized (mPackages) {
    PackageParser.Activity a=mActivities.mActivities.get(component);
    if (DEBUG_PACKAGE_INFO)     Log.v(TAG,"String_Node_Str" + component + "String_Node_Str"+ a);
    if (a != null && mSettings.isEnabledLPr(a.info,flags,userId)) {
      PackageSetting ps=mSettings.mPackages.get(component.getPackageName());
      if (ps == null)       return null;
      return PackageParser.generateActivityInfo(a,flags,ps.readUserState(userId),userId);
    }
    if (mResolveComponentName.equals(component)) {
      return mResolveActivity;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public ActivityInfo getActivityInfo(ComponentName component,int flags,int userId){
  if (!sUserManager.exists(userId))   return null;
  enforceCrossUserPermission(Binder.getCallingUid(),userId,false,false,"String_Node_Str");
synchronized (mPackages) {
    PackageParser.Activity a=mActivities.mActivities.get(component);
    if (DEBUG_PACKAGE_INFO)     Log.v(TAG,"String_Node_Str" + component + "String_Node_Str"+ a);
    if (a != null && mSettings.isEnabledLPr(a.info,flags,userId)) {
      PackageSetting ps=mSettings.mPackages.get(component.getPackageName());
      if (ps == null)       return null;
      return PackageParser.generateActivityInfo(a,flags,ps.readUserState(userId),userId);
    }
    if (mResolveComponentName.equals(component)) {
      return PackageParser.generateActivityInfo(mResolveActivity,flags,new PackageUserState(),userId);
    }
  }
  return null;
}
Program: 196998
Project: 196998
Buggy source:
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}

Fixed version (ground truth):
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    mStackSupervisor.sendWaitingVisibleReportLocked(this);
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}
Program: 196999
Project: 196999
Buggy source:
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    w.timeout=timeout;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.thisTime=thisTime;
    w.totalTime=totalTime;
  }
  mService.notifyAll();
}

Fixed version (ground truth):
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  boolean changed=false;
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    if (w.who == null) {
      changed=true;
      w.timeout=timeout;
      if (r != null) {
        w.who=new ComponentName(r.info.packageName,r.info.name);
      }
      w.thisTime=thisTime;
      w.totalTime=totalTime;
    }
  }
  if (changed) {
    mService.notifyAll();
  }
}
Program: 197000
Project: 197000
Buggy source:
void reportActivityVisibleLocked(ActivityRecord r){
  for (int i=mWaitingActivityVisible.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityVisible.get(i);
    w.timeout=false;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.totalTime=SystemClock.uptimeMillis() - w.thisTime;
    w.thisTime=w.totalTime;
  }
  mService.notifyAll();
  notifyActivityDrawnForKeyguard();
}

Fixed version (ground truth):
void reportActivityVisibleLocked(ActivityRecord r){
  sendWaitingVisibleReportLocked(r);
  notifyActivityDrawnForKeyguard();
}
Program: 197003
Project: 197003
Buggy source:
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}

Fixed version (ground truth):
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    mStackSupervisor.sendWaitingVisibleReportLocked(this);
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}
Program: 197004
Project: 197004
Buggy source:
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    w.timeout=timeout;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.thisTime=thisTime;
    w.totalTime=totalTime;
  }
  mService.notifyAll();
}

Fixed version (ground truth):
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  boolean changed=false;
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    if (w.who == null) {
      changed=true;
      w.timeout=timeout;
      if (r != null) {
        w.who=new ComponentName(r.info.packageName,r.info.name);
      }
      w.thisTime=thisTime;
      w.totalTime=totalTime;
    }
  }
  if (changed) {
    mService.notifyAll();
  }
}
Program: 197005
Project: 197005
Buggy source:
void reportActivityVisibleLocked(ActivityRecord r){
  for (int i=mWaitingActivityVisible.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityVisible.get(i);
    w.timeout=false;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.totalTime=SystemClock.uptimeMillis() - w.thisTime;
    w.thisTime=w.totalTime;
  }
  mService.notifyAll();
  notifyActivityDrawnForKeyguard();
}

Fixed version (ground truth):
void reportActivityVisibleLocked(ActivityRecord r){
  sendWaitingVisibleReportLocked(r);
  notifyActivityDrawnForKeyguard();
}
Program: 197008
Project: 197008
Buggy source:
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}

Fixed version (ground truth):
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    mStackSupervisor.sendWaitingVisibleReportLocked(this);
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}
Program: 197009
Project: 197009
Buggy source:
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    w.timeout=timeout;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.thisTime=thisTime;
    w.totalTime=totalTime;
  }
  mService.notifyAll();
}

Fixed version (ground truth):
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  boolean changed=false;
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    if (w.who == null) {
      changed=true;
      w.timeout=timeout;
      if (r != null) {
        w.who=new ComponentName(r.info.packageName,r.info.name);
      }
      w.thisTime=thisTime;
      w.totalTime=totalTime;
    }
  }
  if (changed) {
    mService.notifyAll();
  }
}
Program: 197010
Project: 197010
Buggy source:
void reportActivityVisibleLocked(ActivityRecord r){
  for (int i=mWaitingActivityVisible.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityVisible.get(i);
    w.timeout=false;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.totalTime=SystemClock.uptimeMillis() - w.thisTime;
    w.thisTime=w.totalTime;
  }
  mService.notifyAll();
  notifyActivityDrawnForKeyguard();
}

Fixed version (ground truth):
void reportActivityVisibleLocked(ActivityRecord r){
  sendWaitingVisibleReportLocked(r);
  notifyActivityDrawnForKeyguard();
}
Program: 197013
Project: 197013
Buggy source:
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}

Fixed version (ground truth):
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    mStackSupervisor.sendWaitingVisibleReportLocked(this);
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}
Program: 197014
Project: 197014
Buggy source:
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    w.timeout=timeout;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.thisTime=thisTime;
    w.totalTime=totalTime;
  }
  mService.notifyAll();
}

Fixed version (ground truth):
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  boolean changed=false;
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    if (w.who == null) {
      changed=true;
      w.timeout=timeout;
      if (r != null) {
        w.who=new ComponentName(r.info.packageName,r.info.name);
      }
      w.thisTime=thisTime;
      w.totalTime=totalTime;
    }
  }
  if (changed) {
    mService.notifyAll();
  }
}
Program: 197015
Project: 197015
Buggy source:
void reportActivityVisibleLocked(ActivityRecord r){
  for (int i=mWaitingActivityVisible.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityVisible.get(i);
    w.timeout=false;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.totalTime=SystemClock.uptimeMillis() - w.thisTime;
    w.thisTime=w.totalTime;
  }
  mService.notifyAll();
  notifyActivityDrawnForKeyguard();
}

Fixed version (ground truth):
void reportActivityVisibleLocked(ActivityRecord r){
  sendWaitingVisibleReportLocked(r);
  notifyActivityDrawnForKeyguard();
}
Program: 197018
Project: 197018
Buggy source:
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}

Fixed version (ground truth):
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    mStackSupervisor.sendWaitingVisibleReportLocked(this);
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}
Program: 197019
Project: 197019
Buggy source:
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    w.timeout=timeout;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.thisTime=thisTime;
    w.totalTime=totalTime;
  }
  mService.notifyAll();
}

Fixed version (ground truth):
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  boolean changed=false;
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    if (w.who == null) {
      changed=true;
      w.timeout=timeout;
      if (r != null) {
        w.who=new ComponentName(r.info.packageName,r.info.name);
      }
      w.thisTime=thisTime;
      w.totalTime=totalTime;
    }
  }
  if (changed) {
    mService.notifyAll();
  }
}
Program: 197020
Project: 197020
Buggy source:
void reportActivityVisibleLocked(ActivityRecord r){
  for (int i=mWaitingActivityVisible.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityVisible.get(i);
    w.timeout=false;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.totalTime=SystemClock.uptimeMillis() - w.thisTime;
    w.thisTime=w.totalTime;
  }
  mService.notifyAll();
  notifyActivityDrawnForKeyguard();
}

Fixed version (ground truth):
void reportActivityVisibleLocked(ActivityRecord r){
  sendWaitingVisibleReportLocked(r);
  notifyActivityDrawnForKeyguard();
}
Program: 197023
Project: 197023
Buggy source:
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}

Fixed version (ground truth):
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    mStackSupervisor.sendWaitingVisibleReportLocked(this);
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}
Program: 197024
Project: 197024
Buggy source:
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    w.timeout=timeout;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.thisTime=thisTime;
    w.totalTime=totalTime;
  }
  mService.notifyAll();
}

Fixed version (ground truth):
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  boolean changed=false;
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    if (w.who == null) {
      changed=true;
      w.timeout=timeout;
      if (r != null) {
        w.who=new ComponentName(r.info.packageName,r.info.name);
      }
      w.thisTime=thisTime;
      w.totalTime=totalTime;
    }
  }
  if (changed) {
    mService.notifyAll();
  }
}
Program: 197025
Project: 197025
Buggy source:
void reportActivityVisibleLocked(ActivityRecord r){
  for (int i=mWaitingActivityVisible.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityVisible.get(i);
    w.timeout=false;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.totalTime=SystemClock.uptimeMillis() - w.thisTime;
    w.thisTime=w.totalTime;
  }
  mService.notifyAll();
  notifyActivityDrawnForKeyguard();
}

Fixed version (ground truth):
void reportActivityVisibleLocked(ActivityRecord r){
  sendWaitingVisibleReportLocked(r);
  notifyActivityDrawnForKeyguard();
}
Program: 197028
Project: 197028
Buggy source:
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}

Fixed version (ground truth):
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    mStackSupervisor.sendWaitingVisibleReportLocked(this);
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}
Program: 197029
Project: 197029
Buggy source:
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    w.timeout=timeout;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.thisTime=thisTime;
    w.totalTime=totalTime;
  }
  mService.notifyAll();
}

Fixed version (ground truth):
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  boolean changed=false;
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    if (w.who == null) {
      changed=true;
      w.timeout=timeout;
      if (r != null) {
        w.who=new ComponentName(r.info.packageName,r.info.name);
      }
      w.thisTime=thisTime;
      w.totalTime=totalTime;
    }
  }
  if (changed) {
    mService.notifyAll();
  }
}
Program: 197030
Project: 197030
Buggy source:
void reportActivityVisibleLocked(ActivityRecord r){
  for (int i=mWaitingActivityVisible.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityVisible.get(i);
    w.timeout=false;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.totalTime=SystemClock.uptimeMillis() - w.thisTime;
    w.thisTime=w.totalTime;
  }
  mService.notifyAll();
  notifyActivityDrawnForKeyguard();
}

Fixed version (ground truth):
void reportActivityVisibleLocked(ActivityRecord r){
  sendWaitingVisibleReportLocked(r);
  notifyActivityDrawnForKeyguard();
}
Program: 197033
Project: 197033
Buggy source:
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}

Fixed version (ground truth):
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    mStackSupervisor.sendWaitingVisibleReportLocked(this);
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}
Program: 197034
Project: 197034
Buggy source:
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    w.timeout=timeout;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.thisTime=thisTime;
    w.totalTime=totalTime;
  }
  mService.notifyAll();
}

Fixed version (ground truth):
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  boolean changed=false;
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    if (w.who == null) {
      changed=true;
      w.timeout=timeout;
      if (r != null) {
        w.who=new ComponentName(r.info.packageName,r.info.name);
      }
      w.thisTime=thisTime;
      w.totalTime=totalTime;
    }
  }
  if (changed) {
    mService.notifyAll();
  }
}
Program: 197035
Project: 197035
Buggy source:
void reportActivityVisibleLocked(ActivityRecord r){
  for (int i=mWaitingActivityVisible.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityVisible.get(i);
    w.timeout=false;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.totalTime=SystemClock.uptimeMillis() - w.thisTime;
    w.thisTime=w.totalTime;
  }
  mService.notifyAll();
  notifyActivityDrawnForKeyguard();
}

Fixed version (ground truth):
void reportActivityVisibleLocked(ActivityRecord r){
  sendWaitingVisibleReportLocked(r);
  notifyActivityDrawnForKeyguard();
}
Program: 197037
Project: 197037
Buggy source:
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId);
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId,Locale locale){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId,locale.toLanguageTag());
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}
Program: 197038
Project: 197038
Buggy source:
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id,mLocale);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}
Program: 197039
Project: 197039
Buggy source:
private int startRecognitionLocked(int recognitionFlags){
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,0,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  boolean allowMultipleTriggers=(recognitionFlags & RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mInternalCallback,new RecognitionConfig(captureTriggerAudio,allowMultipleTriggers,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}

Fixed version (ground truth):
private int startRecognitionLocked(int recognitionFlags){
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,0,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  boolean allowMultipleTriggers=(recognitionFlags & RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mLocale.toLanguageTag(),mInternalCallback,new RecognitionConfig(captureTriggerAudio,allowMultipleTriggers,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}
Program: 197040
Project: 197040
Buggy source:
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId);
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId,Locale locale){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId,locale.toLanguageTag());
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}
Program: 197041
Project: 197041
Buggy source:
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id,mLocale);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}
Program: 197042
Project: 197042
Buggy source:
private int startRecognitionLocked(int recognitionFlags){
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,0,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  boolean allowMultipleTriggers=(recognitionFlags & RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mInternalCallback,new RecognitionConfig(captureTriggerAudio,allowMultipleTriggers,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}

Fixed version (ground truth):
private int startRecognitionLocked(int recognitionFlags){
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,0,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  boolean allowMultipleTriggers=(recognitionFlags & RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mLocale.toLanguageTag(),mInternalCallback,new RecognitionConfig(captureTriggerAudio,allowMultipleTriggers,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}
Program: 197043
Project: 197043
Buggy source:
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId);
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId,Locale locale){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId,locale.toLanguageTag());
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}
Program: 197044
Project: 197044
Buggy source:
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id,mLocale);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}
Program: 197045
Project: 197045
Buggy source:
private int startRecognitionLocked(int recognitionFlags){
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,0,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  boolean allowMultipleTriggers=(recognitionFlags & RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mInternalCallback,new RecognitionConfig(captureTriggerAudio,allowMultipleTriggers,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}

Fixed version (ground truth):
private int startRecognitionLocked(int recognitionFlags){
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,0,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  boolean allowMultipleTriggers=(recognitionFlags & RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mLocale.toLanguageTag(),mInternalCallback,new RecognitionConfig(captureTriggerAudio,allowMultipleTriggers,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}
Program: 197046
Project: 197046
Buggy source:
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId);
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId,Locale locale){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId,locale.toLanguageTag());
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}
Program: 197047
Project: 197047
Buggy source:
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id,mLocale);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}
Program: 197048
Project: 197048
Buggy source:
private int startRecognitionLocked(int recognitionFlags){
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,0,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  boolean allowMultipleTriggers=(recognitionFlags & RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mInternalCallback,new RecognitionConfig(captureTriggerAudio,allowMultipleTriggers,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}

Fixed version (ground truth):
private int startRecognitionLocked(int recognitionFlags){
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,0,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  boolean allowMultipleTriggers=(recognitionFlags & RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mLocale.toLanguageTag(),mInternalCallback,new RecognitionConfig(captureTriggerAudio,allowMultipleTriggers,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}
Program: 197050
Project: 197050
Buggy source:
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}

Fixed version (ground truth):
public void windowsDrawn(){
synchronized (service) {
    if (displayStartTime != 0) {
      reportLaunchTimeLocked(SystemClock.uptimeMillis());
    }
    mStackSupervisor.sendWaitingVisibleReportLocked(this);
    startTime=0;
    finishLaunchTickingLocked();
    if (task != null) {
      task.hasBeenVisible=true;
    }
  }
}
Program: 197051
Project: 197051
Buggy source:
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    w.timeout=timeout;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.thisTime=thisTime;
    w.totalTime=totalTime;
  }
  mService.notifyAll();
}

Fixed version (ground truth):
void reportActivityLaunchedLocked(boolean timeout,ActivityRecord r,long thisTime,long totalTime){
  boolean changed=false;
  for (int i=mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityLaunched.remove(i);
    if (w.who == null) {
      changed=true;
      w.timeout=timeout;
      if (r != null) {
        w.who=new ComponentName(r.info.packageName,r.info.name);
      }
      w.thisTime=thisTime;
      w.totalTime=totalTime;
    }
  }
  if (changed) {
    mService.notifyAll();
  }
}
Program: 197052
Project: 197052
Buggy source:
void reportActivityVisibleLocked(ActivityRecord r){
  for (int i=mWaitingActivityVisible.size() - 1; i >= 0; i--) {
    WaitResult w=mWaitingActivityVisible.get(i);
    w.timeout=false;
    if (r != null) {
      w.who=new ComponentName(r.info.packageName,r.info.name);
    }
    w.totalTime=SystemClock.uptimeMillis() - w.thisTime;
    w.thisTime=w.totalTime;
  }
  mService.notifyAll();
  notifyActivityDrawnForKeyguard();
}

Fixed version (ground truth):
void reportActivityVisibleLocked(ActivityRecord r){
  sendWaitingVisibleReportLocked(r);
  notifyActivityDrawnForKeyguard();
}
Program: 197054
Project: 197054
Buggy source:
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId);
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId,Locale locale){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId,locale.toLanguageTag());
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}
Program: 197055
Project: 197055
Buggy source:
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id,mLocale);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}
Program: 197056
Project: 197056
Buggy source:
private int startRecognitionLocked(int recognitionFlags){
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,0,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  boolean allowMultipleTriggers=(recognitionFlags & RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mInternalCallback,new RecognitionConfig(captureTriggerAudio,allowMultipleTriggers,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}

Fixed version (ground truth):
private int startRecognitionLocked(int recognitionFlags){
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,0,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  boolean allowMultipleTriggers=(recognitionFlags & RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mLocale.toLanguageTag(),mInternalCallback,new RecognitionConfig(captureTriggerAudio,allowMultipleTriggers,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}
Program: 197057
Project: 197057
Buggy source:
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId);
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
 */
private boolean internalGetIsEnrolled(int keyphraseId,Locale locale){
  try {
    return mModelManagementService.isEnrolledForKeyphrase(mVoiceInteractionService,keyphraseId,locale.toLanguageTag());
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
  return false;
}
Program: 197058
Project: 197058
Buggy source:
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id,mLocale);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}