nus-yam/ex-repair huggingface dataset:
Program: 191025
Project: 191025
Buggy source:
@Override public void interfaceStatusChanged(String iface,boolean up){
  if (VDBG)   Log.d(TAG,"String_Node_Str" + iface + "String_Node_Str"+ up);
  boolean found=false;
  boolean usb=false;
  WifiManager mWifiManager=(WifiManager)mContext.getSystemService(Context.WIFI_SERVICE);
synchronized (mPublicSync) {
    if (isWifi(iface)) {
      found=true;
    }
 else     if (isUsb(iface)) {
      found=true;
      usb=true;
    }
 else     if (isBluetooth(iface)) {
      found=true;
    }
    if (found == false)     return;
    TetherInterfaceSM sm=mIfaces.get(iface);
    if (up) {
      if (sm == null) {
        sm=new TetherInterfaceSM(iface,mLooper,usb);
        mIfaces.put(iface,sm);
        sm.start();
      }
    }
 else {
      if (isUsb(iface)) {
        if (VDBG)         Log.d(TAG,"String_Node_Str" + iface);
      }
 else       if (isWifi(iface) && (mWifiManager != null) && mWifiManager.getWifiStaSapConcurrency()) {
        int wifiApState=0;
        wifiApState=mWifiManager.getWifiApState();
        if ((wifiApState == WifiManager.WIFI_AP_STATE_DISABLING) || (wifiApState == WifiManager.WIFI_AP_STATE_DISABLED)) {
          if (VDBG)           Log.d(TAG,"String_Node_Str" + iface);
          sm.sendMessage(TetherInterfaceSM.CMD_INTERFACE_DOWN);
          mIfaces.remove(iface);
        }
 else {
          if (VDBG)           Log.d(TAG,"String_Node_Str" + iface);
        }
      }
 else       if (sm != null) {
        sm.sendMessage(TetherInterfaceSM.CMD_INTERFACE_DOWN);
        mIfaces.remove(iface);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void interfaceStatusChanged(String iface,boolean up){
  if (VDBG)   Log.d(TAG,"String_Node_Str" + iface + "String_Node_Str"+ up);
  boolean found=false;
  boolean usb=false;
  WifiManager mWifiManager=(WifiManager)mContext.getSystemService(Context.WIFI_SERVICE);
synchronized (mPublicSync) {
    if (isWifi(iface)) {
      found=true;
    }
 else     if (isUsb(iface)) {
      found=true;
      usb=true;
    }
 else     if (isBluetooth(iface)) {
      found=true;
    }
    if (found == false)     return;
    TetherInterfaceSM sm=mIfaces.get(iface);
    if (up) {
      if (sm == null) {
        sm=new TetherInterfaceSM(iface,mLooper,usb);
        mIfaces.put(iface,sm);
        sm.start();
      }
    }
 else {
      if (isUsb(iface) || isBluetooth(iface) || isWifi(iface)) {
        if (VDBG)         Log.d(TAG,"String_Node_Str" + iface);
      }
 else       if (sm != null) {
        sm.sendMessage(TetherInterfaceSM.CMD_INTERFACE_DOWN);
        mIfaces.remove(iface);
      }
    }
  }
}
Program: 191028
Project: 191028
Buggy source:
public void onNotificationUpdated(NotificationData.Entry entry){
  mEntry=entry;
  mStatusBarNotification=entry.notification;
  mPrivateLayout.onNotificationUpdated(entry);
  mPublicLayout.onNotificationUpdated(entry);
  mShowingPublicInitialized=false;
  updateNotificationColor();
  updateClearability();
  if (mIsSummaryWithChildren) {
    mChildrenContainer.recreateNotificationHeader(mExpandClickListener,mEntry.notification);
    mChildrenContainer.onNotificationUpdated();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  if (mNotificationParent != null) {
    mNotificationParent.updateChildrenHeaderAppearance();
  }
  onChildrenCountChanged();
  mPublicLayout.updateExpandButtons(true);
  updateLimits();
}

Fixed version (ground truth):
public void onNotificationUpdated(NotificationData.Entry entry){
  mEntry=entry;
  mStatusBarNotification=entry.notification;
  mPrivateLayout.onNotificationUpdated(entry);
  mPublicLayout.onNotificationUpdated(entry);
  mShowingPublicInitialized=false;
  updateNotificationColor();
  if (mIsSummaryWithChildren) {
    mChildrenContainer.recreateNotificationHeader(mExpandClickListener,mEntry.notification);
    mChildrenContainer.onNotificationUpdated();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  if (mNotificationParent != null) {
    mNotificationParent.updateChildrenHeaderAppearance();
  }
  onChildrenCountChanged();
  mPublicLayout.updateExpandButtons(true);
  updateLimits();
}
Program: 191029
Project: 191029
Buggy source:
private boolean canViewBeDismissed(){
  return isClearable() && (!mShowingPublic || !mSensitiveHiddenInGeneral);
}

Fixed version (ground truth):
/** 
 * @return Whether this view is allowed to be dismissed. Only valid for visible notifications asotherwise some state might not be updated. To request about the general clearability see  {@link #isClearable()}.
 */
public boolean canViewBeDismissed(){
  return isClearable() && (!mShowingPublic || !mSensitiveHiddenInGeneral);
}
Program: 191030
Project: 191030
Buggy source:
/** 
 * @return Can the underlying notification be cleared?
 */
public boolean isClearable(){
  return mStatusBarNotification != null && mStatusBarNotification.isClearable();
}

Fixed version (ground truth):
/** 
 * @return Can the underlying notification be cleared? This can be different from whether thenotification can be dismissed in case notifications are sensitive on the lockscreen.
 * @see #canViewBeDismissed()
 */
public boolean isClearable(){
  return mStatusBarNotification != null && mStatusBarNotification.isClearable();
}
Program: 191032
Project: 191032
Buggy source:
public void setHideSensitive(boolean hideSensitive,boolean animated,long delay,long duration){
  boolean oldShowingPublic=mShowingPublic;
  mShowingPublic=mSensitive && hideSensitive;
  if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
    return;
  }
  if (mPublicLayout.getChildCount() == 0)   return;
  if (!animated) {
    mPublicLayout.animate().cancel();
    mPrivateLayout.animate().cancel();
    if (mChildrenContainer != null) {
      mChildrenContainer.animate().cancel();
      mChildrenContainer.setAlpha(1f);
    }
    mPublicLayout.setAlpha(1f);
    mPrivateLayout.setAlpha(1f);
    mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
    updateChildrenVisibility();
  }
 else {
    animateShowingPublic(delay,duration);
  }
  NotificationContentView showingLayout=getShowingLayout();
  showingLayout.updateBackgroundColor(animated);
  mPrivateLayout.updateExpandButtons(isExpandable());
  updateClearability();
  mShowingPublicInitialized=true;
}

Fixed version (ground truth):
public void setHideSensitive(boolean hideSensitive,boolean animated,long delay,long duration){
  boolean oldShowingPublic=mShowingPublic;
  mShowingPublic=mSensitive && hideSensitive;
  if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
    return;
  }
  if (mPublicLayout.getChildCount() == 0)   return;
  if (!animated) {
    mPublicLayout.animate().cancel();
    mPrivateLayout.animate().cancel();
    if (mChildrenContainer != null) {
      mChildrenContainer.animate().cancel();
      mChildrenContainer.setAlpha(1f);
    }
    mPublicLayout.setAlpha(1f);
    mPrivateLayout.setAlpha(1f);
    mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
    updateChildrenVisibility();
  }
 else {
    animateShowingPublic(delay,duration);
  }
  NotificationContentView showingLayout=getShowingLayout();
  showingLayout.updateBackgroundColor(animated);
  mPrivateLayout.updateExpandButtons(isExpandable());
  mShowingPublicInitialized=true;
}
Program: 191033
Project: 191033
Buggy source:
public static void performDismiss(View v,NotificationGroupManager groupManager,boolean fromAccessibility){
  if (v instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)v;
    if (groupManager.isOnlyChildInGroup(row.getStatusBarNotification())) {
      ExpandableNotificationRow groupSummary=groupManager.getLogicalGroupSummary(row.getStatusBarNotification());
      if (groupSummary.isClearable()) {
        performDismiss(groupSummary,groupManager,fromAccessibility);
      }
    }
    row.setDismissed(true,fromAccessibility);
  }
  final View veto=v.findViewById(R.id.veto);
  if (veto != null && veto.getVisibility() != View.GONE) {
    veto.performClick();
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + v);
}

Fixed version (ground truth):
public static void performDismiss(View v,NotificationGroupManager groupManager,boolean fromAccessibility){
  if (!(v instanceof ExpandableNotificationRow)) {
    return;
  }
  ExpandableNotificationRow row=(ExpandableNotificationRow)v;
  if (groupManager.isOnlyChildInGroup(row.getStatusBarNotification())) {
    ExpandableNotificationRow groupSummary=groupManager.getLogicalGroupSummary(row.getStatusBarNotification());
    if (groupSummary.isClearable()) {
      performDismiss(groupSummary,groupManager,fromAccessibility);
    }
  }
  row.setDismissed(true,fromAccessibility);
  if (row.isClearable()) {
    row.performDismiss();
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + v);
}
Program: 191034
Project: 191034
Buggy source:
public static boolean canChildBeDismissed(View v){
  if (v instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)v;
    if (row.areGutsExposed()) {
      return false;
    }
  }
  final View veto=v.findViewById(R.id.veto);
  return (veto != null && veto.getVisibility() != View.GONE);
}

Fixed version (ground truth):
public static boolean canChildBeDismissed(View v){
  if (!(v instanceof ExpandableNotificationRow)) {
    return false;
  }
  ExpandableNotificationRow row=(ExpandableNotificationRow)v;
  if (row.areGutsExposed()) {
    return false;
  }
  return row.canViewBeDismissed();
}
Program: 191035
Project: 191035
Buggy source:
/** 
 * Authentication result
 * @param crypto the crypto object
 * @param fingerprint the recognized fingerprint data, if allowed.
 * @hide
 */
public AuthenticationResult(CryptoObject crypto,Fingerprint fingerprint){
  mCryptoObject=crypto;
  mFingerprint=fingerprint;
}

Fixed version (ground truth):
/** 
 * Authentication result
 * @param crypto the crypto object
 * @param fingerprint the recognized fingerprint data, if allowed.
 * @hide
 */
public AuthenticationResult(CryptoObject crypto,Fingerprint fingerprint,int userId){
  mCryptoObject=crypto;
  mFingerprint=fingerprint;
  mUserId=userId;
}
Program: 191036
Project: 191036
Buggy source:
@Override public void onAuthenticationSucceeded(long deviceId,Fingerprint fp){
  mHandler.obtainMessage(MSG_AUTHENTICATION_SUCCEEDED,fp).sendToTarget();
}

Fixed version (ground truth):
@Override public void onAuthenticationSucceeded(long deviceId,Fingerprint fp,int userId){
  mHandler.obtainMessage(MSG_AUTHENTICATION_SUCCEEDED,userId,0,fp).sendToTarget();
}
Program: 191037
Project: 191037
Buggy source:
@Override public void handleMessage(android.os.Message msg){
switch (msg.what) {
case MSG_ENROLL_RESULT:
    sendEnrollResult((Fingerprint)msg.obj,msg.arg1);
  break;
case MSG_ACQUIRED:
sendAcquiredResult((Long)msg.obj,msg.arg1);
break;
case MSG_AUTHENTICATION_SUCCEEDED:
sendAuthenticatedSucceeded((Fingerprint)msg.obj);
break;
case MSG_AUTHENTICATION_FAILED:
sendAuthenticatedFailed();
break;
case MSG_ERROR:
sendErrorResult((Long)msg.obj,msg.arg1);
break;
case MSG_REMOVED:
sendRemovedResult((Long)msg.obj,msg.arg1,msg.arg2);
}
}

Fixed version (ground truth):
@Override public void handleMessage(android.os.Message msg){
switch (msg.what) {
case MSG_ENROLL_RESULT:
    sendEnrollResult((Fingerprint)msg.obj,msg.arg1);
  break;
case MSG_ACQUIRED:
sendAcquiredResult((Long)msg.obj,msg.arg1);
break;
case MSG_AUTHENTICATION_SUCCEEDED:
sendAuthenticatedSucceeded((Fingerprint)msg.obj,msg.arg1);
break;
case MSG_AUTHENTICATION_FAILED:
sendAuthenticatedFailed();
break;
case MSG_ERROR:
sendErrorResult((Long)msg.obj,msg.arg1);
break;
case MSG_REMOVED:
sendRemovedResult((Long)msg.obj,msg.arg1,msg.arg2);
}
}
Program: 191038
Project: 191038
Buggy source:
private void sendAuthenticatedSucceeded(Fingerprint fp){
  if (mAuthenticationCallback != null) {
    final AuthenticationResult result=new AuthenticationResult(mCryptoObject,fp);
    mAuthenticationCallback.onAuthenticationSucceeded(result);
  }
}

Fixed version (ground truth):
private void sendAuthenticatedSucceeded(Fingerprint fp,int userId){
  if (mAuthenticationCallback != null) {
    final AuthenticationResult result=new AuthenticationResult(mCryptoObject,fp,userId);
    mAuthenticationCallback.onAuthenticationSucceeded(result);
  }
}
Program: 191039
Project: 191039
Buggy source:
private void generateHeadsUpAnimationEvents(){
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    int type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER;
    boolean onBottom=false;
    boolean pinnedAndClosed=row.isPinned() && !mIsExpanded;
    if (!mIsExpanded && !isHeadsUp) {
      type=row.wasJustClicked() ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR;
    }
 else {
      StackViewState viewState=mCurrentStackScrollState.getViewStateForView(row);
      if (viewState == null) {
        continue;
      }
      if (isHeadsUp && (mAddedHeadsUpChildren.contains(row) || pinnedAndClosed)) {
        if (pinnedAndClosed || shouldHunAppearFromBottom(viewState)) {
          type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_APPEAR;
        }
 else {
          type=AnimationEvent.ANIMATION_TYPE_ADD;
        }
        onBottom=!pinnedAndClosed;
      }
    }
    AnimationEvent event=new AnimationEvent(row,type);
    event.headsUpFromBottom=onBottom;
    mAnimationEvents.add(event);
  }
  mHeadsUpChangeAnimations.clear();
  mAddedHeadsUpChildren.clear();
}

Fixed version (ground truth):
private void generateHeadsUpAnimationEvents(){
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    int type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER;
    boolean onBottom=false;
    boolean pinnedAndClosed=row.isPinned() && !mIsExpanded;
    if (!mIsExpanded && !isHeadsUp) {
      type=row.wasJustClicked() ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR;
      if (row.isChildInGroup()) {
        row.setHeadsupDisappearRunning(false);
      }
    }
 else {
      StackViewState viewState=mCurrentStackScrollState.getViewStateForView(row);
      if (viewState == null) {
        continue;
      }
      if (isHeadsUp && (mAddedHeadsUpChildren.contains(row) || pinnedAndClosed)) {
        if (pinnedAndClosed || shouldHunAppearFromBottom(viewState)) {
          type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_APPEAR;
        }
 else {
          type=AnimationEvent.ANIMATION_TYPE_ADD;
        }
        onBottom=!pinnedAndClosed;
      }
    }
    AnimationEvent event=new AnimationEvent(row,type);
    event.headsUpFromBottom=onBottom;
    mAnimationEvents.add(event);
  }
  mHeadsUpChangeAnimations.clear();
  mAddedHeadsUpChildren.clear();
}
Program: 191040
Project: 191040
Buggy source:
/** 
 * Remove a removed child view from the heads up animations if it was just added there
 * @return whether any child was removed from the list to animate
 */
