Program: 184655
Project: 184655
Buggy source:
@Override public void onResume(){
  super.onResume();
  BitmapManager.instance().allowAllDecoding();
  mGvs.setSizeChoice(Integer.parseInt(mPrefs.getString("String_Node_Str","String_Node_Str")),mTargetScroll);
  mGvs.requestFocus();
  String sortOrder=mPrefs.getString("String_Node_Str",null);
  if (sortOrder != null) {
    mSortAscending=sortOrder.equals("String_Node_Str");
  }
  mPausing=false;
  IntentFilter intentFilter=new IntentFilter(Intent.ACTION_MEDIA_MOUNTED);
  intentFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
  intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
  intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
  intentFilter.addAction(Intent.ACTION_MEDIA_EJECT);
  intentFilter.addDataScheme("String_Node_Str");
  mReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      String action=intent.getAction();
      if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {
      }
 else       if (action.equals(Intent.ACTION_MEDIA_UNMOUNTED)) {
        Toast.makeText(ImageGallery.this,getResources().getString(R.string.wait),5000);
        rebake(true,false);
      }
 else       if (action.equals(Intent.ACTION_MEDIA_SCANNER_STARTED)) {
        Toast.makeText(ImageGallery.this,getResources().getString(R.string.wait),5000);
        rebake(false,true);
      }
 else       if (action.equals(Intent.ACTION_MEDIA_SCANNER_FINISHED)) {
        rebake(false,false);
      }
 else       if (action.equals(Intent.ACTION_MEDIA_EJECT)) {
        rebake(true,false);
      }
    }
  }
;
  registerReceiver(mReceiver,intentFilter);
  rebake(false,ImageManager.isMediaScannerScanning(getContentResolver()));
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  BitmapManager.instance().allowAllDecoding();
  mGvs.setSizeChoice(Integer.parseInt(mPrefs.getString("String_Node_Str","String_Node_Str")));
  mGvs.requestFocus();
  String sortOrder=mPrefs.getString("String_Node_Str",null);
  if (sortOrder != null) {
    mSortAscending=sortOrder.equals("String_Node_Str");
  }
  mPausing=false;
  IntentFilter intentFilter=new IntentFilter(Intent.ACTION_MEDIA_MOUNTED);
  intentFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
  intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
  intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
  intentFilter.addAction(Intent.ACTION_MEDIA_EJECT);
  intentFilter.addDataScheme("String_Node_Str");
  mReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      String action=intent.getAction();
      if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {
      }
 else       if (action.equals(Intent.ACTION_MEDIA_UNMOUNTED)) {
        Toast.makeText(ImageGallery.this,getResources().getString(R.string.wait),5000);
        rebake(true,false);
      }
 else       if (action.equals(Intent.ACTION_MEDIA_SCANNER_STARTED)) {
        Toast.makeText(ImageGallery.this,getResources().getString(R.string.wait),5000);
        rebake(false,true);
      }
 else       if (action.equals(Intent.ACTION_MEDIA_SCANNER_FINISHED)) {
        rebake(false,false);
      }
 else       if (action.equals(Intent.ACTION_MEDIA_EJECT)) {
        rebake(true,false);
      }
    }
  }
;
  registerReceiver(mReceiver,intentFilter);
  rebake(false,ImageManager.isMediaScannerScanning(getContentResolver()));
}