nus-yam/ex-repair huggingface dataset:
Program: 194586
Project: 194586
Buggy source:
/** 
 * Show the keyguard.  Will handle creating and attaching to the view manager lazily.
 */
public void show(Bundle options){
  mShowing=true;
  mStatusBarWindowManager.setKeyguardShowing(true);
  reset();
}

Fixed version (ground truth):
/** 
 * Show the keyguard.  Will handle creating and attaching to the view manager lazily.
 */
public void show(Bundle options){
  mShowing=true;
  mStatusBarWindowManager.setKeyguardShowing(true);
  mScrimController.abortKeyguardFadingOut();
  reset();
}
Program: 194587
Project: 194587
Buggy source:
/** 
 * Let us know that the system is ready after startup.
 */
public void onSystemReady(){
  mSearchManager=(SearchManager)mContext.getSystemService(Context.SEARCH_SERVICE);
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mSystemReady=true;
    mUpdateMonitor.registerCallback(mUpdateCallback);
    doKeyguardLocked(null);
  }
  maybeSendUserPresentBroadcast();
}

Fixed version (ground truth):
/** 
 * Let us know that the system is ready after startup.
 */
public void onSystemReady(){
  mSearchManager=(SearchManager)mContext.getSystemService(Context.SEARCH_SERVICE);
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mSystemReady=true;
    doKeyguardLocked(null);
    mUpdateMonitor.registerCallback(mUpdateCallback);
  }
  maybeSendUserPresentBroadcast();
}
Program: 194588
Project: 194588
Buggy source:
/** 
 * @return True if and only if the security method should be shown before showing thenotifications on Keyguard, like SIM PIN/PUK.
 */
public boolean needsFullscreenBouncer(){
  if (mKeyguardView != null) {
    SecurityMode mode=mKeyguardView.getSecurityMode();
    return mode == SecurityMode.SimPin || mode == SecurityMode.SimPuk;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return True if and only if the security method should be shown before showing thenotifications on Keyguard, like SIM PIN/PUK.
 */
public boolean needsFullscreenBouncer(){
  ensureView();
  if (mKeyguardView != null) {
    SecurityMode mode=mKeyguardView.getSecurityMode();
    return mode == SecurityMode.SimPin || mode == SecurityMode.SimPuk;
  }
  return false;
}
Program: 194589
Project: 194589
Buggy source:
@Override public boolean onPreDraw(){
  mScrimBehind.getViewTreeObserver().removeOnPreDrawListener(this);
  mUpdatePending=false;
  updateScrims();
  mAnimateKeyguardFadingOut=false;
  mDurationOverride=-1;
  mAnimationDelay=0;
  if (!mAnimationStarted && mOnAnimationFinished != null) {
    mOnAnimationFinished.run();
    mOnAnimationFinished=null;
  }
  mAnimationStarted=false;
  return true;
}

Fixed version (ground truth):
@Override public boolean onPreDraw(){
  mScrimBehind.getViewTreeObserver().removeOnPreDrawListener(this);
  mUpdatePending=false;
  updateScrims();
  mDurationOverride=-1;
  mAnimationDelay=0;
  endAnimateKeyguardFadingOut();
  mAnimationStarted=false;
  return true;
}
Program: 194590
Project: 194590
Buggy source:
/** 
 * Show the keyguard.  Will handle creating and attaching to the view manager lazily.
 */
public void show(Bundle options){
  mShowing=true;
  mStatusBarWindowManager.setKeyguardShowing(true);
  reset();
}

Fixed version (ground truth):
/** 
 * Show the keyguard.  Will handle creating and attaching to the view manager lazily.
 */
public void show(Bundle options){
  mShowing=true;
  mStatusBarWindowManager.setKeyguardShowing(true);
  mScrimController.abortKeyguardFadingOut();
  reset();
}
Program: 194591
Project: 194591
Buggy source:
/** 
 * Let us know that the system is ready after startup.
 */
public void onSystemReady(){
  mSearchManager=(SearchManager)mContext.getSystemService(Context.SEARCH_SERVICE);
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mSystemReady=true;
    mUpdateMonitor.registerCallback(mUpdateCallback);
    doKeyguardLocked(null);
  }
  maybeSendUserPresentBroadcast();
}

Fixed version (ground truth):
/** 
 * Let us know that the system is ready after startup.
 */
public void onSystemReady(){
  mSearchManager=(SearchManager)mContext.getSystemService(Context.SEARCH_SERVICE);
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mSystemReady=true;
    doKeyguardLocked(null);
    mUpdateMonitor.registerCallback(mUpdateCallback);
  }
  maybeSendUserPresentBroadcast();
}
Program: 194592
Project: 194592
Buggy source:
/** 
 * @return True if and only if the security method should be shown before showing thenotifications on Keyguard, like SIM PIN/PUK.
 */