private boolean removeRemovedChildFromHeadsUpChangeAnimations(View child){
  boolean hasAddEvent=false;
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    if (child == row) {
      mTmpList.add(eventPair);
      hasAddEvent|=isHeadsUp;
    }
  }
  if (hasAddEvent) {
    mHeadsUpChangeAnimations.removeAll(mTmpList);
  }
  mTmpList.clear();
  return hasAddEvent;
}

Fixed version (ground truth):
/** 
 * Remove a removed child view from the heads up animations if it was just added there
 * @return whether any child was removed from the list to animate
 */
private boolean removeRemovedChildFromHeadsUpChangeAnimations(View child){
  boolean hasAddEvent=false;
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    if (child == row) {
      mTmpList.add(eventPair);
      hasAddEvent|=isHeadsUp;
    }
  }
  if (hasAddEvent) {
    mHeadsUpChangeAnimations.removeAll(mTmpList);
    ((ExpandableNotificationRow)child).setHeadsupDisappearRunning(false);
  }
  mTmpList.clear();
  return hasAddEvent;
}
Program: 191041
Project: 191041
Buggy source:
public void onChildAnimationFinished(){
  setAnimationRunning(false);
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
  clearViewOverlays();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  setAnimationRunning(false);
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
  clearViewOverlays();
  clearHeadsUpDisappearRunning();
}
Program: 191044
Project: 191044
Buggy source:
private void maybeSwapSearchIcon(@NonNull ComponentName assistComponent,boolean isService){
  replaceDrawable(mView.getOrb().getLogo(),assistComponent,ASSIST_ICON_METADATA_NAME,isService);
}

