nus-yam/ex-repair huggingface dataset:
Program: 191284
Project: 191284
Buggy source:
public void generateHeadsUpAnimation(ExpandableNotificationRow row,boolean isHeadsUp){
  if (mAnimationsEnabled) {
    mHeadsUpChangeAnimations.add(new Pair<>(row,isHeadsUp));
    mNeedsAnimation=true;
    requestChildrenUpdate();
  }
}

Fixed version (ground truth):
public void generateHeadsUpAnimation(ExpandableNotificationRow row,boolean isHeadsUp){
  if (mAnimationsEnabled) {
    mHeadsUpChangeAnimations.add(new Pair<>(row,isHeadsUp));
    mNeedsAnimation=true;
    if (!mIsExpanded && !isHeadsUp) {
      row.setHeadsupDisappearRunning(true);
    }
    requestChildrenUpdate();
  }
}
Program: 191286
Project: 191286
Buggy source:
/** 
 * Defer the specified SyncOperation by rescheduling it on the JobScheduler with some delay. This is equivalent to a failure. If this is a periodic sync, a delayed one-off sync will be scheduled.
 */
private void deferSyncH(SyncOperation op,long delay){
  mSyncJobService.callJobFinished(op.jobId,false);
  if (op.isPeriodic) {
    scheduleSyncOperationH(op.createOneTimeSyncOperation(),delay);
  }
 else {
    scheduleSyncOperationH(op,delay);
  }
}

Fixed version (ground truth):
/** 
 * Defer the specified SyncOperation by rescheduling it on the JobScheduler with some delay. This is equivalent to a failure. If this is a periodic sync, a delayed one-off sync will be scheduled.
 */
private void deferSyncH(SyncOperation op,long delay){
  mSyncJobService.callJobFinished(op.jobId,false);
  if (op.isPeriodic) {
    scheduleSyncOperationH(op.createOneTimeSyncOperation(),delay);
  }
 else {
    getJobScheduler().cancel(op.jobId);
    scheduleSyncOperationH(op,delay);
  }
}
Program: 191289
Project: 191289
Buggy source:
@Override public void onClick(View v){
  if (!mShowingPublic && mGroupManager.isSummaryOfGroup(mStatusBarNotification)) {
    final boolean wasExpanded=mGroupManager.isGroupExpanded(mStatusBarNotification);
    boolean nowExpanded=mGroupManager.toggleGroupExpansion(mStatusBarNotification);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    mGroupExpansionChanging=true;
    updateBackgroundForGroupState();
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_GROUP_EXPANDER,nowExpanded);
    logExpansionEvent(true,wasExpanded);
  }
 else {
    boolean nowExpanded;
    if (isPinned()) {
      nowExpanded=!mExpandedWhenPinned;
      mExpandedWhenPinned=nowExpanded;
    }
 else {
      nowExpanded=!isExpanded();
      setUserExpanded(nowExpanded);
    }
    notifyHeightChanged(true);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_EXPANDER,nowExpanded);
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (!mShowingPublic && mGroupManager.isSummaryOfGroup(mStatusBarNotification)) {
    mGroupExpansionChanging=true;
    final boolean wasExpanded=mGroupManager.isGroupExpanded(mStatusBarNotification);
    boolean nowExpanded=mGroupManager.toggleGroupExpansion(mStatusBarNotification);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_GROUP_EXPANDER,nowExpanded);
    logExpansionEvent(true,wasExpanded);
  }
 else {
    boolean nowExpanded;
    if (isPinned()) {
      nowExpanded=!mExpandedWhenPinned;
      mExpandedWhenPinned=nowExpanded;
    }
 else {
      nowExpanded=!isExpanded();
      setUserExpanded(nowExpanded);
    }
    notifyHeightChanged(true);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_EXPANDER,nowExpanded);
  }
}
Program: 191290
Project: 191290
Buggy source:
public void setChildrenExpanded(boolean expanded,boolean animate){
  mChildrenExpanded=expanded;
  if (mChildrenContainer != null) {
    mChildrenContainer.setChildrenExpanded(expanded);
  }
  updateClickAndFocus();
}

Fixed version (ground truth):
public void setChildrenExpanded(boolean expanded,boolean animate){
  mChildrenExpanded=expanded;
  if (mChildrenContainer != null) {
    mChildrenContainer.setChildrenExpanded(expanded);
  }
  updateBackgroundForGroupState();
  updateClickAndFocus();
}
Program: 191291
Project: 191291
Buggy source:
@Override public void onClick(View v){
  if (!mShowingPublic && mGroupManager.isSummaryOfGroup(mStatusBarNotification)) {
    final boolean wasExpanded=mGroupManager.isGroupExpanded(mStatusBarNotification);
    boolean nowExpanded=mGroupManager.toggleGroupExpansion(mStatusBarNotification);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    mGroupExpansionChanging=true;
    updateBackgroundForGroupState();
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_GROUP_EXPANDER,nowExpanded);
    logExpansionEvent(true,wasExpanded);
  }
 else {
    boolean nowExpanded;
    if (isPinned()) {
      nowExpanded=!mExpandedWhenPinned;
      mExpandedWhenPinned=nowExpanded;
    }
 else {
      nowExpanded=!isExpanded();
      setUserExpanded(nowExpanded);
    }
    notifyHeightChanged(true);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_EXPANDER,nowExpanded);
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (!mShowingPublic && mGroupManager.isSummaryOfGroup(mStatusBarNotification)) {
    mGroupExpansionChanging=true;
    final boolean wasExpanded=mGroupManager.isGroupExpanded(mStatusBarNotification);
    boolean nowExpanded=mGroupManager.toggleGroupExpansion(mStatusBarNotification);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_GROUP_EXPANDER,nowExpanded);
    logExpansionEvent(true,wasExpanded);
  }
 else {
    boolean nowExpanded;
    if (isPinned()) {
      nowExpanded=!mExpandedWhenPinned;
      mExpandedWhenPinned=nowExpanded;
    }
 else {
      nowExpanded=!isExpanded();
      setUserExpanded(nowExpanded);
    }
    notifyHeightChanged(true);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_EXPANDER,nowExpanded);
  }
}
Program: 191292
Project: 191292
Buggy source:
public void setChildrenExpanded(boolean expanded,boolean animate){
  mChildrenExpanded=expanded;
  if (mChildrenContainer != null) {
    mChildrenContainer.setChildrenExpanded(expanded);
  }
  updateClickAndFocus();
}

