nus-yam/ex-repair huggingface dataset:
Program: 194660
Project: 194660
Buggy source:
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}

Fixed version (ground truth):
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}
Program: 194661
Project: 194661
Buggy source:
private void doOnCreate(){
  mTheme=mTheme != 0 ? mTheme : com.android.internal.R.style.Theme_DeviceDefault_VoiceInteractionSession;
  mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mWindow=new SoftInputWindow(mContext,"String_Node_Str",mTheme,mCallbacks,this,mDispatcherState,WindowManager.LayoutParams.TYPE_VOICE_INTERACTION,Gravity.BOTTOM,true);
  mWindow.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
  initViews();
  mWindow.getWindow().setLayout(MATCH_PARENT,MATCH_PARENT);
  mWindow.setToken(mToken);
}

Fixed version (ground truth):
private void doOnCreate(){
  mTheme=mTheme != 0 ? mTheme : com.android.internal.R.style.Theme_DeviceDefault_VoiceInteractionSession;
  mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mWindow=new SoftInputWindow(mContext,"String_Node_Str",mTheme,mCallbacks,this,mDispatcherState,WindowManager.LayoutParams.TYPE_VOICE_INTERACTION,Gravity.BOTTOM,true);
  mWindow.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);
  initViews();
  mWindow.getWindow().setLayout(MATCH_PARENT,MATCH_PARENT);
  mWindow.setToken(mToken);
}
Program: 194663
Project: 194663
Buggy source:
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}

Fixed version (ground truth):
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
    mStatusBarView.removePendingHideExpandedRunnables();
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}
Program: 194664
Project: 194664
Buggy source:
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(new Runnable(){
    @Override public void run(){
      mBar.makeExpandedInvisible();
    }
  }
);
  mLastFullyOpenedPanel=null;
}

Fixed version (ground truth):
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(mHideExpandedRunnable);
  mLastFullyOpenedPanel=null;
}
Program: 194665
Project: 194665
Buggy source:
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}

Fixed version (ground truth):
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
    mStatusBarView.removePendingHideExpandedRunnables();
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}
Program: 194666
Project: 194666
Buggy source:
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(new Runnable(){
    @Override public void run(){
      mBar.makeExpandedInvisible();
    }
  }
);
  mLastFullyOpenedPanel=null;
}

Fixed version (ground truth):
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(mHideExpandedRunnable);
  mLastFullyOpenedPanel=null;
}
Program: 194667
Project: 194667
Buggy source:
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}

Fixed version (ground truth):
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
    mStatusBarView.removePendingHideExpandedRunnables();
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}
Program: 194668
Project: 194668
Buggy source:
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(new Runnable(){
    @Override public void run(){
      mBar.makeExpandedInvisible();
    }
  }
);
  mLastFullyOpenedPanel=null;
}

Fixed version (ground truth):
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(mHideExpandedRunnable);
  mLastFullyOpenedPanel=null;
}
Program: 194669
Project: 194669
Buggy source:
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}

Fixed version (ground truth):
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
    mStatusBarView.removePendingHideExpandedRunnables();
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}
Program: 194670
Project: 194670
Buggy source:
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(new Runnable(){
    @Override public void run(){
      mBar.makeExpandedInvisible();
    }
  }
);
  mLastFullyOpenedPanel=null;
}

Fixed version (ground truth):
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(mHideExpandedRunnable);
  mLastFullyOpenedPanel=null;
}
Program: 194671
Project: 194671
Buggy source:
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}

Fixed version (ground truth):
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
    mStatusBarView.removePendingHideExpandedRunnables();
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}
Program: 194672
Project: 194672
Buggy source:
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(new Runnable(){
    @Override public void run(){
      mBar.makeExpandedInvisible();
    }
  }
);
  mLastFullyOpenedPanel=null;
}

Fixed version (ground truth):
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(mHideExpandedRunnable);
  mLastFullyOpenedPanel=null;
}
Program: 194673
Project: 194673
Buggy source:
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}