Fixed version (ground truth):
private void maybeSwapSearchIcon(@NonNull ComponentName assistComponent,boolean isService){
  if (mView == null) {
    onConfigurationChanged();
  }
  replaceDrawable(mView.getOrb().getLogo(),assistComponent,ASSIST_ICON_METADATA_NAME,isService);
}
Program: 191046
Project: 191046
Buggy source:
void goodToGo(AppWindowAnimator topOpeningAppAnimator,AppWindowAnimator topClosingAppAnimator,ArraySet<AppWindowToken> openingApps,ArraySet<AppWindowToken> closingApps){
  mNextAppTransition=TRANSIT_UNSET;
  mAppTransitionState=APP_STATE_RUNNING;
  notifyAppTransitionStartingLocked(topOpeningAppAnimator != null ? topOpeningAppAnimator.mAppToken.token : null,topClosingAppAnimator != null ? topClosingAppAnimator.mAppToken.token : null,topOpeningAppAnimator != null ? topOpeningAppAnimator.animation : null,topClosingAppAnimator != null ? topClosingAppAnimator.animation : null);
  mService.getDefaultDisplayContentLocked().getDockedDividerController().notifyAppTransitionStarting();
  if (mNextAppTransition == TRANSIT_DOCK_TASK_FROM_RECENTS && !mProlongedAnimationsEnded) {
    for (int i=openingApps.size() - 1; i >= 0; i--) {
      final AppWindowAnimator appAnimator=openingApps.valueAt(i).mAppAnimator;
      appAnimator.startProlongAnimation(PROLONG_ANIMATION_AT_START);
    }
  }
}