Fixed version (ground truth):
public void setChildrenExpanded(boolean expanded,boolean animate){
  mChildrenExpanded=expanded;
  if (mChildrenContainer != null) {
    mChildrenContainer.setChildrenExpanded(expanded);
  }
  updateBackgroundForGroupState();
  updateClickAndFocus();
}
Program: 191293
Project: 191293
Buggy source:
@Override public void updateRecentsVisibility(boolean visible){
  mImpl.onVisibilityChanged(mContext,visible);
}

Fixed version (ground truth):
@Override public void updateRecentsVisibility(boolean visible){
  ForegroundThread.getHandler().post(() -> {
    mImpl.onVisibilityChanged(mContext,visible);
  }
);
}
Program: 191294
Project: 191294
Buggy source:
@Override public void startScreenPinning(int taskId){
  mImpl.onStartScreenPinning(mContext,taskId);
}

Fixed version (ground truth):
@Override public void startScreenPinning(int taskId){
  ForegroundThread.getHandler().post(() -> {
    mImpl.onStartScreenPinning(mContext,taskId);
  }
);
}
Program: 191295
Project: 191295
Buggy source:
public void showPrompt(int taskId,boolean allowCancel){
  clearPrompt();
  this.taskId=taskId;
  mRequestWindow=new RequestWindowView(mContext,allowCancel);
  mRequestWindow.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
  WindowManager.LayoutParams lp=getWindowLayoutParams();
  mWindowManager.addView(mRequestWindow,lp);
}

Fixed version (ground truth):
public void showPrompt(int taskId,boolean allowCancel){
  try {
    clearPrompt();
  }
 catch (  IllegalArgumentException e) {
  }
  this.taskId=taskId;
  mRequestWindow=new RequestWindowView(mContext,allowCancel);
  mRequestWindow.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
  WindowManager.LayoutParams lp=getWindowLayoutParams();
  mWindowManager.addView(mRequestWindow,lp);
}
Program: 191296
Project: 191296
Buggy source:
@Override public void onClick(View v){
  if (!mShowingPublic && mGroupManager.isSummaryOfGroup(mStatusBarNotification)) {
    final boolean wasExpanded=mGroupManager.isGroupExpanded(mStatusBarNotification);
    boolean nowExpanded=mGroupManager.toggleGroupExpansion(mStatusBarNotification);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    mGroupExpansionChanging=true;
    updateBackgroundForGroupState();
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_GROUP_EXPANDER,nowExpanded);
    logExpansionEvent(true,wasExpanded);
  }
 else {
    boolean nowExpanded;
    if (isPinned()) {
      nowExpanded=!mExpandedWhenPinned;
      mExpandedWhenPinned=nowExpanded;
    }
 else {
      nowExpanded=!isExpanded();
      setUserExpanded(nowExpanded);
    }
    notifyHeightChanged(true);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_EXPANDER,nowExpanded);
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (!mShowingPublic && mGroupManager.isSummaryOfGroup(mStatusBarNotification)) {
    mGroupExpansionChanging=true;
    final boolean wasExpanded=mGroupManager.isGroupExpanded(mStatusBarNotification);
    boolean nowExpanded=mGroupManager.toggleGroupExpansion(mStatusBarNotification);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_GROUP_EXPANDER,nowExpanded);
    logExpansionEvent(true,wasExpanded);
  }
 else {
    boolean nowExpanded;
    if (isPinned()) {
      nowExpanded=!mExpandedWhenPinned;
      mExpandedWhenPinned=nowExpanded;
    }
 else {
      nowExpanded=!isExpanded();
      setUserExpanded(nowExpanded);
    }
    notifyHeightChanged(true);
    mOnExpandClickListener.onExpandClicked(mEntry,nowExpanded);
    MetricsLogger.action(mContext,MetricsEvent.ACTION_NOTIFICATION_EXPANDER,nowExpanded);
  }
}
Program: 191297
Project: 191297
Buggy source:
public void setChildrenExpanded(boolean expanded,boolean animate){
  mChildrenExpanded=expanded;
  if (mChildrenContainer != null) {
    mChildrenContainer.setChildrenExpanded(expanded);
  }
  updateClickAndFocus();
}

Fixed version (ground truth):
public void setChildrenExpanded(boolean expanded,boolean animate){
  mChildrenExpanded=expanded;
  if (mChildrenContainer != null) {
    mChildrenContainer.setChildrenExpanded(expanded);
  }
  updateBackgroundForGroupState();
  updateClickAndFocus();
}
Program: 191298
Project: 191298
Buggy source:
@Override public void updateRecentsVisibility(boolean visible){
  mImpl.onVisibilityChanged(mContext,visible);
}

Fixed version (ground truth):
@Override public void updateRecentsVisibility(boolean visible){
  ForegroundThread.getHandler().post(() -> {
    mImpl.onVisibilityChanged(mContext,visible);
  }
);
}
Program: 191299
Project: 191299
Buggy source:
@Override public void startScreenPinning(int taskId){
  mImpl.onStartScreenPinning(mContext,taskId);
}

Fixed version (ground truth):
@Override public void startScreenPinning(int taskId){
  ForegroundThread.getHandler().post(() -> {
    mImpl.onStartScreenPinning(mContext,taskId);
  }
);
}
Program: 191300
Project: 191300
Buggy source:
public void showPrompt(int taskId,boolean allowCancel){
  clearPrompt();
  this.taskId=taskId;
  mRequestWindow=new RequestWindowView(mContext,allowCancel);
  mRequestWindow.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
  WindowManager.LayoutParams lp=getWindowLayoutParams();
  mWindowManager.addView(mRequestWindow,lp);
}