Fixed version (ground truth):
private void updateKeyguardState(boolean goingToFullShade,boolean fromShadeLocked){
  if (mState == StatusBarState.KEYGUARD) {
    mKeyguardIndicationController.setVisible(true);
    mNotificationPanel.resetViews();
    mKeyguardUserSwitcher.setKeyguard(true,fromShadeLocked);
    mStatusBarView.removePendingHideExpandedRunnables();
  }
 else {
    mKeyguardIndicationController.setVisible(false);
    mKeyguardUserSwitcher.setKeyguard(false,goingToFullShade || mState == StatusBarState.SHADE_LOCKED || fromShadeLocked);
  }
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    mScrimController.setKeyguardShowing(true);
    mIconPolicy.setKeyguardShowing(true);
  }
 else {
    mScrimController.setKeyguardShowing(false);
    mIconPolicy.setKeyguardShowing(false);
  }
  mNotificationPanel.setBarState(mState,mKeyguardFadingAway,goingToFullShade);
  updateDozingState();
  updatePublicMode();
  updateStackScrollerState(goingToFullShade);
  updateNotifications();
  checkBarModes();
  updateMediaMetaData(false);
  mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(),mStatusBarKeyguardViewManager.isSecure());
}
Program: 194674
Project: 194674
Buggy source:
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(new Runnable(){
    @Override public void run(){
      mBar.makeExpandedInvisible();
    }
  }
);
  mLastFullyOpenedPanel=null;
}

Fixed version (ground truth):
@Override public void onAllPanelsCollapsed(){
  super.onAllPanelsCollapsed();
  if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) {
    Log.i(PhoneStatusBar.TAG,"String_Node_Str" + Log.getStackTraceString(new Throwable()));
  }
  postOnAnimation(mHideExpandedRunnable);
  mLastFullyOpenedPanel=null;
}
Program: 194675
Project: 194675
Buggy source:
void hideRecentsInternal(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    ActivityManager.RunningTaskInfo topTask=mSystemServicesProxy.getTopMostTask();
    if (topTask != null && mSystemServicesProxy.isRecentsTopMost(topTask,null)) {
      Intent intent=createLocalBroadcastIntent(mContext,ACTION_HIDE_RECENTS_ACTIVITY);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}

Fixed version (ground truth):
void hideRecentsInternal(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    Intent intent=createLocalBroadcastIntent(mContext,ACTION_HIDE_RECENTS_ACTIVITY);
    intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
    intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
  }
}
Program: 194676
Project: 194676
Buggy source:
@Override protected void onProviderChanged(int appWidgetId,AppWidgetProviderInfo appWidgetInfo){
  if (mCb == null)   return;
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  if (appWidgetId > -1 && appWidgetId == mConfig.searchBarAppWidgetId) {
    ssp.unbindSearchAppWidget(this,appWidgetId);
    mConfig.updateSearchBarAppWidgetId(mContext,-1);
    mCb.refreshSearchWidget();
  }
}

Fixed version (ground truth):
@Override protected void onProviderChanged(int appWidgetId,AppWidgetProviderInfo appWidgetInfo){
  if (mCb == null)   return;
  if (mContext == null)   return;
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  if (appWidgetId > -1 && appWidgetId == mConfig.searchBarAppWidgetId) {
    ssp.unbindSearchAppWidget(this,appWidgetId);
    mConfig.updateSearchBarAppWidgetId(mContext,-1);
    mCb.refreshSearchWidget();
  }
}
Program: 194677
Project: 194677
Buggy source:
void hideRecentsInternal(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    ActivityManager.RunningTaskInfo topTask=mSystemServicesProxy.getTopMostTask();
    if (topTask != null && mSystemServicesProxy.isRecentsTopMost(topTask,null)) {
      Intent intent=createLocalBroadcastIntent(mContext,ACTION_HIDE_RECENTS_ACTIVITY);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}

Fixed version (ground truth):
void hideRecentsInternal(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    Intent intent=createLocalBroadcastIntent(mContext,ACTION_HIDE_RECENTS_ACTIVITY);
    intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
    intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
  }
}
Program: 194678
Project: 194678
Buggy source:
@Override protected void onProviderChanged(int appWidgetId,AppWidgetProviderInfo appWidgetInfo){
  if (mCb == null)   return;
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  if (appWidgetId > -1 && appWidgetId == mConfig.searchBarAppWidgetId) {
    ssp.unbindSearchAppWidget(this,appWidgetId);
    mConfig.updateSearchBarAppWidgetId(mContext,-1);
    mCb.refreshSearchWidget();
  }
}