Fixed version (ground truth):
void goodToGo(AppWindowAnimator topOpeningAppAnimator,AppWindowAnimator topClosingAppAnimator,ArraySet<AppWindowToken> openingApps,ArraySet<AppWindowToken> closingApps){
  mNextAppTransition=TRANSIT_UNSET;
  mAppTransitionState=APP_STATE_RUNNING;
  notifyAppTransitionStartingLocked(topOpeningAppAnimator != null ? topOpeningAppAnimator.mAppToken.token : null,topClosingAppAnimator != null ? topClosingAppAnimator.mAppToken.token : null,topOpeningAppAnimator != null ? topOpeningAppAnimator.animation : null,topClosingAppAnimator != null ? topClosingAppAnimator.animation : null);
  mService.getDefaultDisplayContentLocked().getDockedDividerController().notifyAppTransitionStarting(openingApps);
  if (mNextAppTransition == TRANSIT_DOCK_TASK_FROM_RECENTS && !mProlongedAnimationsEnded) {
    for (int i=openingApps.size() - 1; i >= 0; i--) {
      final AppWindowAnimator appAnimator=openingApps.valueAt(i).mAppAnimator;
      appAnimator.startProlongAnimation(PROLONG_ANIMATION_AT_START);
    }
  }
}
Program: 191047
Project: 191047
Buggy source:
void notifyAppTransitionStarting(){
  checkMinimizeChanged(true);
}

Fixed version (ground truth):
void notifyAppTransitionStarting(ArraySet<AppWindowToken> openingApps){
  final boolean wasMinimized=mMinimizedDock;
  checkMinimizeChanged(true);
  if (wasMinimized && mMinimizedDock && containsAppInDockedStack(openingApps)) {
    mService.showRecentApps(true);
  }
}
Program: 191049
Project: 191049
Buggy source:
@Override public void dump(String prefix,FileDescriptor fd,PrintWriter writer,String[] args){
  super.dump(prefix,fd,writer,args);
  EventBus.getDefault().dump(prefix,writer);
  Recents.getTaskLoader().dump(prefix,writer);
  String id=Integer.toHexString(System.identityHashCode(this));
  long lastStackActiveTime=Prefs.getLong(this,Prefs.Key.OVERVIEW_LAST_STACK_TASK_ACTIVE_TIME,-1);
  writer.print(prefix);
  writer.print(TAG);
  writer.print("String_Node_Str");
  writer.print(mIsVisible ? "String_Node_Str" : "String_Node_Str");
  writer.print("String_Node_Str");
  writer.print(lastStackActiveTime);
  writer.print("String_Node_Str");
  writer.print(System.currentTimeMillis());
  writer.print("String_Node_Str");
  writer.print(id);
  writer.print("String_Node_Str");
  writer.println();
  if (mRecentsView != null) {
    mRecentsView.dump(prefix,writer);
  }
}

Fixed version (ground truth):
@Override public void dump(String prefix,FileDescriptor fd,PrintWriter writer,String[] args){
  super.dump(prefix,fd,writer,args);
  EventBus.getDefault().dump(prefix,writer);
  Recents.getTaskLoader().dump(prefix,writer);
  ContentResolver cr=getContentResolver();
  long lastPersistUptime=Settings.Secure.getLong(cr,Settings.Secure.TASK_PERSISTER_LAST_WRITE_UPTIME,0);
  long lastVisibleTaskActiveUptime=Settings.Secure.getLongForUser(cr,Settings.Secure.OVERVIEW_LAST_VISIBLE_TASK_ACTIVE_UPTIME,SystemClock.elapsedRealtime(),Recents.getSystemServices().getCurrentUser());
  String id=Integer.toHexString(System.identityHashCode(this));
  writer.print(prefix);
  writer.print(TAG);
  writer.print("String_Node_Str");
  writer.print(mIsVisible ? "String_Node_Str" : "String_Node_Str");
  writer.print("String_Node_Str");
  writer.print(lastPersistUptime);
  writer.print("String_Node_Str");
  writer.print(lastVisibleTaskActiveUptime);
  writer.print("String_Node_Str");
  writer.print(id);
  writer.print("String_Node_Str");
  writer.println();
  if (mRecentsView != null) {
    mRecentsView.dump(prefix,writer);
  }
}
Program: 191051
Project: 191051
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (action.equals(Intent.ACTION_SCREEN_OFF)) {
    dismissRecentsToHomeIfVisible(false);
  }
 else   if (action.equals(Intent.ACTION_TIME_CHANGED)) {
    Prefs.putLong(RecentsActivity.this,Prefs.Key.OVERVIEW_LAST_STACK_TASK_ACTIVE_TIME,0);
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (action.equals(Intent.ACTION_SCREEN_OFF)) {
    dismissRecentsToHomeIfVisible(false);
  }
}
Program: 191054
Project: 191054
Buggy source:
/** 
 * An optimization to preload the raw list of tasks. The raw tasks are saved in least-recent to most-recent order.
 */
public synchronized void preloadRawTasks(boolean includeFrontMostExcludedTask){
  int currentUserId=UserHandle.USER_CURRENT;
  updateCurrentQuietProfilesCache(currentUserId);
  SystemServicesProxy ssp=Recents.getSystemServices();
  mRawTasks=ssp.getRecentTasks(ActivityManager.getMaxRecentTasksStatic(),currentUserId,includeFrontMostExcludedTask,mCurrentQuietProfiles);
  Collections.reverse(mRawTasks);
}

Fixed version (ground truth):
/** 
 * An optimization to preload the raw list of tasks. The raw tasks are saved in least-recent to most-recent order.
 */