Fixed version (ground truth):
public void showPrompt(int taskId,boolean allowCancel){
  try {
    clearPrompt();
  }
 catch (  IllegalArgumentException e) {
  }
  this.taskId=taskId;
  mRequestWindow=new RequestWindowView(mContext,allowCancel);
  mRequestWindow.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
  WindowManager.LayoutParams lp=getWindowLayoutParams();
  mWindowManager.addView(mRequestWindow,lp);
}
Program: 191301
Project: 191301
Buggy source:
@Override public void updateRecentsVisibility(boolean visible){
  mImpl.onVisibilityChanged(mContext,visible);
}

Fixed version (ground truth):
@Override public void updateRecentsVisibility(boolean visible){
  ForegroundThread.getHandler().post(() -> {
    mImpl.onVisibilityChanged(mContext,visible);
  }
);
}
Program: 191302
Project: 191302
Buggy source:
@Override public void startScreenPinning(int taskId){
  mImpl.onStartScreenPinning(mContext,taskId);
}

Fixed version (ground truth):
@Override public void startScreenPinning(int taskId){
  ForegroundThread.getHandler().post(() -> {
    mImpl.onStartScreenPinning(mContext,taskId);
  }
);
}
Program: 191303
Project: 191303
Buggy source:
public void showPrompt(int taskId,boolean allowCancel){
  clearPrompt();
  this.taskId=taskId;
  mRequestWindow=new RequestWindowView(mContext,allowCancel);
  mRequestWindow.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
  WindowManager.LayoutParams lp=getWindowLayoutParams();
  mWindowManager.addView(mRequestWindow,lp);
}

Fixed version (ground truth):
public void showPrompt(int taskId,boolean allowCancel){
  try {
    clearPrompt();
  }
 catch (  IllegalArgumentException e) {
  }
  this.taskId=taskId;
  mRequestWindow=new RequestWindowView(mContext,allowCancel);
  mRequestWindow.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
  WindowManager.LayoutParams lp=getWindowLayoutParams();
  mWindowManager.addView(mRequestWindow,lp);
}
Program: 191304
Project: 191304
Buggy source:
@Override public CharSequence getAccessibilityClassName(){
  return TaskStackView.class.getName();
}

Fixed version (ground truth):
@Override public CharSequence getAccessibilityClassName(){
  return ScrollView.class.getName();
}
Program: 191307
Project: 191307
Buggy source:
@Override public boolean performAccessibilityAction(int action,Bundle arguments){
  if (super.performAccessibilityAction(action,arguments)) {
    return true;
  }
switch (action) {
case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
{
      setRelativeFocusedTask(true,false,false);
      return true;
    }
case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
{
    setRelativeFocusedTask(false,false,false);
    return true;
  }
}
return false;
}

Fixed version (ground truth):
@Override public boolean performAccessibilityAction(int action,Bundle arguments){
  if (super.performAccessibilityAction(action,arguments)) {
    return true;
  }
  Task focusedTask=getAccessibilityFocusedTask();
  int taskIndex=mStack.indexOfStackTask(focusedTask);
  if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) {
switch (action) {
case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
{
        setFocusedTask(taskIndex + 1,true,true,0);
        return true;
      }
case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
{
      setFocusedTask(taskIndex - 1,true,true,0);
      return true;
    }
}
}
return false;
}
Program: 191308
Project: 191308
Buggy source:
@Override public void onReturnViewToPool(TaskView tv){
  final Task task=tv.getTask();
  unbindTaskView(tv,task);
  tv.resetViewProperties();
  tv.setFocusedState(false,false);
  tv.setClipViewInStack(false);
  if (mScreenPinningEnabled) {
    tv.hideActionButton(false,0,false,null);
  }
  detachViewFromParent(tv);
  updateTaskViewsList();
}

Fixed version (ground truth):
@Override public void onReturnViewToPool(TaskView tv){
  final Task task=tv.getTask();
  unbindTaskView(tv,task);
  tv.clearAccessibilityFocus();
  tv.resetViewProperties();
  tv.setFocusedState(false,false);
  tv.setClipViewInStack(false);
  if (mScreenPinningEnabled) {
    tv.hideActionButton(false,0,false,null);
  }
  detachViewFromParent(tv);
  updateTaskViewsList();
}
Program: 191309
Project: 191309
Buggy source:
@Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfo(info);
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  if (taskViewCount > 1 && mFocusedTask != null) {
    info.setScrollable(true);
    int focusedTaskIndex=mStack.indexOfStackTask(mFocusedTask);
    if (focusedTaskIndex > 0) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    }
    if (focusedTaskIndex < mStack.getTaskCount() - 1) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
  }
}

Fixed version (ground truth):
@Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfo(info);
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  if (taskViewCount > 1) {
    Task focusedTask=getAccessibilityFocusedTask();
    info.setScrollable(true);
    int focusedTaskIndex=mStack.indexOfStackTask(focusedTask);
    if (focusedTaskIndex > 0) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
    if (0 <= focusedTaskIndex && focusedTaskIndex < mStack.getTaskCount() - 1) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    }
  }
}
Program: 191311
Project: 191311
Buggy source:
/** 
 * Explicitly sets the focused state of this task.
 */
public void setFocusedState(boolean isFocused,boolean requestViewFocus){
  SystemServicesProxy ssp=Recents.getSystemServices();
  if (isFocused) {
    if (requestViewFocus && !isFocused()) {
      requestFocus();
    }
    if (requestViewFocus && !isAccessibilityFocused() && ssp.isTouchExplorationEnabled()) {
      requestAccessibilityFocus();
    }
  }
 else {
    if (isAccessibilityFocused() && ssp.isTouchExplorationEnabled()) {
      clearAccessibilityFocus();
    }
  }
}

Fixed version (ground truth):
/** 
 * Explicitly sets the focused state of this task.
 */
public void setFocusedState(boolean isFocused,boolean requestViewFocus){
  if (isFocused) {
    if (requestViewFocus && !isFocused()) {
      requestFocus();
    }
  }
 else {
    if (isAccessibilityFocused() && mTouchExplorationEnabled) {
      clearAccessibilityFocus();
    }
  }
}
Program: 191312
Project: 191312
Buggy source:
@Override public void onTaskDataLoaded(Task task,ActivityManager.TaskThumbnailInfo thumbnailInfo){
  mThumbnailView.onTaskDataLoaded(thumbnailInfo);
  mHeaderView.onTaskDataLoaded();
  mTaskDataLoaded=true;
}

