Source:
protected String doInBackground(LocalIndexInfo... params) { int count = 0; int total = 0; for (LocalIndexInfo info : params) { if (!isCancelled()) { boolean successfull = false; if (operation == DELETE_OPERATION) { File f = new File(info.getPathToData()); successfull = Algorithms.removeAllFiles(f); if (InAppHelper.isSubscribedToLiveUpdates()) { String fileNameWithoutExtension = Algorithms.getFileNameWithoutExtension(f); IncrementalChangesManager changesManager = getMyApplication().getResourceManager().getChangesManager(); changesManager.deleteUpdates(fileNameWithoutExtension); } if (successfull) { getMyApplication().getResourceManager().closeFile(info.getFileName()); } } else if (operation == RESTORE_OPERATION) { successfull = move(new File(info.getPathToData()), getFileToRestore(info)); if (successfull) { info.setBackupedData(false); } } else if (operation == BACKUP_OPERATION) { successfull = move(new File(info.getPathToData()), getFileToBackup(info)); if (successfull) { info.setBackupedData(true); getMyApplication().getResourceManager().closeFile(info.getFileName()); } } else if (operation == CLEAR_TILES_OPERATION) { ITileSource src = (ITileSource) info.getAttachedObject(); if(src != null) { src.deleteTiles(info.getPathToData()); } } total++; if (successfull) { count++; publishProgress(info); } } } if (operation == DELETE_OPERATION) { a.getDownloadThread().updateLoadedFiles(); } if (operation == DELETE_OPERATION) { return a.getString(R.string.local_index_items_deleted, count, total); } else if (operation == BACKUP_OPERATION) { return a.getString(R.string.local_index_items_backuped, count, total); } else if (operation == RESTORE_OPERATION) { return a.getString(R.string.local_index_items_restored, count, total); } return ""; }

Target:
protected String doInBackground(LocalIndexInfo... params) { int count = 0; int total = 0; for (LocalIndexInfo info : params) { if (!isCancelled()) { boolean successfull = false; if (operation == DELETE_OPERATION) { File f = new File(info.getPathToData()); successfull = Algorithms.removeAllFiles(f); if (getMyApplication().getSettings().LIVE_UPDATES_PURCHASED.get()) { String fileNameWithoutExtension = Algorithms.getFileNameWithoutExtension(f); IncrementalChangesManager changesManager = getMyApplication().getResourceManager().getChangesManager(); changesManager.deleteUpdates(fileNameWithoutExtension); } if (successfull) { getMyApplication().getResourceManager().closeFile(info.getFileName()); } } else if (operation == RESTORE_OPERATION) { successfull = move(new File(info.getPathToData()), getFileToRestore(info)); if (successfull) { info.setBackupedData(false); } } else if (operation == BACKUP_OPERATION) { successfull = move(new File(info.getPathToData()), getFileToBackup(info)); if (successfull) { info.setBackupedData(true); getMyApplication().getResourceManager().closeFile(info.getFileName()); } } else if (operation == CLEAR_TILES_OPERATION) { ITileSource src = (ITileSource) info.getAttachedObject(); if(src != null) { src.deleteTiles(info.getPathToData()); } } total++; if (successfull) { count++; publishProgress(info); } } } if (operation == DELETE_OPERATION) { a.getDownloadThread().updateLoadedFiles(); } if (operation == DELETE_OPERATION) { return a.getString(R.string.local_index_items_deleted, count, total); } else if (operation == BACKUP_OPERATION) { return a.getString(R.string.local_index_items_backuped, count, total); } else if (operation == RESTORE_OPERATION) { return a.getString(R.string.local_index_items_restored, count, total); } return ""; }