public synchronized void preloadRawTasks(boolean includeFrontMostExcludedTask){
  int currentUserId=UserHandle.USER_CURRENT;
  updateCurrentQuietProfilesCache(currentUserId);
  mRawTasks=mSystemServicesProxy.getRecentTasks(ActivityManager.getMaxRecentTasksStatic(),currentUserId,includeFrontMostExcludedTask,mCurrentQuietProfiles);
  mLastVisibileTaskActiveTime=RecentsDebugFlags.Static.EnableMockTasks ? SystemClock.elapsedRealtime() : Settings.Secure.getLongForUser(mContext.getContentResolver(),Settings.Secure.OVERVIEW_LAST_VISIBLE_TASK_ACTIVE_UPTIME,0,currentUserId);
  Collections.reverse(mRawTasks);
}
Program: 191055
Project: 191055
Buggy source:
/** 
 * Package level ctor 
 */
RecentsTaskLoadPlan(Context context){
  mContext=context;
}

Fixed version (ground truth):
@VisibleForTesting public RecentsTaskLoadPlan(Context context,SystemServicesProxy ssp){
  mContext=context;
  mSystemServicesProxy=ssp;
}
Program: 191060
Project: 191060
Buggy source:
void goodToGo(AppWindowAnimator topOpeningAppAnimator,AppWindowAnimator topClosingAppAnimator,ArraySet<AppWindowToken> openingApps,ArraySet<AppWindowToken> closingApps){
  mNextAppTransition=TRANSIT_UNSET;
  mAppTransitionState=APP_STATE_RUNNING;
  notifyAppTransitionStartingLocked(topOpeningAppAnimator != null ? topOpeningAppAnimator.mAppToken.token : null,topClosingAppAnimator != null ? topClosingAppAnimator.mAppToken.token : null,topOpeningAppAnimator != null ? topOpeningAppAnimator.animation : null,topClosingAppAnimator != null ? topClosingAppAnimator.animation : null);
  mService.getDefaultDisplayContentLocked().getDockedDividerController().notifyAppTransitionStarting();
  if (mNextAppTransition == TRANSIT_DOCK_TASK_FROM_RECENTS && !mProlongedAnimationsEnded) {
    for (int i=openingApps.size() - 1; i >= 0; i--) {
      final AppWindowAnimator appAnimator=openingApps.valueAt(i).mAppAnimator;
      appAnimator.startProlongAnimation(PROLONG_ANIMATION_AT_START);
    }
  }
}

Fixed version (ground truth):
void goodToGo(AppWindowAnimator topOpeningAppAnimator,AppWindowAnimator topClosingAppAnimator,ArraySet<AppWindowToken> openingApps,ArraySet<AppWindowToken> closingApps){
  mNextAppTransition=TRANSIT_UNSET;
  mAppTransitionState=APP_STATE_RUNNING;
  notifyAppTransitionStartingLocked(topOpeningAppAnimator != null ? topOpeningAppAnimator.mAppToken.token : null,topClosingAppAnimator != null ? topClosingAppAnimator.mAppToken.token : null,topOpeningAppAnimator != null ? topOpeningAppAnimator.animation : null,topClosingAppAnimator != null ? topClosingAppAnimator.animation : null);
  mService.getDefaultDisplayContentLocked().getDockedDividerController().notifyAppTransitionStarting(openingApps);
  if (mNextAppTransition == TRANSIT_DOCK_TASK_FROM_RECENTS && !mProlongedAnimationsEnded) {
    for (int i=openingApps.size() - 1; i >= 0; i--) {
      final AppWindowAnimator appAnimator=openingApps.valueAt(i).mAppAnimator;
      appAnimator.startProlongAnimation(PROLONG_ANIMATION_AT_START);
    }
  }
}
Program: 191061
Project: 191061
Buggy source:
void notifyAppTransitionStarting(){
  checkMinimizeChanged(true);
}