Fixed version (ground truth):
@Override public void onTaskDataLoaded(Task task,ActivityManager.TaskThumbnailInfo thumbnailInfo){
  mThumbnailView.onTaskDataLoaded(thumbnailInfo);
  mHeaderView.onTaskDataLoaded();
}
Program: 191313
Project: 191313
Buggy source:
@Override public void onTaskDataUnloaded(){
  mTask.removeCallback(this);
  mThumbnailView.unbindFromTask();
  mHeaderView.unbindFromTask(mTouchExplorationEnabled);
  mTaskDataLoaded=false;
}

Fixed version (ground truth):
@Override public void onTaskDataUnloaded(){
  mTask.removeCallback(this);
  mThumbnailView.unbindFromTask();
  mHeaderView.unbindFromTask(mTouchExplorationEnabled);
}
Program: 191314
Project: 191314
Buggy source:
@Override public CharSequence getAccessibilityClassName(){
  return TaskStackView.class.getName();
}

Fixed version (ground truth):
@Override public CharSequence getAccessibilityClassName(){
  return ScrollView.class.getName();
}
Program: 191317
Project: 191317
Buggy source:
@Override public boolean performAccessibilityAction(int action,Bundle arguments){
  if (super.performAccessibilityAction(action,arguments)) {
    return true;
  }
switch (action) {
case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
{
      setRelativeFocusedTask(true,false,false);
      return true;
    }
case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
{
    setRelativeFocusedTask(false,false,false);
    return true;
  }
}
return false;
}

Fixed version (ground truth):
@Override public boolean performAccessibilityAction(int action,Bundle arguments){
  if (super.performAccessibilityAction(action,arguments)) {
    return true;
  }
  Task focusedTask=getAccessibilityFocusedTask();
  int taskIndex=mStack.indexOfStackTask(focusedTask);
  if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) {
switch (action) {
case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
{
        setFocusedTask(taskIndex + 1,true,true,0);
        return true;
      }
case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
{
      setFocusedTask(taskIndex - 1,true,true,0);
      return true;
    }
}
}
return false;
}
Program: 191318
Project: 191318
Buggy source:
@Override public void onReturnViewToPool(TaskView tv){
  final Task task=tv.getTask();
  unbindTaskView(tv,task);
  tv.resetViewProperties();
  tv.setFocusedState(false,false);
  tv.setClipViewInStack(false);
  if (mScreenPinningEnabled) {
    tv.hideActionButton(false,0,false,null);
  }
  detachViewFromParent(tv);
  updateTaskViewsList();
}

Fixed version (ground truth):
@Override public void onReturnViewToPool(TaskView tv){
  final Task task=tv.getTask();
  unbindTaskView(tv,task);
  tv.clearAccessibilityFocus();
  tv.resetViewProperties();
  tv.setFocusedState(false,false);
  tv.setClipViewInStack(false);
  if (mScreenPinningEnabled) {
    tv.hideActionButton(false,0,false,null);
  }
  detachViewFromParent(tv);
  updateTaskViewsList();
}
Program: 191319
Project: 191319
Buggy source:
@Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfo(info);
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  if (taskViewCount > 1 && mFocusedTask != null) {
    info.setScrollable(true);
    int focusedTaskIndex=mStack.indexOfStackTask(mFocusedTask);
    if (focusedTaskIndex > 0) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    }
    if (focusedTaskIndex < mStack.getTaskCount() - 1) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
  }
}

Fixed version (ground truth):
@Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfo(info);
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  if (taskViewCount > 1) {
    Task focusedTask=getAccessibilityFocusedTask();
    info.setScrollable(true);
    int focusedTaskIndex=mStack.indexOfStackTask(focusedTask);
    if (focusedTaskIndex > 0) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
    if (0 <= focusedTaskIndex && focusedTaskIndex < mStack.getTaskCount() - 1) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    }
  }
}
Program: 191321
Project: 191321
Buggy source:
/** 
 * Explicitly sets the focused state of this task.
 */
public void setFocusedState(boolean isFocused,boolean requestViewFocus){
  SystemServicesProxy ssp=Recents.getSystemServices();
  if (isFocused) {
    if (requestViewFocus && !isFocused()) {
      requestFocus();
    }
    if (requestViewFocus && !isAccessibilityFocused() && ssp.isTouchExplorationEnabled()) {
      requestAccessibilityFocus();
    }
  }
 else {
    if (isAccessibilityFocused() && ssp.isTouchExplorationEnabled()) {
      clearAccessibilityFocus();
    }
  }
}

Fixed version (ground truth):
/** 
 * Explicitly sets the focused state of this task.
 */
public void setFocusedState(boolean isFocused,boolean requestViewFocus){
  if (isFocused) {
    if (requestViewFocus && !isFocused()) {
      requestFocus();
    }
  }
 else {
    if (isAccessibilityFocused() && mTouchExplorationEnabled) {
      clearAccessibilityFocus();
    }
  }
}
Program: 191322
Project: 191322
Buggy source:
@Override public void onTaskDataLoaded(Task task,ActivityManager.TaskThumbnailInfo thumbnailInfo){
  mThumbnailView.onTaskDataLoaded(thumbnailInfo);
  mHeaderView.onTaskDataLoaded();
  mTaskDataLoaded=true;
}

Fixed version (ground truth):
@Override public void onTaskDataLoaded(Task task,ActivityManager.TaskThumbnailInfo thumbnailInfo){
  mThumbnailView.onTaskDataLoaded(thumbnailInfo);
  mHeaderView.onTaskDataLoaded();
}
Program: 191323
Project: 191323
Buggy source:
@Override public void onTaskDataUnloaded(){
  mTask.removeCallback(this);
  mThumbnailView.unbindFromTask();
  mHeaderView.unbindFromTask(mTouchExplorationEnabled);
  mTaskDataLoaded=false;
}