Fixed version (ground truth):
@Override protected void onProviderChanged(int appWidgetId,AppWidgetProviderInfo appWidgetInfo){
  if (mCb == null)   return;
  if (mContext == null)   return;
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  if (appWidgetId > -1 && appWidgetId == mConfig.searchBarAppWidgetId) {
    ssp.unbindSearchAppWidget(this,appWidgetId);
    mConfig.updateSearchBarAppWidgetId(mContext,-1);
    mCb.refreshSearchWidget();
  }
}
Program: 194679
Project: 194679
Buggy source:
void hideRecentsInternal(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    ActivityManager.RunningTaskInfo topTask=mSystemServicesProxy.getTopMostTask();
    if (topTask != null && mSystemServicesProxy.isRecentsTopMost(topTask,null)) {
      Intent intent=createLocalBroadcastIntent(mContext,ACTION_HIDE_RECENTS_ACTIVITY);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}

Fixed version (ground truth):
void hideRecentsInternal(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    Intent intent=createLocalBroadcastIntent(mContext,ACTION_HIDE_RECENTS_ACTIVITY);
    intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
    intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
  }
}
Program: 194680
Project: 194680
Buggy source:
@Override protected void onProviderChanged(int appWidgetId,AppWidgetProviderInfo appWidgetInfo){
  if (mCb == null)   return;
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  if (appWidgetId > -1 && appWidgetId == mConfig.searchBarAppWidgetId) {
    ssp.unbindSearchAppWidget(this,appWidgetId);
    mConfig.updateSearchBarAppWidgetId(mContext,-1);
    mCb.refreshSearchWidget();
  }
}

Fixed version (ground truth):
@Override protected void onProviderChanged(int appWidgetId,AppWidgetProviderInfo appWidgetInfo){
  if (mCb == null)   return;
  if (mContext == null)   return;
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  if (appWidgetId > -1 && appWidgetId == mConfig.searchBarAppWidgetId) {
    ssp.unbindSearchAppWidget(this,appWidgetId);
    mConfig.updateSearchBarAppWidgetId(mContext,-1);
    mCb.refreshSearchWidget();
  }
}
Program: 194681
Project: 194681
Buggy source:
void hideRecentsInternal(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    ActivityManager.RunningTaskInfo topTask=mSystemServicesProxy.getTopMostTask();
    if (topTask != null && mSystemServicesProxy.isRecentsTopMost(topTask,null)) {
      Intent intent=createLocalBroadcastIntent(mContext,ACTION_HIDE_RECENTS_ACTIVITY);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}

Fixed version (ground truth):
void hideRecentsInternal(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    Intent intent=createLocalBroadcastIntent(mContext,ACTION_HIDE_RECENTS_ACTIVITY);
    intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
    intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
  }
}
Program: 194682
Project: 194682
Buggy source:
@Override protected void onProviderChanged(int appWidgetId,AppWidgetProviderInfo appWidgetInfo){
  if (mCb == null)   return;
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  if (appWidgetId > -1 && appWidgetId == mConfig.searchBarAppWidgetId) {
    ssp.unbindSearchAppWidget(this,appWidgetId);
    mConfig.updateSearchBarAppWidgetId(mContext,-1);
    mCb.refreshSearchWidget();
  }
}