Fixed version (ground truth):
void notifyAppTransitionStarting(ArraySet<AppWindowToken> openingApps){
  final boolean wasMinimized=mMinimizedDock;
  checkMinimizeChanged(true);
  if (wasMinimized && mMinimizedDock && containsAppInDockedStack(openingApps)) {
    mService.showRecentApps(true);
  }
}
Program: 191066
Project: 191066
Buggy source:
public void onNotificationUpdated(NotificationData.Entry entry){
  mEntry=entry;
  mStatusBarNotification=entry.notification;
  mPrivateLayout.onNotificationUpdated(entry);
  mPublicLayout.onNotificationUpdated(entry);
  mShowingPublicInitialized=false;
  updateNotificationColor();
  updateClearability();
  if (mIsSummaryWithChildren) {
    mChildrenContainer.recreateNotificationHeader(mExpandClickListener,mEntry.notification);
    mChildrenContainer.onNotificationUpdated();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  if (mNotificationParent != null) {
    mNotificationParent.updateChildrenHeaderAppearance();
  }
  onChildrenCountChanged();
  mPublicLayout.updateExpandButtons(true);
  updateLimits();
}

Fixed version (ground truth):
public void onNotificationUpdated(NotificationData.Entry entry){
  mEntry=entry;
  mStatusBarNotification=entry.notification;
  mPrivateLayout.onNotificationUpdated(entry);
  mPublicLayout.onNotificationUpdated(entry);
  mShowingPublicInitialized=false;
  updateNotificationColor();
  if (mIsSummaryWithChildren) {
    mChildrenContainer.recreateNotificationHeader(mExpandClickListener,mEntry.notification);
    mChildrenContainer.onNotificationUpdated();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  if (mNotificationParent != null) {
    mNotificationParent.updateChildrenHeaderAppearance();
  }
  onChildrenCountChanged();
  mPublicLayout.updateExpandButtons(true);
  updateLimits();
}
Program: 191067
Project: 191067
Buggy source:
private boolean canViewBeDismissed(){
  return isClearable() && (!mShowingPublic || !mSensitiveHiddenInGeneral);
}

Fixed version (ground truth):
/** 
 * @return Whether this view is allowed to be dismissed. Only valid for visible notifications asotherwise some state might not be updated. To request about the general clearability see  {@link #isClearable()}.
 */
public boolean canViewBeDismissed(){
  return isClearable() && (!mShowingPublic || !mSensitiveHiddenInGeneral);
}
Program: 191068
Project: 191068
Buggy source:
/** 
 * @return Can the underlying notification be cleared?
 */
public boolean isClearable(){
  return mStatusBarNotification != null && mStatusBarNotification.isClearable();
}

Fixed version (ground truth):
/** 
 * @return Can the underlying notification be cleared? This can be different from whether thenotification can be dismissed in case notifications are sensitive on the lockscreen.
 * @see #canViewBeDismissed()
 */
public boolean isClearable(){
  return mStatusBarNotification != null && mStatusBarNotification.isClearable();
}
Program: 191070
Project: 191070
Buggy source:
public void setHideSensitive(boolean hideSensitive,boolean animated,long delay,long duration){
  boolean oldShowingPublic=mShowingPublic;
  mShowingPublic=mSensitive && hideSensitive;
  if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
    return;
  }
  if (mPublicLayout.getChildCount() == 0)   return;
  if (!animated) {
    mPublicLayout.animate().cancel();
    mPrivateLayout.animate().cancel();
    if (mChildrenContainer != null) {
      mChildrenContainer.animate().cancel();
      mChildrenContainer.setAlpha(1f);
    }
    mPublicLayout.setAlpha(1f);
    mPrivateLayout.setAlpha(1f);
    mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
    updateChildrenVisibility();
  }
 else {
    animateShowingPublic(delay,duration);
  }
  NotificationContentView showingLayout=getShowingLayout();
  showingLayout.updateBackgroundColor(animated);
  mPrivateLayout.updateExpandButtons(isExpandable());
  updateClearability();
  mShowingPublicInitialized=true;
}

Fixed version (ground truth):
public void setHideSensitive(boolean hideSensitive,boolean animated,long delay,long duration){
  boolean oldShowingPublic=mShowingPublic;
  mShowingPublic=mSensitive && hideSensitive;
  if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
    return;
  }
  if (mPublicLayout.getChildCount() == 0)   return;
  if (!animated) {
    mPublicLayout.animate().cancel();
    mPrivateLayout.animate().cancel();
    if (mChildrenContainer != null) {
      mChildrenContainer.animate().cancel();
      mChildrenContainer.setAlpha(1f);
    }
    mPublicLayout.setAlpha(1f);
    mPrivateLayout.setAlpha(1f);
    mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
    updateChildrenVisibility();
  }
 else {
    animateShowingPublic(delay,duration);
  }
  NotificationContentView showingLayout=getShowingLayout();
  showingLayout.updateBackgroundColor(animated);
  mPrivateLayout.updateExpandButtons(isExpandable());
  mShowingPublicInitialized=true;
}
Program: 191071
Project: 191071
Buggy source:
public static void performDismiss(View v,NotificationGroupManager groupManager,boolean fromAccessibility){
  if (v instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)v;
    if (groupManager.isOnlyChildInGroup(row.getStatusBarNotification())) {
      ExpandableNotificationRow groupSummary=groupManager.getLogicalGroupSummary(row.getStatusBarNotification());
      if (groupSummary.isClearable()) {
        performDismiss(groupSummary,groupManager,fromAccessibility);
      }
    }
    row.setDismissed(true,fromAccessibility);
  }
  final View veto=v.findViewById(R.id.veto);
  if (veto != null && veto.getVisibility() != View.GONE) {
    veto.performClick();
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + v);
}

Fixed version (ground truth):
public static void performDismiss(View v,NotificationGroupManager groupManager,boolean fromAccessibility){
  if (!(v instanceof ExpandableNotificationRow)) {
    return;
  }
  ExpandableNotificationRow row=(ExpandableNotificationRow)v;
  if (groupManager.isOnlyChildInGroup(row.getStatusBarNotification())) {
    ExpandableNotificationRow groupSummary=groupManager.getLogicalGroupSummary(row.getStatusBarNotification());
    if (groupSummary.isClearable()) {
      performDismiss(groupSummary,groupManager,fromAccessibility);
    }
  }
  row.setDismissed(true,fromAccessibility);
  if (row.isClearable()) {
    row.performDismiss();
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + v);
}
Program: 191072
Project: 191072
Buggy source:
public static boolean canChildBeDismissed(View v){
  if (v instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)v;
    if (row.areGutsExposed()) {
      return false;
    }
  }
  final View veto=v.findViewById(R.id.veto);
  return (veto != null && veto.getVisibility() != View.GONE);
}

