X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/d95d2ac85680c0dcb8a2d863d809c40b64a5808d..e901b609baa4dd5f681e2a5257c9e504997e3377:/src/com/owncloud/android/ui/activity/FileActivity.java diff --git a/src/com/owncloud/android/ui/activity/FileActivity.java b/src/com/owncloud/android/ui/activity/FileActivity.java index 1b42ff06..136bdb55 100644 --- a/src/com/owncloud/android/ui/activity/FileActivity.java +++ b/src/com/owncloud/android/ui/activity/FileActivity.java @@ -18,8 +18,6 @@ package com.owncloud.android.ui.activity; -import java.io.IOException; - import android.accounts.Account; import android.accounts.AccountManager; import android.accounts.AccountManagerCallback; @@ -50,11 +48,11 @@ import com.owncloud.android.files.services.FileDownloader; import com.owncloud.android.files.services.FileUploader; import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder; import com.owncloud.android.files.services.FileUploader.FileUploaderBinder; -import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException; import com.owncloud.android.lib.common.operations.OnRemoteOperationListener; import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; +import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.operations.CreateShareOperation; import com.owncloud.android.operations.UnshareLinkOperation; @@ -62,7 +60,6 @@ import com.owncloud.android.services.OperationsService; import com.owncloud.android.services.OperationsService.OperationsServiceBinder; import com.owncloud.android.ui.dialog.LoadingDialog; import com.owncloud.android.utils.ErrorMessageAdapter; -import com.owncloud.android.utils.Log_OC; /** @@ -83,6 +80,8 @@ implements OnRemoteOperationListener, ComponentsGetter { private static final String DIALOG_WAIT_TAG = "DIALOG_WAIT"; private static final String KEY_WAITING_FOR_OP_ID = "WAITING_FOR_OP_ID";; + protected static final long DELAY_TO_REQUEST_OPERATION_ON_ACTIVITY_RESULTS = 200; + /** OwnCloud {@link Account} where the main {@link OCFile} handled by the activity is located. */ private Account mAccount; @@ -198,24 +197,6 @@ implements OnRemoteOperationListener, ComponentsGetter { @Override protected void onPause() { - // Save cookies here - Log_OC.wtf(TAG, "Saving Cookies" ); - if (mAccount != null) { - try { - ((MainApp)getApplicationContext()).getOwnCloudClientManager(). - saveClient(mAccount, this); - - // TODO get rid of the exceptions - } catch (AccountNotFoundException e) { - e.printStackTrace(); - } catch (AuthenticatorException e) { - e.printStackTrace(); - } catch (OperationCanceledException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } if (mOperationsServiceBinder != null) { mOperationsServiceBinder.removeOperationListener(this); @@ -527,11 +508,12 @@ implements OnRemoteOperationListener, ComponentsGetter { } - private void updateFileFromDB(){ - OCFile file = getStorageManager().getFileByPath(getFile().getRemotePath()); - if (file != null) { - setFile(file); - } + protected void updateFileFromDB(){ + OCFile file = getFile(); + if (file != null) { + file = getStorageManager().getFileByPath(file.getRemotePath()); + setFile(file); + } } /**