Fixed version (ground truth):
@Override protected void onProviderChanged(int appWidgetId,AppWidgetProviderInfo appWidgetInfo){
  if (mCb == null)   return;
  if (mContext == null)   return;
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  if (appWidgetId > -1 && appWidgetId == mConfig.searchBarAppWidgetId) {
    ssp.unbindSearchAppWidget(this,appWidgetId);
    mConfig.updateSearchBarAppWidgetId(mContext,-1);
    mCb.refreshSearchWidget();
  }
}
Program: 194683
Project: 194683
Buggy source:
void hideRecentsInternal(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    ActivityManager.RunningTaskInfo topTask=mSystemServicesProxy.getTopMostTask();
    if (topTask != null && mSystemServicesProxy.isRecentsTopMost(topTask,null)) {
      Intent intent=createLocalBroadcastIntent(mContext,ACTION_HIDE_RECENTS_ACTIVITY);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}

Fixed version (ground truth):
void hideRecentsInternal(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    Intent intent=createLocalBroadcastIntent(mContext,ACTION_HIDE_RECENTS_ACTIVITY);
    intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
    intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
  }
}
Program: 194684
Project: 194684
Buggy source:
@Override protected void onProviderChanged(int appWidgetId,AppWidgetProviderInfo appWidgetInfo){
  if (mCb == null)   return;
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  if (appWidgetId > -1 && appWidgetId == mConfig.searchBarAppWidgetId) {
    ssp.unbindSearchAppWidget(this,appWidgetId);
    mConfig.updateSearchBarAppWidgetId(mContext,-1);
    mCb.refreshSearchWidget();
  }
}

Fixed version (ground truth):
@Override protected void onProviderChanged(int appWidgetId,AppWidgetProviderInfo appWidgetInfo){
  if (mCb == null)   return;
  if (mContext == null)   return;
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  if (appWidgetId > -1 && appWidgetId == mConfig.searchBarAppWidgetId) {
    ssp.unbindSearchAppWidget(this,appWidgetId);
    mConfig.updateSearchBarAppWidgetId(mContext,-1);
    mCb.refreshSearchWidget();
  }
}
Program: 194685
Project: 194685
Buggy source:
public TaskStackView(Context context,TaskStack stack){
  super(context);
  setStack(stack);
  mConfig=RecentsConfiguration.getInstance();
  mViewPool=new ViewPool<TaskView,Task>(context,this);
  mInflater=LayoutInflater.from(context);
  mLayoutAlgorithm=new TaskStackViewLayoutAlgorithm(mConfig);
  mFilterAlgorithm=new TaskStackViewFilterAlgorithm(mConfig,this,mViewPool);
  mStackScroller=new TaskStackViewScroller(context,mConfig,mLayoutAlgorithm);
  mStackScroller.setCallbacks(this);
  mTouchHandler=new TaskStackViewTouchHandler(context,this,mConfig,mStackScroller);
  mUIDozeTrigger=new DozeTrigger(mConfig.taskBarDismissDozeDelaySeconds,new Runnable(){
    @Override public void run(){
      List<TaskView> taskViews=getTaskViews();
      int taskViewCount=taskViews.size();
      for (int i=0; i < taskViewCount; i++) {
        TaskView tv=taskViews.get(i);
        tv.startNoUserInteractionAnimation();
      }
    }
  }
);
}