Fixed version (ground truth):
@Override public void onTaskDataUnloaded(){
  mTask.removeCallback(this);
  mThumbnailView.unbindFromTask();
  mHeaderView.unbindFromTask(mTouchExplorationEnabled);
}
Program: 191324
Project: 191324
Buggy source:
/** 
 * Sets the   {@link #contentView} field to be a view with the standard "Latest Event"layout. <p>Uses the  {@link #icon} and {@link #when} fields to set the icon and time fieldsin the view.</p>
 * @param context       The context for your application / activity.
 * @param contentTitle The title that goes in the expanded entry.
 * @param contentText  The text that goes in the expanded entry.
 * @param contentIntent The intent to launch when the user clicks the expanded notification.If this is an activity, it must include the {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag, which requiresthat you take care of task management as described in the <a href=" {@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a> document.
 * @deprecated Use {@link Builder} instead.
 * @removed
 */
@Deprecated public void setLatestEventInfo(Context context,CharSequence contentTitle,CharSequence contentText,PendingIntent contentIntent){
  if (context.getApplicationInfo().targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {
    Log.e(TAG,"String_Node_Str",new Throwable());
  }
  final Notification.Builder builder=new Notification.Builder(context,this);
  if (contentTitle != null) {
    builder.setContentTitle(contentTitle);
  }
  if (contentText != null) {
    builder.setContentText(contentText);
  }
  builder.setContentIntent(contentIntent);
  builder.build();
}

Fixed version (ground truth):
/** 
 * Sets the   {@link #contentView} field to be a view with the standard "Latest Event"layout. <p>Uses the  {@link #icon} and {@link #when} fields to set the icon and time fieldsin the view.</p>
 * @param context       The context for your application / activity.
 * @param contentTitle The title that goes in the expanded entry.
 * @param contentText  The text that goes in the expanded entry.
 * @param contentIntent The intent to launch when the user clicks the expanded notification.If this is an activity, it must include the {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag, which requiresthat you take care of task management as described in the <a href=" {@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a> document.
 * @deprecated Use {@link Builder} instead.
 * @removed
 */
@Deprecated public void setLatestEventInfo(Context context,CharSequence contentTitle,CharSequence contentText,PendingIntent contentIntent){
  if (context.getApplicationInfo().targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {
    Log.e(TAG,"String_Node_Str",new Throwable());
  }
  if (context.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) {
    extras.putBoolean(EXTRA_SHOW_WHEN,true);
  }
  final Notification.Builder builder=new Notification.Builder(context,this);
  if (contentTitle != null) {
    builder.setContentTitle(contentTitle);
  }
  if (contentText != null) {
    builder.setContentText(contentText);
  }
  builder.setContentIntent(contentIntent);
  builder.build();
}
Program: 191325
Project: 191325
Buggy source:
/** 
 * Sets the   {@link #contentView} field to be a view with the standard "Latest Event"layout. <p>Uses the  {@link #icon} and {@link #when} fields to set the icon and time fieldsin the view.</p>
 * @param context       The context for your application / activity.
 * @param contentTitle The title that goes in the expanded entry.
 * @param contentText  The text that goes in the expanded entry.
 * @param contentIntent The intent to launch when the user clicks the expanded notification.If this is an activity, it must include the {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag, which requiresthat you take care of task management as described in the <a href=" {@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a> document.
 * @deprecated Use {@link Builder} instead.
 * @removed
 */
@Deprecated public void setLatestEventInfo(Context context,CharSequence contentTitle,CharSequence contentText,PendingIntent contentIntent){
  if (context.getApplicationInfo().targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {
    Log.e(TAG,"String_Node_Str",new Throwable());
  }
  final Notification.Builder builder=new Notification.Builder(context,this);
  if (contentTitle != null) {
    builder.setContentTitle(contentTitle);
  }
  if (contentText != null) {
    builder.setContentText(contentText);
  }
  builder.setContentIntent(contentIntent);
  builder.build();
}

Fixed version (ground truth):
/** 
 * Sets the   {@link #contentView} field to be a view with the standard "Latest Event"layout. <p>Uses the  {@link #icon} and {@link #when} fields to set the icon and time fieldsin the view.</p>
 * @param context       The context for your application / activity.
 * @param contentTitle The title that goes in the expanded entry.
 * @param contentText  The text that goes in the expanded entry.
 * @param contentIntent The intent to launch when the user clicks the expanded notification.If this is an activity, it must include the {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag, which requiresthat you take care of task management as described in the <a href=" {@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a> document.
 * @deprecated Use {@link Builder} instead.
 * @removed
 */
@Deprecated public void setLatestEventInfo(Context context,CharSequence contentTitle,CharSequence contentText,PendingIntent contentIntent){
  if (context.getApplicationInfo().targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {
    Log.e(TAG,"String_Node_Str",new Throwable());
  }
  if (context.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) {
    extras.putBoolean(EXTRA_SHOW_WHEN,true);
  }
  final Notification.Builder builder=new Notification.Builder(context,this);
  if (contentTitle != null) {
    builder.setContentTitle(contentTitle);
  }
  if (contentText != null) {
    builder.setContentText(contentText);
  }
  builder.setContentIntent(contentIntent);
  builder.build();
}
Program: 191326
Project: 191326
Buggy source:
/** 
 * Sets the   {@link #contentView} field to be a view with the standard "Latest Event"layout. <p>Uses the  {@link #icon} and {@link #when} fields to set the icon and time fieldsin the view.</p>
 * @param context       The context for your application / activity.
 * @param contentTitle The title that goes in the expanded entry.
 * @param contentText  The text that goes in the expanded entry.
 * @param contentIntent The intent to launch when the user clicks the expanded notification.If this is an activity, it must include the {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag, which requiresthat you take care of task management as described in the <a href=" {@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a> document.
 * @deprecated Use {@link Builder} instead.
 * @removed
 */
@Deprecated public void setLatestEventInfo(Context context,CharSequence contentTitle,CharSequence contentText,PendingIntent contentIntent){
  if (context.getApplicationInfo().targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {
    Log.e(TAG,"String_Node_Str",new Throwable());
  }
  final Notification.Builder builder=new Notification.Builder(context,this);
  if (contentTitle != null) {
    builder.setContentTitle(contentTitle);
  }
  if (contentText != null) {
    builder.setContentText(contentText);
  }
  builder.setContentIntent(contentIntent);
  builder.build();
}

Fixed version (ground truth):
/** 
 * Sets the   {@link #contentView} field to be a view with the standard "Latest Event"layout. <p>Uses the  {@link #icon} and {@link #when} fields to set the icon and time fieldsin the view.</p>
 * @param context       The context for your application / activity.
 * @param contentTitle The title that goes in the expanded entry.
 * @param contentText  The text that goes in the expanded entry.
 * @param contentIntent The intent to launch when the user clicks the expanded notification.If this is an activity, it must include the {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag, which requiresthat you take care of task management as described in the <a href=" {@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a> document.
 * @deprecated Use {@link Builder} instead.
 * @removed
 */
@Deprecated public void setLatestEventInfo(Context context,CharSequence contentTitle,CharSequence contentText,PendingIntent contentIntent){
  if (context.getApplicationInfo().targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {
    Log.e(TAG,"String_Node_Str",new Throwable());
  }
  if (context.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) {
    extras.putBoolean(EXTRA_SHOW_WHEN,true);
  }
  final Notification.Builder builder=new Notification.Builder(context,this);
  if (contentTitle != null) {
    builder.setContentTitle(contentTitle);
  }
  if (contentText != null) {
    builder.setContentText(contentText);
  }
  builder.setContentIntent(contentIntent);
  builder.build();
}
Program: 191328
Project: 191328
Buggy source:
@Override public void run(){
  if (!isClosed()) {
    mDeviceCallback.onError(CameraDeviceImpl.this,CameraDeviceCallbacks.ERROR_CAMERA_SERVICE);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (!isClosed()) {
    mDeviceCallback.onError(CameraDeviceImpl.this,StateCallback.ERROR_CAMERA_SERVICE);
  }
}
Program: 191329
Project: 191329
Buggy source:
/** 
 * Listener for binder death. <p> Handle binder death for ICameraDeviceUser. Trigger onError.</p>
 */
public void binderDied(){
  Log.w(TAG,"String_Node_Str" + mCameraId + "String_Node_Str");
  if (mRemoteDevice == null) {
    return;
  }
  mInError=true;
  Runnable r=new Runnable(){
    @Override public void run(){
      if (!isClosed()) {
        mDeviceCallback.onError(CameraDeviceImpl.this,CameraDeviceCallbacks.ERROR_CAMERA_SERVICE);
      }
    }
  }
;
  CameraDeviceImpl.this.mDeviceHandler.post(r);
}

Fixed version (ground truth):
/** 
 * Listener for binder death. <p> Handle binder death for ICameraDeviceUser. Trigger onError.</p>
 */
public void binderDied(){
  Log.w(TAG,"String_Node_Str" + mCameraId + "String_Node_Str");
  if (mRemoteDevice == null) {
    return;
  }
  mInError=true;
  Runnable r=new Runnable(){
    @Override public void run(){
      if (!isClosed()) {
        mDeviceCallback.onError(CameraDeviceImpl.this,StateCallback.ERROR_CAMERA_SERVICE);
      }
    }
  }
;
  CameraDeviceImpl.this.mDeviceHandler.post(r);
}
Program: 191330
Project: 191330
Buggy source:
@Override public void onDeviceError(final int errorCode,CaptureResultExtras resultExtras){
  if (DEBUG) {
    Log.d(TAG,String.format("String_Node_Str",errorCode,resultExtras.getFrameNumber(),resultExtras.getRequestId(),resultExtras.getSubsequenceId()));
  }
synchronized (mInterfaceLock) {
    if (mRemoteDevice == null) {
      return;
    }
switch (errorCode) {
case ERROR_CAMERA_DISCONNECTED:
      CameraDeviceImpl.this.mDeviceHandler.post(mCallOnDisconnected);
    break;
default :
  Log.e(TAG,"String_Node_Str" + errorCode);
case ERROR_CAMERA_DEVICE:
case ERROR_CAMERA_SERVICE:
mInError=true;
Runnable r=new Runnable(){
@Override public void run(){
  if (!CameraDeviceImpl.this.isClosed()) {
    mDeviceCallback.onError(CameraDeviceImpl.this,errorCode);
  }
}
}
;
CameraDeviceImpl.this.mDeviceHandler.post(r);
break;
case ERROR_CAMERA_REQUEST:
case ERROR_CAMERA_RESULT:
case ERROR_CAMERA_BUFFER:
onCaptureErrorLocked(errorCode,resultExtras);
break;
}
}
}

Fixed version (ground truth):
@Override public void onDeviceError(final int errorCode,CaptureResultExtras resultExtras){
  if (DEBUG) {
    Log.d(TAG,String.format("String_Node_Str",errorCode,resultExtras.getFrameNumber(),resultExtras.getRequestId(),resultExtras.getSubsequenceId()));
  }
synchronized (mInterfaceLock) {
    if (mRemoteDevice == null) {
      return;
    }
switch (errorCode) {
case ERROR_CAMERA_DISCONNECTED:
      CameraDeviceImpl.this.mDeviceHandler.post(mCallOnDisconnected);
    break;
default :
  Log.e(TAG,"String_Node_Str" + errorCode);
case ERROR_CAMERA_DEVICE:
case ERROR_CAMERA_SERVICE:
mInError=true;
final int publicErrorCode=(errorCode == ERROR_CAMERA_DEVICE) ? StateCallback.ERROR_CAMERA_DEVICE : StateCallback.ERROR_CAMERA_SERVICE;
Runnable r=new Runnable(){
@Override public void run(){
if (!CameraDeviceImpl.this.isClosed()) {
  mDeviceCallback.onError(CameraDeviceImpl.this,publicErrorCode);
}
}
}
;
CameraDeviceImpl.this.mDeviceHandler.post(r);
break;
case ERROR_CAMERA_REQUEST:
case ERROR_CAMERA_RESULT:
case ERROR_CAMERA_BUFFER:
onCaptureErrorLocked(errorCode,resultExtras);
break;
}
}
}
Program: 191333
Project: 191333
Buggy source:
public void performReceive(Intent intent,int resultCode,String data,Bundle extras,boolean ordered,boolean sticky,int sendingUser){
  if (ActivityThread.DEBUG_BROADCAST) {
    int seq=intent.getIntExtra("String_Node_Str",-1);
    Slog.i(ActivityThread.TAG,"String_Node_Str" + intent.getAction() + "String_Node_Str"+ seq+ "String_Node_Str"+ mReceiver);
  }
  Args args=new Args(intent,resultCode,data,extras,ordered,sticky,sendingUser);
  if (!mActivityThread.post(args)) {
    if (mRegistered && ordered) {
      IActivityManager mgr=ActivityManagerNative.getDefault();
      if (ActivityThread.DEBUG_BROADCAST)       Slog.i(ActivityThread.TAG,"String_Node_Str" + mReceiver);
      args.sendFinished(mgr);
    }
  }
}

Fixed version (ground truth):
public void performReceive(Intent intent,int resultCode,String data,Bundle extras,boolean ordered,boolean sticky,int sendingUser){
  final Args args=new Args(intent,resultCode,data,extras,ordered,sticky,sendingUser);
  if (intent == null) {
    Log.wtf(TAG,"String_Node_Str");
  }
 else {
    if (ActivityThread.DEBUG_BROADCAST) {
      int seq=intent.getIntExtra("String_Node_Str",-1);
      Slog.i(ActivityThread.TAG,"String_Node_Str" + intent.getAction() + "String_Node_Str"+ seq+ "String_Node_Str"+ mReceiver);
    }
  }
  if (intent == null || !mActivityThread.post(args)) {
    if (mRegistered && ordered) {
      IActivityManager mgr=ActivityManagerNative.getDefault();
      if (ActivityThread.DEBUG_BROADCAST)       Slog.i(ActivityThread.TAG,"String_Node_Str" + mReceiver);
      args.sendFinished(mgr);
    }
  }
}
Program: 191334
Project: 191334
Buggy source:
public void performReceive(Intent intent,int resultCode,String data,Bundle extras,boolean ordered,boolean sticky,int sendingUser){
  if (ActivityThread.DEBUG_BROADCAST) {
    int seq=intent.getIntExtra("String_Node_Str",-1);
    Slog.i(ActivityThread.TAG,"String_Node_Str" + intent.getAction() + "String_Node_Str"+ seq+ "String_Node_Str"+ mReceiver);
  }
  Args args=new Args(intent,resultCode,data,extras,ordered,sticky,sendingUser);
  if (!mActivityThread.post(args)) {
    if (mRegistered && ordered) {
      IActivityManager mgr=ActivityManagerNative.getDefault();
      if (ActivityThread.DEBUG_BROADCAST)       Slog.i(ActivityThread.TAG,"String_Node_Str" + mReceiver);
      args.sendFinished(mgr);
    }
  }
}

Fixed version (ground truth):
public void performReceive(Intent intent,int resultCode,String data,Bundle extras,boolean ordered,boolean sticky,int sendingUser){
  final Args args=new Args(intent,resultCode,data,extras,ordered,sticky,sendingUser);
  if (intent == null) {
    Log.wtf(TAG,"String_Node_Str");
  }
 else {
    if (ActivityThread.DEBUG_BROADCAST) {
      int seq=intent.getIntExtra("String_Node_Str",-1);
      Slog.i(ActivityThread.TAG,"String_Node_Str" + intent.getAction() + "String_Node_Str"+ seq+ "String_Node_Str"+ mReceiver);
    }
  }
  if (intent == null || !mActivityThread.post(args)) {
    if (mRegistered && ordered) {
      IActivityManager mgr=ActivityManagerNative.getDefault();
      if (ActivityThread.DEBUG_BROADCAST)       Slog.i(ActivityThread.TAG,"String_Node_Str" + mReceiver);
      args.sendFinished(mgr);
    }
  }
}
Program: 191335
Project: 191335
Buggy source:
public void performReceive(Intent intent,int resultCode,String data,Bundle extras,boolean ordered,boolean sticky,int sendingUser){
  if (ActivityThread.DEBUG_BROADCAST) {
    int seq=intent.getIntExtra("String_Node_Str",-1);
    Slog.i(ActivityThread.TAG,"String_Node_Str" + intent.getAction() + "String_Node_Str"+ seq+ "String_Node_Str"+ mReceiver);
  }
  Args args=new Args(intent,resultCode,data,extras,ordered,sticky,sendingUser);
  if (!mActivityThread.post(args)) {
    if (mRegistered && ordered) {
      IActivityManager mgr=ActivityManagerNative.getDefault();
      if (ActivityThread.DEBUG_BROADCAST)       Slog.i(ActivityThread.TAG,"String_Node_Str" + mReceiver);
      args.sendFinished(mgr);
    }
  }
}

Fixed version (ground truth):
public void performReceive(Intent intent,int resultCode,String data,Bundle extras,boolean ordered,boolean sticky,int sendingUser){
  final Args args=new Args(intent,resultCode,data,extras,ordered,sticky,sendingUser);
  if (intent == null) {
    Log.wtf(TAG,"String_Node_Str");
  }
 else {
    if (ActivityThread.DEBUG_BROADCAST) {
      int seq=intent.getIntExtra("String_Node_Str",-1);
      Slog.i(ActivityThread.TAG,"String_Node_Str" + intent.getAction() + "String_Node_Str"+ seq+ "String_Node_Str"+ mReceiver);
    }
  }
  if (intent == null || !mActivityThread.post(args)) {
    if (mRegistered && ordered) {
      IActivityManager mgr=ActivityManagerNative.getDefault();
      if (ActivityThread.DEBUG_BROADCAST)       Slog.i(ActivityThread.TAG,"String_Node_Str" + mReceiver);
      args.sendFinished(mgr);
    }
  }
}
Program: 191336
Project: 191336
Buggy source:
@Override public CharSequence getAccessibilityClassName(){
  return TaskStackView.class.getName();
}

Fixed version (ground truth):
@Override public CharSequence getAccessibilityClassName(){
  return ScrollView.class.getName();
}
Program: 191339
Project: 191339
Buggy source:
@Override public boolean performAccessibilityAction(int action,Bundle arguments){
  if (super.performAccessibilityAction(action,arguments)) {
    return true;
  }
switch (action) {
case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
{
      setRelativeFocusedTask(true,false,false);
      return true;
    }
case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
{
    setRelativeFocusedTask(false,false,false);
    return true;
  }
}
return false;
}

Fixed version (ground truth):
@Override public boolean performAccessibilityAction(int action,Bundle arguments){
  if (super.performAccessibilityAction(action,arguments)) {
    return true;
  }
  Task focusedTask=getAccessibilityFocusedTask();
  int taskIndex=mStack.indexOfStackTask(focusedTask);
  if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) {
switch (action) {
case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
{
        setFocusedTask(taskIndex + 1,true,true,0);
        return true;
      }
case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
{
      setFocusedTask(taskIndex - 1,true,true,0);
      return true;
    }
}
}
return false;
}
Program: 191340
Project: 191340
Buggy source:
@Override public void onReturnViewToPool(TaskView tv){
  final Task task=tv.getTask();
  unbindTaskView(tv,task);
  tv.resetViewProperties();
  tv.setFocusedState(false,false);
  tv.setClipViewInStack(false);
  if (mScreenPinningEnabled) {
    tv.hideActionButton(false,0,false,null);
  }
  detachViewFromParent(tv);
  updateTaskViewsList();
}

Fixed version (ground truth):
@Override public void onReturnViewToPool(TaskView tv){
  final Task task=tv.getTask();
  unbindTaskView(tv,task);
  tv.clearAccessibilityFocus();
  tv.resetViewProperties();
  tv.setFocusedState(false,false);
  tv.setClipViewInStack(false);
  if (mScreenPinningEnabled) {
    tv.hideActionButton(false,0,false,null);
  }
  detachViewFromParent(tv);
  updateTaskViewsList();
}
Program: 191341
Project: 191341
Buggy source:
@Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfo(info);
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  if (taskViewCount > 1 && mFocusedTask != null) {
    info.setScrollable(true);
    int focusedTaskIndex=mStack.indexOfStackTask(mFocusedTask);
    if (focusedTaskIndex > 0) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    }
    if (focusedTaskIndex < mStack.getTaskCount() - 1) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
  }
}

Fixed version (ground truth):
@Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfo(info);
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  if (taskViewCount > 1) {
    Task focusedTask=getAccessibilityFocusedTask();
    info.setScrollable(true);
    int focusedTaskIndex=mStack.indexOfStackTask(focusedTask);
    if (focusedTaskIndex > 0) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
    if (0 <= focusedTaskIndex && focusedTaskIndex < mStack.getTaskCount() - 1) {
      info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    }
  }
}
Program: 191343
Project: 191343
Buggy source:
/** 
 * Explicitly sets the focused state of this task.
 */
public void setFocusedState(boolean isFocused,boolean requestViewFocus){
  SystemServicesProxy ssp=Recents.getSystemServices();
  if (isFocused) {
    if (requestViewFocus && !isFocused()) {
      requestFocus();
    }
    if (requestViewFocus && !isAccessibilityFocused() && ssp.isTouchExplorationEnabled()) {
      requestAccessibilityFocus();
    }
  }
 else {
    if (isAccessibilityFocused() && ssp.isTouchExplorationEnabled()) {
      clearAccessibilityFocus();
    }
  }
}

Fixed version (ground truth):
/** 
 * Explicitly sets the focused state of this task.
 */
public void setFocusedState(boolean isFocused,boolean requestViewFocus){
  if (isFocused) {
    if (requestViewFocus && !isFocused()) {
      requestFocus();
    }
  }
 else {
    if (isAccessibilityFocused() && mTouchExplorationEnabled) {
      clearAccessibilityFocus();
    }
  }
}
Program: 191344
Project: 191344
Buggy source:
@Override public void onTaskDataLoaded(Task task,ActivityManager.TaskThumbnailInfo thumbnailInfo){
  mThumbnailView.onTaskDataLoaded(thumbnailInfo);
  mHeaderView.onTaskDataLoaded();
  mTaskDataLoaded=true;
}

Fixed version (ground truth):
@Override public void onTaskDataLoaded(Task task,ActivityManager.TaskThumbnailInfo thumbnailInfo){
  mThumbnailView.onTaskDataLoaded(thumbnailInfo);
  mHeaderView.onTaskDataLoaded();
}
Program: 191345
Project: 191345
Buggy source:
@Override public void onTaskDataUnloaded(){
  mTask.removeCallback(this);
  mThumbnailView.unbindFromTask();
  mHeaderView.unbindFromTask(mTouchExplorationEnabled);
  mTaskDataLoaded=false;
}

Fixed version (ground truth):
@Override public void onTaskDataUnloaded(){
  mTask.removeCallback(this);
  mThumbnailView.unbindFromTask();
  mHeaderView.unbindFromTask(mTouchExplorationEnabled);
}
Program: 191346
Project: 191346
Buggy source:
public void writeToParcel(Parcel out,int flags){
  out.writeInt(category);
  out.writeInt(id);
  out.writeInt(minTimeMs);
  out.writeInt(maxTimeMs);
  out.writeInt(averageTimeMs);
  out.writeLong(sampleCount);
  if (initialTimings == null) {
    out.writeInt(ABSENT);
  }
 else {
    out.writeInt(PRESENT);
    out.writeIntArray(initialTimings);
  }
  out.writeInt(bucketCount);
  out.writeIntArray(bucketEndPoints);
  out.writeIntArray(bucketCounters);
}

Fixed version (ground truth):
public void writeToParcel(Parcel out,int flags){
  out.writeInt(category);
  out.writeInt(id);
  out.writeInt(minTimeMs);
  out.writeInt(maxTimeMs);
  out.writeInt(averageTimeMs);
  out.writeInt(sampleCount);
  if (initialTimings == null) {
    out.writeInt(ABSENT);
  }
 else {
    out.writeInt(PRESENT);
    out.writeIntArray(initialTimings);
  }
  out.writeInt(bucketCount);
  out.writeIntArray(bucketEndPoints);
  out.writeIntArray(bucketCounters);
}