Recovery of instant uploads in temporary disabled

This commit is contained in:
David A. Velasco 2013-04-04 17:15:53 +02:00
parent 053aad5ae1
commit 9b758dfa70
3 changed files with 18 additions and 5 deletions

View file

@ -801,7 +801,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
// we add only for instant-uploads the InstantUploadActivity and the
// db entry
Intent detailUploadIntent = null;
if (upload.isInstant()) {
if (upload.isInstant() && InstantUploadActivity.IS_ENABLED) {
detailUploadIntent = new Intent(this, InstantUploadActivity.class);
detailUploadIntent.putExtra(FileUploader.KEY_ACCOUNT, upload.getAccount());
} else {

View file

@ -753,9 +753,21 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
break;
}
case DIALOG_CHOOSE_UPLOAD_SOURCE: {
final String[] items = { getString(R.string.actionbar_upload_files),
getString(R.string.actionbar_upload_from_apps),
getString(R.string.actionbar_failed_instant_upload) };
String[] items = null;
String[] allTheItems = { getString(R.string.actionbar_upload_files),
getString(R.string.actionbar_upload_from_apps),
getString(R.string.actionbar_failed_instant_upload) };
String[] commonItems = { getString(R.string.actionbar_upload_files),
getString(R.string.actionbar_upload_from_apps) };
if (InstantUploadActivity.IS_ENABLED)
items = allTheItems;
else
items = commonItems;
builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.actionbar_upload);
builder.setItems(items, new DialogInterface.OnClickListener() {
@ -775,7 +787,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
action = action.setType("*/*").addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(Intent.createChooser(action, getString(R.string.upload_chooser_title)),
ACTION_SELECT_CONTENT_FROM_APPS);
} else if (item == 2) {
} else if (item == 2 && InstantUploadActivity.IS_ENABLED) {
Account account = AccountUtils.getCurrentOwnCloudAccount(FileDisplayActivity.this);
Intent action = new Intent(FileDisplayActivity.this, InstantUploadActivity.class);
action.putExtra(FileUploader.KEY_ACCOUNT, account);

View file

@ -75,6 +75,7 @@ public class InstantUploadActivity extends Activity {
private static final String LOG_TAG = InstantUploadActivity.class.getSimpleName();
private LinearLayout listView;
private static final String retry_chexbox_tag = "retry_chexbox_tag";
public static final boolean IS_ENABLED = false;
private static int MAX_LOAD_IMAGES = 5;
private int lastLoadImageIdx = 0;