public boolean needsFullscreenBouncer(){
  if (mKeyguardView != null) {
    SecurityMode mode=mKeyguardView.getSecurityMode();
    return mode == SecurityMode.SimPin || mode == SecurityMode.SimPuk;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return True if and only if the security method should be shown before showing thenotifications on Keyguard, like SIM PIN/PUK.
 */
public boolean needsFullscreenBouncer(){
  ensureView();
  if (mKeyguardView != null) {
    SecurityMode mode=mKeyguardView.getSecurityMode();
    return mode == SecurityMode.SimPin || mode == SecurityMode.SimPuk;
  }
  return false;
}
Program: 194593
Project: 194593
Buggy source:
@Override public boolean onPreDraw(){
  mScrimBehind.getViewTreeObserver().removeOnPreDrawListener(this);
  mUpdatePending=false;
  updateScrims();
  mAnimateKeyguardFadingOut=false;
  mDurationOverride=-1;
  mAnimationDelay=0;
  if (!mAnimationStarted && mOnAnimationFinished != null) {
    mOnAnimationFinished.run();
    mOnAnimationFinished=null;
  }
  mAnimationStarted=false;
  return true;
}

Fixed version (ground truth):
@Override public boolean onPreDraw(){
  mScrimBehind.getViewTreeObserver().removeOnPreDrawListener(this);
  mUpdatePending=false;
  updateScrims();
  mDurationOverride=-1;
  mAnimationDelay=0;
  endAnimateKeyguardFadingOut();
  mAnimationStarted=false;
  return true;
}
Program: 194594
Project: 194594
Buggy source:
/** 
 * Show the keyguard.  Will handle creating and attaching to the view manager lazily.
 */
public void show(Bundle options){
  mShowing=true;
  mStatusBarWindowManager.setKeyguardShowing(true);
  reset();
}

Fixed version (ground truth):
/** 
 * Show the keyguard.  Will handle creating and attaching to the view manager lazily.
 */
public void show(Bundle options){
  mShowing=true;
  mStatusBarWindowManager.setKeyguardShowing(true);
  mScrimController.abortKeyguardFadingOut();
  reset();
}
Program: 194601
Project: 194601
Buggy source:
/** 
 * Let us know that the system is ready after startup.
 */
public void onSystemReady(){
  mSearchManager=(SearchManager)mContext.getSystemService(Context.SEARCH_SERVICE);
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mSystemReady=true;
    mUpdateMonitor.registerCallback(mUpdateCallback);
    doKeyguardLocked(null);
  }
  maybeSendUserPresentBroadcast();
}

Fixed version (ground truth):
/** 
 * Let us know that the system is ready after startup.
 */
public void onSystemReady(){
  mSearchManager=(SearchManager)mContext.getSystemService(Context.SEARCH_SERVICE);
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mSystemReady=true;
    doKeyguardLocked(null);
    mUpdateMonitor.registerCallback(mUpdateCallback);
  }
  maybeSendUserPresentBroadcast();
}
Program: 194602
Project: 194602
Buggy source:
/** 
 * @return True if and only if the security method should be shown before showing thenotifications on Keyguard, like SIM PIN/PUK.
 */
public boolean needsFullscreenBouncer(){
  if (mKeyguardView != null) {
    SecurityMode mode=mKeyguardView.getSecurityMode();
    return mode == SecurityMode.SimPin || mode == SecurityMode.SimPuk;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return True if and only if the security method should be shown before showing thenotifications on Keyguard, like SIM PIN/PUK.
 */
public boolean needsFullscreenBouncer(){
  ensureView();
  if (mKeyguardView != null) {
    SecurityMode mode=mKeyguardView.getSecurityMode();
    return mode == SecurityMode.SimPin || mode == SecurityMode.SimPuk;
  }
  return false;
}
Program: 194603
Project: 194603
Buggy source:
@Override public boolean onPreDraw(){
  mScrimBehind.getViewTreeObserver().removeOnPreDrawListener(this);
  mUpdatePending=false;
  updateScrims();
  mAnimateKeyguardFadingOut=false;
  mDurationOverride=-1;
  mAnimationDelay=0;
  if (!mAnimationStarted && mOnAnimationFinished != null) {
    mOnAnimationFinished.run();
    mOnAnimationFinished=null;
  }
  mAnimationStarted=false;
  return true;
}

Fixed version (ground truth):
@Override public boolean onPreDraw(){
  mScrimBehind.getViewTreeObserver().removeOnPreDrawListener(this);
  mUpdatePending=false;
  updateScrims();
  mDurationOverride=-1;
  mAnimationDelay=0;
  endAnimateKeyguardFadingOut();
  mAnimationStarted=false;
  return true;
}
Program: 194604
Project: 194604
Buggy source:
/** 
 * Show the keyguard.  Will handle creating and attaching to the view manager lazily.
 */
public void show(Bundle options){
  mShowing=true;
  mStatusBarWindowManager.setKeyguardShowing(true);
  reset();
}

Fixed version (ground truth):
/** 
 * Show the keyguard.  Will handle creating and attaching to the view manager lazily.
 */
public void show(Bundle options){
  mShowing=true;
  mStatusBarWindowManager.setKeyguardShowing(true);
  mScrimController.abortKeyguardFadingOut();
  reset();
}
Program: 194605
Project: 194605
Buggy source:
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
}

Fixed version (ground truth):
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
  mAssistManager.onUserSwitched(newUserId);
}
Program: 194606
Project: 194606
Buggy source:
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
}