Fixed version (ground truth):
public static boolean canChildBeDismissed(View v){
  if (!(v instanceof ExpandableNotificationRow)) {
    return false;
  }
  ExpandableNotificationRow row=(ExpandableNotificationRow)v;
  if (row.areGutsExposed()) {
    return false;
  }
  return row.canViewBeDismissed();
}
Program: 191073
Project: 191073
Buggy source:
@Override public void interfaceStatusChanged(String iface,boolean up){
  if (VDBG)   Log.d(TAG,"String_Node_Str" + iface + "String_Node_Str"+ up);
  boolean found=false;
  boolean usb=false;
  WifiManager mWifiManager=(WifiManager)mContext.getSystemService(Context.WIFI_SERVICE);
synchronized (mPublicSync) {
    if (isWifi(iface)) {
      found=true;
    }
 else     if (isUsb(iface)) {
      found=true;
      usb=true;
    }
 else     if (isBluetooth(iface)) {
      found=true;
    }
    if (found == false)     return;
    TetherInterfaceSM sm=mIfaces.get(iface);
    if (up) {
      if (sm == null) {
        sm=new TetherInterfaceSM(iface,mLooper,usb);
        mIfaces.put(iface,sm);
        sm.start();
      }
    }
 else {
      if (isUsb(iface)) {
        if (VDBG)         Log.d(TAG,"String_Node_Str" + iface);
      }
 else       if (isWifi(iface) && (mWifiManager != null) && mWifiManager.getWifiStaSapConcurrency()) {
        int wifiApState=0;
        wifiApState=mWifiManager.getWifiApState();
        if ((wifiApState == WifiManager.WIFI_AP_STATE_DISABLING) || (wifiApState == WifiManager.WIFI_AP_STATE_DISABLED)) {
          if (VDBG)           Log.d(TAG,"String_Node_Str" + iface);
          sm.sendMessage(TetherInterfaceSM.CMD_INTERFACE_DOWN);
          mIfaces.remove(iface);
        }
 else {
          if (VDBG)           Log.d(TAG,"String_Node_Str" + iface);
        }
      }
 else       if (sm != null) {
        sm.sendMessage(TetherInterfaceSM.CMD_INTERFACE_DOWN);
        mIfaces.remove(iface);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void interfaceStatusChanged(String iface,boolean up){
  if (VDBG)   Log.d(TAG,"String_Node_Str" + iface + "String_Node_Str"+ up);
  boolean found=false;
  boolean usb=false;
  WifiManager mWifiManager=(WifiManager)mContext.getSystemService(Context.WIFI_SERVICE);
synchronized (mPublicSync) {
    if (isWifi(iface)) {
      found=true;
    }
 else     if (isUsb(iface)) {
      found=true;
      usb=true;
    }
 else     if (isBluetooth(iface)) {
      found=true;
    }
    if (found == false)     return;
    TetherInterfaceSM sm=mIfaces.get(iface);
    if (up) {
      if (sm == null) {
        sm=new TetherInterfaceSM(iface,mLooper,usb);
        mIfaces.put(iface,sm);
        sm.start();
      }
    }
 else {
      if (isUsb(iface) || isBluetooth(iface) || isWifi(iface)) {
        if (VDBG)         Log.d(TAG,"String_Node_Str" + iface);
      }
 else       if (sm != null) {
        sm.sendMessage(TetherInterfaceSM.CMD_INTERFACE_DOWN);
        mIfaces.remove(iface);
      }
    }
  }
}
Program: 191074
Project: 191074
Buggy source:
private void generateHeadsUpAnimationEvents(){
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    int type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER;
    boolean onBottom=false;
    boolean pinnedAndClosed=row.isPinned() && !mIsExpanded;
    if (!mIsExpanded && !isHeadsUp) {
      type=row.wasJustClicked() ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR;
    }
 else {
      StackViewState viewState=mCurrentStackScrollState.getViewStateForView(row);
      if (viewState == null) {
        continue;
      }
      if (isHeadsUp && (mAddedHeadsUpChildren.contains(row) || pinnedAndClosed)) {
        if (pinnedAndClosed || shouldHunAppearFromBottom(viewState)) {
          type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_APPEAR;
        }
 else {
          type=AnimationEvent.ANIMATION_TYPE_ADD;
        }
        onBottom=!pinnedAndClosed;
      }
    }
    AnimationEvent event=new AnimationEvent(row,type);
    event.headsUpFromBottom=onBottom;
    mAnimationEvents.add(event);
  }
  mHeadsUpChangeAnimations.clear();
  mAddedHeadsUpChildren.clear();
}

Fixed version (ground truth):
private void generateHeadsUpAnimationEvents(){
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    int type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER;
    boolean onBottom=false;
    boolean pinnedAndClosed=row.isPinned() && !mIsExpanded;
    if (!mIsExpanded && !isHeadsUp) {
      type=row.wasJustClicked() ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR;
      if (row.isChildInGroup()) {
        row.setHeadsupDisappearRunning(false);
      }
    }
 else {
      StackViewState viewState=mCurrentStackScrollState.getViewStateForView(row);
      if (viewState == null) {
        continue;
      }
      if (isHeadsUp && (mAddedHeadsUpChildren.contains(row) || pinnedAndClosed)) {
        if (pinnedAndClosed || shouldHunAppearFromBottom(viewState)) {
          type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_APPEAR;
        }
 else {
          type=AnimationEvent.ANIMATION_TYPE_ADD;
        }
        onBottom=!pinnedAndClosed;
      }
    }
    AnimationEvent event=new AnimationEvent(row,type);
    event.headsUpFromBottom=onBottom;
    mAnimationEvents.add(event);
  }
  mHeadsUpChangeAnimations.clear();
  mAddedHeadsUpChildren.clear();
}
Program: 191075
Project: 191075
Buggy source:
/** 
 * Remove a removed child view from the heads up animations if it was just added there
 * @return whether any child was removed from the list to animate
 */
private boolean removeRemovedChildFromHeadsUpChangeAnimations(View child){
  boolean hasAddEvent=false;
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    if (child == row) {
      mTmpList.add(eventPair);
      hasAddEvent|=isHeadsUp;
    }
  }
  if (hasAddEvent) {
    mHeadsUpChangeAnimations.removeAll(mTmpList);
  }
  mTmpList.clear();
  return hasAddEvent;
}

Fixed version (ground truth):
/** 
 * Remove a removed child view from the heads up animations if it was just added there
 * @return whether any child was removed from the list to animate
 */
private boolean removeRemovedChildFromHeadsUpChangeAnimations(View child){
  boolean hasAddEvent=false;
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    if (child == row) {
      mTmpList.add(eventPair);
      hasAddEvent|=isHeadsUp;
    }
  }
  if (hasAddEvent) {
    mHeadsUpChangeAnimations.removeAll(mTmpList);
    ((ExpandableNotificationRow)child).setHeadsupDisappearRunning(false);
  }
  mTmpList.clear();
  return hasAddEvent;
}
Program: 191076
Project: 191076
Buggy source:
public void onChildAnimationFinished(){
  setAnimationRunning(false);
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
  clearViewOverlays();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  setAnimationRunning(false);
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
  clearViewOverlays();
  clearHeadsUpDisappearRunning();
}
Program: 191079
Project: 191079
Buggy source:
public void onNotificationUpdated(NotificationData.Entry entry){
  mEntry=entry;
  mStatusBarNotification=entry.notification;
  mPrivateLayout.onNotificationUpdated(entry);
  mPublicLayout.onNotificationUpdated(entry);
  mShowingPublicInitialized=false;
  updateNotificationColor();
  updateClearability();
  if (mIsSummaryWithChildren) {
    mChildrenContainer.recreateNotificationHeader(mExpandClickListener,mEntry.notification);
    mChildrenContainer.onNotificationUpdated();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  if (mNotificationParent != null) {
    mNotificationParent.updateChildrenHeaderAppearance();
  }
  onChildrenCountChanged();
  mPublicLayout.updateExpandButtons(true);
  updateLimits();
}

Fixed version (ground truth):
public void onNotificationUpdated(NotificationData.Entry entry){
  mEntry=entry;
  mStatusBarNotification=entry.notification;
  mPrivateLayout.onNotificationUpdated(entry);
  mPublicLayout.onNotificationUpdated(entry);
  mShowingPublicInitialized=false;
  updateNotificationColor();
  if (mIsSummaryWithChildren) {
    mChildrenContainer.recreateNotificationHeader(mExpandClickListener,mEntry.notification);
    mChildrenContainer.onNotificationUpdated();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  if (mNotificationParent != null) {
    mNotificationParent.updateChildrenHeaderAppearance();
  }
  onChildrenCountChanged();
  mPublicLayout.updateExpandButtons(true);
  updateLimits();
}
Program: 191080
Project: 191080
Buggy source:
private boolean canViewBeDismissed(){
  return isClearable() && (!mShowingPublic || !mSensitiveHiddenInGeneral);
}

Fixed version (ground truth):
/** 
 * @return Whether this view is allowed to be dismissed. Only valid for visible notifications asotherwise some state might not be updated. To request about the general clearability see  {@link #isClearable()}.
 */
public boolean canViewBeDismissed(){
  return isClearable() && (!mShowingPublic || !mSensitiveHiddenInGeneral);
}
Program: 191081
Project: 191081
Buggy source:
/** 
 * @return Can the underlying notification be cleared?
 */
public boolean isClearable(){
  return mStatusBarNotification != null && mStatusBarNotification.isClearable();
}

Fixed version (ground truth):
/** 
 * @return Can the underlying notification be cleared? This can be different from whether thenotification can be dismissed in case notifications are sensitive on the lockscreen.
 * @see #canViewBeDismissed()
 */
public boolean isClearable(){
  return mStatusBarNotification != null && mStatusBarNotification.isClearable();
}
Program: 191083
Project: 191083
Buggy source:
public void setHideSensitive(boolean hideSensitive,boolean animated,long delay,long duration){
  boolean oldShowingPublic=mShowingPublic;
  mShowingPublic=mSensitive && hideSensitive;
  if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
    return;
  }
  if (mPublicLayout.getChildCount() == 0)   return;
  if (!animated) {
    mPublicLayout.animate().cancel();
    mPrivateLayout.animate().cancel();
    if (mChildrenContainer != null) {
      mChildrenContainer.animate().cancel();
      mChildrenContainer.setAlpha(1f);
    }
    mPublicLayout.setAlpha(1f);
    mPrivateLayout.setAlpha(1f);
    mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
    updateChildrenVisibility();
  }
 else {
    animateShowingPublic(delay,duration);
  }
  NotificationContentView showingLayout=getShowingLayout();
  showingLayout.updateBackgroundColor(animated);
  mPrivateLayout.updateExpandButtons(isExpandable());
  updateClearability();
  mShowingPublicInitialized=true;
}

Fixed version (ground truth):
public void setHideSensitive(boolean hideSensitive,boolean animated,long delay,long duration){
  boolean oldShowingPublic=mShowingPublic;
  mShowingPublic=mSensitive && hideSensitive;
  if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
    return;
  }
  if (mPublicLayout.getChildCount() == 0)   return;
  if (!animated) {
    mPublicLayout.animate().cancel();
    mPrivateLayout.animate().cancel();
    if (mChildrenContainer != null) {
      mChildrenContainer.animate().cancel();
      mChildrenContainer.setAlpha(1f);
    }
    mPublicLayout.setAlpha(1f);
    mPrivateLayout.setAlpha(1f);
    mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
    updateChildrenVisibility();
  }
 else {
    animateShowingPublic(delay,duration);
  }
  NotificationContentView showingLayout=getShowingLayout();
  showingLayout.updateBackgroundColor(animated);
  mPrivateLayout.updateExpandButtons(isExpandable());
  mShowingPublicInitialized=true;
}
Program: 191084
Project: 191084
Buggy source:
public static void performDismiss(View v,NotificationGroupManager groupManager,boolean fromAccessibility){
  if (v instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)v;
    if (groupManager.isOnlyChildInGroup(row.getStatusBarNotification())) {
      ExpandableNotificationRow groupSummary=groupManager.getLogicalGroupSummary(row.getStatusBarNotification());
      if (groupSummary.isClearable()) {
        performDismiss(groupSummary,groupManager,fromAccessibility);
      }
    }
    row.setDismissed(true,fromAccessibility);
  }
  final View veto=v.findViewById(R.id.veto);
  if (veto != null && veto.getVisibility() != View.GONE) {
    veto.performClick();
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + v);
}

