Program: 184561
Project: 184561
Buggy source:
void setMode(int mode){
  if (mMode == mode) {
    return;
  }
  findViewById(R.id.slideShowContainer).setVisibility(mode == MODE_SLIDESHOW ? View.VISIBLE : View.GONE);
  findViewById(R.id.abs).setVisibility(mode == MODE_NORMAL ? View.VISIBLE : View.GONE);
  Window win=getWindow();
  mMode=mode;
  if (mode == MODE_SLIDESHOW) {
    win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    mImageView.clear();
    mActionIconPanel.setVisibility(View.GONE);
    mShutterButton.setVisibility(View.GONE);
    findViewById(R.id.slideShowContainer).getRootView().requestLayout();
    mUseShuffleOrder=mPrefs.getBoolean("String_Node_Str",false);
    mSlideShowLoop=mPrefs.getBoolean("String_Node_Str",false);
    try {
      mAnimationIndex=Integer.parseInt(mPrefs.getString("String_Node_Str","String_Node_Str"));
    }
 catch (    NumberFormatException ex) {
      Log.e(TAG,"String_Node_Str" + ex.toString());
      mAnimationIndex=0;
    }
    try {
      mSlideShowInterval=Integer.parseInt(mPrefs.getString("String_Node_Str","String_Node_Str")) * 1000;
    }
 catch (    NumberFormatException ex) {
      Log.e(TAG,"String_Node_Str" + ex.toString());
      mSlideShowInterval=3000;
    }
    if (mUseShuffleOrder) {
      generateShuffleOrder();
    }
  }
 else {
    win.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    if (mFullScreenInNormalMode) {
      win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
 else {
      win.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
    if (mGetter != null) {
      mGetter.cancelCurrent();
    }
    if (mShowActionIcons) {
      mActionIconPanel.setVisibility(View.VISIBLE);
      mShutterButton.setVisibility(View.VISIBLE);
    }
    ImageViewTouchBase dst=mImageView;
    dst.mLastXTouchPos=-1;
    dst.mLastYTouchPos=-1;
    for (    ImageViewTouchBase ivt : mSlideShowImageViews) {
      ivt.clear();
    }
    mShuffleOrder=null;
    if (mGetter != null) {
      setImage(mCurrentPosition);
    }
  }
}

Fixed version (ground truth):
void setMode(int mode){
  if (mMode == mode) {
    return;
  }
  findViewById(R.id.slideShowContainer).setVisibility(mode == MODE_SLIDESHOW ? View.VISIBLE : View.GONE);
  findViewById(R.id.abs).setVisibility(mode == MODE_NORMAL ? View.VISIBLE : View.GONE);
  Window win=getWindow();
  mMode=mode;
  if (mode == MODE_SLIDESHOW) {
    win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    mImageView.clear();
    mActionIconPanel.setVisibility(View.GONE);
    findViewById(R.id.slideShowContainer).getRootView().requestLayout();
    mUseShuffleOrder=mPrefs.getBoolean("String_Node_Str",false);
    mSlideShowLoop=mPrefs.getBoolean("String_Node_Str",false);
    try {
      mAnimationIndex=Integer.parseInt(mPrefs.getString("String_Node_Str","String_Node_Str"));
    }
 catch (    NumberFormatException ex) {
      Log.e(TAG,"String_Node_Str" + ex.toString());
      mAnimationIndex=0;
    }
    try {
      mSlideShowInterval=Integer.parseInt(mPrefs.getString("String_Node_Str","String_Node_Str")) * 1000;
    }
 catch (    NumberFormatException ex) {
      Log.e(TAG,"String_Node_Str" + ex.toString());
      mSlideShowInterval=3000;
    }
    if (mUseShuffleOrder) {
      generateShuffleOrder();
    }
  }
 else {
    win.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    if (mFullScreenInNormalMode) {
      win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
 else {
      win.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
    if (mGetter != null) {
      mGetter.cancelCurrent();
    }
    if (mShowActionIcons) {
      mActionIconPanel.setVisibility(View.VISIBLE);
    }
    ImageViewTouchBase dst=mImageView;
    dst.mLastXTouchPos=-1;
    dst.mLastYTouchPos=-1;
    for (    ImageViewTouchBase ivt : mSlideShowImageViews) {
      ivt.clear();
    }
    mShuffleOrder=null;
    if (mGetter != null) {
      setImage(mCurrentPosition);
    }
  }
}