Fixed version (ground truth):
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
  mAssistManager.onUserSwitched(newUserId);
}
Program: 194607
Project: 194607
Buggy source:
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 30000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}
Program: 194608
Project: 194608
Buggy source:
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 30000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}
Program: 194609
Project: 194609
Buggy source:
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 30000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}
Program: 194610
Project: 194610
Buggy source:
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
}

Fixed version (ground truth):
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
  mAssistManager.onUserSwitched(newUserId);
}
Program: 194611
Project: 194611
Buggy source:
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 30000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}
Program: 194612
Project: 194612
Buggy source:
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
}

Fixed version (ground truth):
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
  mAssistManager.onUserSwitched(newUserId);
}
Program: 194613
Project: 194613
Buggy source:
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 30000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}
Program: 194614
Project: 194614
Buggy source:
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
}

Fixed version (ground truth):
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
  mAssistManager.onUserSwitched(newUserId);
}
Program: 194615
Project: 194615
Buggy source:
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
}

Fixed version (ground truth):
@Override public void userSwitched(int newUserId){
  super.userSwitched(newUserId);
  if (MULTIUSER_DEBUG)   mNotificationPanelDebugText.setText("String_Node_Str" + newUserId);
  animateCollapsePanels();
  updatePublicMode();
  updateNotifications();
  resetUserSetupObserver();
  setControllerUsers();
  mAssistManager.onUserSwitched(newUserId);
}
Program: 194616
Project: 194616
Buggy source:
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  pae.intent.replaceExtras(pae.extras);
  pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
  closeSystemDialogs("String_Node_Str");
  try {
    mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
  }
 catch (  ActivityNotFoundException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  long ident=Binder.clearCallingIdentity();
  try {
    pae.intent.replaceExtras(pae.extras);
    pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    closeSystemDialogs("String_Node_Str");
    try {
      mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
    }
 catch (    ActivityNotFoundException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 194617
Project: 194617
Buggy source:
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  pae.intent.replaceExtras(pae.extras);
  pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
  closeSystemDialogs("String_Node_Str");
  try {
    mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
  }
 catch (  ActivityNotFoundException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  long ident=Binder.clearCallingIdentity();
  try {
    pae.intent.replaceExtras(pae.extras);
    pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    closeSystemDialogs("String_Node_Str");
    try {
      mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
    }
 catch (    ActivityNotFoundException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 194618
Project: 194618
Buggy source:
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 30000) {
      String front=info.crashInfo.stackTrace.substring(256);
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ front);
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}
Program: 194619
Project: 194619
Buggy source:
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  pae.intent.replaceExtras(pae.extras);
  pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
  closeSystemDialogs("String_Node_Str");
  try {
    mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
  }
 catch (  ActivityNotFoundException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  long ident=Binder.clearCallingIdentity();
  try {
    pae.intent.replaceExtras(pae.extras);
    pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    closeSystemDialogs("String_Node_Str");
    try {
      mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
    }
 catch (    ActivityNotFoundException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 194620
Project: 194620
Buggy source:
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  pae.intent.replaceExtras(pae.extras);
  pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
  closeSystemDialogs("String_Node_Str");
  try {
    mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
  }
 catch (  ActivityNotFoundException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  long ident=Binder.clearCallingIdentity();
  try {
    pae.intent.replaceExtras(pae.extras);
    pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    closeSystemDialogs("String_Node_Str");
    try {
      mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
    }
 catch (    ActivityNotFoundException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 194621
Project: 194621
Buggy source:
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  pae.intent.replaceExtras(pae.extras);
  pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
  closeSystemDialogs("String_Node_Str");
  try {
    mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
  }
 catch (  ActivityNotFoundException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  long ident=Binder.clearCallingIdentity();
  try {
    pae.intent.replaceExtras(pae.extras);
    pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    closeSystemDialogs("String_Node_Str");
    try {
      mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
    }
 catch (    ActivityNotFoundException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}