Fixed version (ground truth):
public TaskStackView(Context context,TaskStack stack){
  super(context);
  setStack(stack);
  mConfig=RecentsConfiguration.getInstance();
  mViewPool=new ViewPool<TaskView,Task>(context,this);
  mInflater=LayoutInflater.from(context);
  mLayoutAlgorithm=new TaskStackViewLayoutAlgorithm(mConfig);
  mFilterAlgorithm=new TaskStackViewFilterAlgorithm(mConfig,this,mViewPool);
  mStackScroller=new TaskStackViewScroller(context,mConfig,mLayoutAlgorithm);
  mStackScroller.setCallbacks(this);
  mTouchHandler=new TaskStackViewTouchHandler(context,this,mConfig,mStackScroller);
  mUIDozeTrigger=new DozeTrigger(mConfig.taskBarDismissDozeDelaySeconds,new Runnable(){
    @Override public void run(){
      List<TaskView> taskViews=getTaskViews();
      int taskViewCount=taskViews.size();
      for (int i=0; i < taskViewCount; i++) {
        TaskView tv=taskViews.get(i);
        tv.startNoUserInteractionAnimation();
      }
    }
  }
);
  setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
Program: 194686
Project: 194686
Buggy source:
/** 
 * Ensures that there is a task focused, if nothing is focused, then we will use the task at the center of the visible stack.
 */
public boolean ensureFocusedTask(){
  if (mFocusedTaskIndex < 0) {
    int x=mLayoutAlgorithm.mStackVisibleRect.centerX();
    int y=mLayoutAlgorithm.mStackVisibleRect.centerY();
    List<TaskView> taskViews=getTaskViews();
    int taskViewCount=taskViews.size();
    for (int i=taskViewCount - 1; i >= 0; i--) {
      TaskView tv=taskViews.get(i);
      tv.getHitRect(mTmpRect);
      if (mTmpRect.contains(x,y)) {
        mFocusedTaskIndex=mStack.indexOfTask(tv.getTask());
        break;
      }
    }
    if (mFocusedTaskIndex < 0 && taskViewCount > 0) {
      mFocusedTaskIndex=taskViewCount - 1;
    }
  }
  return mFocusedTaskIndex >= 0;
}

Fixed version (ground truth):
/** 
 * Ensures that there is a task focused, if nothing is focused, then we will use the task at the center of the visible stack.
 */
public boolean ensureFocusedTask(boolean findClosestToCenter){
  if (mFocusedTaskIndex < 0) {
    List<TaskView> taskViews=getTaskViews();
    int taskViewCount=taskViews.size();
    if (findClosestToCenter) {
      int x=mLayoutAlgorithm.mStackVisibleRect.centerX();
      int y=mLayoutAlgorithm.mStackVisibleRect.centerY();
      for (int i=taskViewCount - 1; i >= 0; i--) {
        TaskView tv=taskViews.get(i);
        tv.getHitRect(mTmpRect);
        if (mTmpRect.contains(x,y)) {
          mFocusedTaskIndex=mStack.indexOfTask(tv.getTask());
          mPrevAccessibilityFocusedIndex=mFocusedTaskIndex;
          break;
        }
      }
    }
    if (mFocusedTaskIndex < 0 && taskViewCount > 0) {
      TaskView tv=taskViews.get(taskViewCount - 1);
      mFocusedTaskIndex=mStack.indexOfTask(tv.getTask());
      mPrevAccessibilityFocusedIndex=mFocusedTaskIndex;
    }
  }
  return mFocusedTaskIndex >= 0;
}
Program: 194688
Project: 194688
Buggy source:
/** 
 * Resets the focused task. 
 */
void resetFocusedTask(){
  if ((0 <= mFocusedTaskIndex) && (mFocusedTaskIndex < mStack.getTaskCount())) {
    Task t=mStack.getTasks().get(mFocusedTaskIndex);
    TaskView tv=getChildViewForTask(t);
    if (tv != null) {
      tv.unsetFocusedTask();
    }
  }
  mFocusedTaskIndex=-1;
}

Fixed version (ground truth):
/** 
 * Resets the focused task. 
 */
void resetFocusedTask(){
  if ((0 <= mFocusedTaskIndex) && (mFocusedTaskIndex < mStack.getTaskCount())) {
    Task t=mStack.getTasks().get(mFocusedTaskIndex);
    TaskView tv=getChildViewForTask(t);
    if (tv != null) {
      tv.unsetFocusedTask();
    }
  }
  mFocusedTaskIndex=-1;
  mPrevAccessibilityFocusedIndex=-1;
}
Program: 194689
Project: 194689
Buggy source:
/** 
 * Focuses the task at the specified index in the stack 
 */
void focusTask(int taskIndex,boolean scrollToNewPosition,final boolean animateFocusedState){
  if (taskIndex == mFocusedTaskIndex)   return;
  if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) {
    mFocusedTaskIndex=taskIndex;
    Task t=mStack.getTasks().get(taskIndex);
    TaskView tv=getChildViewForTask(t);
    Runnable postScrollRunnable=null;
    if (tv != null) {
      tv.setFocusedTask(animateFocusedState);
    }
 else {
      postScrollRunnable=new Runnable(){
        @Override public void run(){
          Task t=mStack.getTasks().get(mFocusedTaskIndex);
          TaskView tv=getChildViewForTask(t);
          if (tv != null) {
            tv.setFocusedTask(animateFocusedState);
          }
        }
      }
;
    }
    if (scrollToNewPosition) {
      float newScroll=mLayoutAlgorithm.getStackScrollForTask(t) - 0.5f;
      newScroll=mStackScroller.getBoundedStackScroll(newScroll);
      mStackScroller.animateScroll(mStackScroller.getStackScroll(),newScroll,postScrollRunnable);
    }
 else {
      if (postScrollRunnable != null) {
        postScrollRunnable.run();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Focuses the task at the specified index in the stack 
 */
void focusTask(int taskIndex,boolean scrollToNewPosition,final boolean animateFocusedState){
  if (taskIndex == mFocusedTaskIndex)   return;
  if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) {
    mFocusedTaskIndex=taskIndex;
    mPrevAccessibilityFocusedIndex=taskIndex;
    final Task t=mStack.getTasks().get(mFocusedTaskIndex);
    Runnable postScrollRunnable=new Runnable(){
      @Override public void run(){
        TaskView tv=getChildViewForTask(t);
        if (tv != null) {
          tv.setFocusedTask(animateFocusedState);
          tv.requestAccessibilityFocus();
        }
      }
    }
;
    if (scrollToNewPosition) {
      float newScroll=mLayoutAlgorithm.getStackScrollForTask(t) - 0.5f;
      newScroll=mStackScroller.getBoundedStackScroll(newScroll);
      mStackScroller.animateScroll(mStackScroller.getStackScroll(),newScroll,postScrollRunnable);
    }
 else {
      if (postScrollRunnable != null) {
        postScrollRunnable.run();
      }
    }
  }
}
Program: 194690
Project: 194690
Buggy source:
/** 
 * Handles generic motion events 
 */
public boolean onGenericMotionEvent(MotionEvent ev){
  if ((ev.getSource() & InputDevice.SOURCE_CLASS_POINTER) == InputDevice.SOURCE_CLASS_POINTER) {
    int action=ev.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_SCROLL:
      float vScroll=ev.getAxisValue(MotionEvent.AXIS_VSCROLL);
    if (vScroll > 0) {
      if (mSv.ensureFocusedTask()) {
        mSv.focusNextTask(true,false);
      }
    }
 else {
      if (mSv.ensureFocusedTask()) {
        mSv.focusNextTask(false,false);
      }
    }
  return true;
}
}
return false;
}

Fixed version (ground truth):
/** 
 * Handles generic motion events 
 */
public boolean onGenericMotionEvent(MotionEvent ev){
  if ((ev.getSource() & InputDevice.SOURCE_CLASS_POINTER) == InputDevice.SOURCE_CLASS_POINTER) {
    int action=ev.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_SCROLL:
      float vScroll=ev.getAxisValue(MotionEvent.AXIS_VSCROLL);
    if (vScroll > 0) {
      if (mSv.ensureFocusedTask(true)) {
        mSv.focusNextTask(true,false);
      }
    }
 else {
      if (mSv.ensureFocusedTask(true)) {
        mSv.focusNextTask(false,false);
      }
    }
  return true;
}
}
return false;
}
Program: 194691
Project: 194691
Buggy source:
public TaskStackView(Context context,TaskStack stack){
  super(context);
  setStack(stack);
  mConfig=RecentsConfiguration.getInstance();
  mViewPool=new ViewPool<TaskView,Task>(context,this);
  mInflater=LayoutInflater.from(context);
  mLayoutAlgorithm=new TaskStackViewLayoutAlgorithm(mConfig);
  mFilterAlgorithm=new TaskStackViewFilterAlgorithm(mConfig,this,mViewPool);
  mStackScroller=new TaskStackViewScroller(context,mConfig,mLayoutAlgorithm);
  mStackScroller.setCallbacks(this);
  mTouchHandler=new TaskStackViewTouchHandler(context,this,mConfig,mStackScroller);
  mUIDozeTrigger=new DozeTrigger(mConfig.taskBarDismissDozeDelaySeconds,new Runnable(){
    @Override public void run(){
      List<TaskView> taskViews=getTaskViews();
      int taskViewCount=taskViews.size();
      for (int i=0; i < taskViewCount; i++) {
        TaskView tv=taskViews.get(i);
        tv.startNoUserInteractionAnimation();
      }
    }
  }
);
}

Fixed version (ground truth):
public TaskStackView(Context context,TaskStack stack){
  super(context);
  setStack(stack);
  mConfig=RecentsConfiguration.getInstance();
  mViewPool=new ViewPool<TaskView,Task>(context,this);
  mInflater=LayoutInflater.from(context);
  mLayoutAlgorithm=new TaskStackViewLayoutAlgorithm(mConfig);
  mFilterAlgorithm=new TaskStackViewFilterAlgorithm(mConfig,this,mViewPool);
  mStackScroller=new TaskStackViewScroller(context,mConfig,mLayoutAlgorithm);
  mStackScroller.setCallbacks(this);
  mTouchHandler=new TaskStackViewTouchHandler(context,this,mConfig,mStackScroller);
  mUIDozeTrigger=new DozeTrigger(mConfig.taskBarDismissDozeDelaySeconds,new Runnable(){
    @Override public void run(){
      List<TaskView> taskViews=getTaskViews();
      int taskViewCount=taskViews.size();
      for (int i=0; i < taskViewCount; i++) {
        TaskView tv=taskViews.get(i);
        tv.startNoUserInteractionAnimation();
      }
    }
  }
);
  setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
Program: 194692
Project: 194692
Buggy source:
/** 
 * Ensures that there is a task focused, if nothing is focused, then we will use the task at the center of the visible stack.
 */
public boolean ensureFocusedTask(){
  if (mFocusedTaskIndex < 0) {
    int x=mLayoutAlgorithm.mStackVisibleRect.centerX();
    int y=mLayoutAlgorithm.mStackVisibleRect.centerY();
    List<TaskView> taskViews=getTaskViews();
    int taskViewCount=taskViews.size();
    for (int i=taskViewCount - 1; i >= 0; i--) {
      TaskView tv=taskViews.get(i);
      tv.getHitRect(mTmpRect);
      if (mTmpRect.contains(x,y)) {
        mFocusedTaskIndex=mStack.indexOfTask(tv.getTask());
        break;
      }
    }
    if (mFocusedTaskIndex < 0 && taskViewCount > 0) {
      mFocusedTaskIndex=taskViewCount - 1;
    }
  }
  return mFocusedTaskIndex >= 0;
}

Fixed version (ground truth):
/** 
 * Ensures that there is a task focused, if nothing is focused, then we will use the task at the center of the visible stack.
 */
public boolean ensureFocusedTask(boolean findClosestToCenter){
  if (mFocusedTaskIndex < 0) {
    List<TaskView> taskViews=getTaskViews();
    int taskViewCount=taskViews.size();
    if (findClosestToCenter) {
      int x=mLayoutAlgorithm.mStackVisibleRect.centerX();
      int y=mLayoutAlgorithm.mStackVisibleRect.centerY();
      for (int i=taskViewCount - 1; i >= 0; i--) {
        TaskView tv=taskViews.get(i);
        tv.getHitRect(mTmpRect);
        if (mTmpRect.contains(x,y)) {
          mFocusedTaskIndex=mStack.indexOfTask(tv.getTask());
          mPrevAccessibilityFocusedIndex=mFocusedTaskIndex;
          break;
        }
      }
    }
    if (mFocusedTaskIndex < 0 && taskViewCount > 0) {
      TaskView tv=taskViews.get(taskViewCount - 1);
      mFocusedTaskIndex=mStack.indexOfTask(tv.getTask());
      mPrevAccessibilityFocusedIndex=mFocusedTaskIndex;
    }
  }
  return mFocusedTaskIndex >= 0;
}
Program: 194694
Project: 194694
Buggy source:
/** 
 * Resets the focused task. 
 */
void resetFocusedTask(){
  if ((0 <= mFocusedTaskIndex) && (mFocusedTaskIndex < mStack.getTaskCount())) {
    Task t=mStack.getTasks().get(mFocusedTaskIndex);
    TaskView tv=getChildViewForTask(t);
    if (tv != null) {
      tv.unsetFocusedTask();
    }
  }
  mFocusedTaskIndex=-1;
}

Fixed version (ground truth):
/** 
 * Resets the focused task. 
 */
void resetFocusedTask(){
  if ((0 <= mFocusedTaskIndex) && (mFocusedTaskIndex < mStack.getTaskCount())) {
    Task t=mStack.getTasks().get(mFocusedTaskIndex);
    TaskView tv=getChildViewForTask(t);
    if (tv != null) {
      tv.unsetFocusedTask();
    }
  }
  mFocusedTaskIndex=-1;
  mPrevAccessibilityFocusedIndex=-1;
}
Program: 194695
Project: 194695
Buggy source:
/** 
 * Focuses the task at the specified index in the stack 
 */
void focusTask(int taskIndex,boolean scrollToNewPosition,final boolean animateFocusedState){
  if (taskIndex == mFocusedTaskIndex)   return;
  if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) {
    mFocusedTaskIndex=taskIndex;
    Task t=mStack.getTasks().get(taskIndex);
    TaskView tv=getChildViewForTask(t);
    Runnable postScrollRunnable=null;
    if (tv != null) {
      tv.setFocusedTask(animateFocusedState);
    }
 else {
      postScrollRunnable=new Runnable(){
        @Override public void run(){
          Task t=mStack.getTasks().get(mFocusedTaskIndex);
          TaskView tv=getChildViewForTask(t);
          if (tv != null) {
            tv.setFocusedTask(animateFocusedState);
          }
        }
      }
;
    }
    if (scrollToNewPosition) {
      float newScroll=mLayoutAlgorithm.getStackScrollForTask(t) - 0.5f;
      newScroll=mStackScroller.getBoundedStackScroll(newScroll);
      mStackScroller.animateScroll(mStackScroller.getStackScroll(),newScroll,postScrollRunnable);
    }
 else {
      if (postScrollRunnable != null) {
        postScrollRunnable.run();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Focuses the task at the specified index in the stack 
 */
void focusTask(int taskIndex,boolean scrollToNewPosition,final boolean animateFocusedState){
  if (taskIndex == mFocusedTaskIndex)   return;
  if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) {
    mFocusedTaskIndex=taskIndex;
    mPrevAccessibilityFocusedIndex=taskIndex;
    final Task t=mStack.getTasks().get(mFocusedTaskIndex);
    Runnable postScrollRunnable=new Runnable(){
      @Override public void run(){
        TaskView tv=getChildViewForTask(t);
        if (tv != null) {
          tv.setFocusedTask(animateFocusedState);
          tv.requestAccessibilityFocus();
        }
      }
    }
;
    if (scrollToNewPosition) {
      float newScroll=mLayoutAlgorithm.getStackScrollForTask(t) - 0.5f;
      newScroll=mStackScroller.getBoundedStackScroll(newScroll);
      mStackScroller.animateScroll(mStackScroller.getStackScroll(),newScroll,postScrollRunnable);
    }
 else {
      if (postScrollRunnable != null) {
        postScrollRunnable.run();
      }
    }
  }
}