Fixed version (ground truth):
public static void performDismiss(View v,NotificationGroupManager groupManager,boolean fromAccessibility){
  if (!(v instanceof ExpandableNotificationRow)) {
    return;
  }
  ExpandableNotificationRow row=(ExpandableNotificationRow)v;
  if (groupManager.isOnlyChildInGroup(row.getStatusBarNotification())) {
    ExpandableNotificationRow groupSummary=groupManager.getLogicalGroupSummary(row.getStatusBarNotification());
    if (groupSummary.isClearable()) {
      performDismiss(groupSummary,groupManager,fromAccessibility);
    }
  }
  row.setDismissed(true,fromAccessibility);
  if (row.isClearable()) {
    row.performDismiss();
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + v);
}
Program: 191085
Project: 191085
Buggy source:
public static boolean canChildBeDismissed(View v){
  if (v instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)v;
    if (row.areGutsExposed()) {
      return false;
    }
  }
  final View veto=v.findViewById(R.id.veto);
  return (veto != null && veto.getVisibility() != View.GONE);
}

Fixed version (ground truth):
public static boolean canChildBeDismissed(View v){
  if (!(v instanceof ExpandableNotificationRow)) {
    return false;
  }
  ExpandableNotificationRow row=(ExpandableNotificationRow)v;
  if (row.areGutsExposed()) {
    return false;
  }
  return row.canViewBeDismissed();
}