public void saveHistory() { if (isJobFlash()) { String counter = "", history = ""; if (isJobKernel()) { counter = PREF_KEY_FLASH_KERNEL_COUNTER; history = Rashr.PREF_KEY_KERNEL_HISTORY; } else if (isJobRecovery()) { counter = PREF_KEY_FLASH_RECOVERY_COUNTER; history = Rashr.PREF_KEY_RECOVERY_HISTORY; } switch (Common.getIntegerPref(mContext, Rashr.PREF_NAME, counter)) { case 0: Common.setStringPref( mContext, Rashr.PREF_NAME, history + String.valueOf(Common.getIntegerPref(mContext, Rashr.PREF_NAME, counter)), CustomIMG.getAbsolutePath()); Common.setIntegerPref(mContext, Rashr.PREF_NAME, counter, 1); return; default: Common.setStringPref( mContext, Rashr.PREF_NAME, history + String.valueOf(Common.getIntegerPref(mContext, Rashr.PREF_NAME, counter)), CustomIMG.getAbsolutePath()); Common.setIntegerPref( mContext, Rashr.PREF_NAME, counter, Common.getIntegerPref(mContext, Rashr.PREF_NAME, counter) + 1); if (Common.getIntegerPref(mContext, Rashr.PREF_NAME, counter) == 5) { Common.setIntegerPref(mContext, Rashr.PREF_NAME, counter, 0); } } } }