Merge pull request #2829 from nextcloud/capabilitiesTooOften

Capabilities are queried too often
This commit is contained in:
Andy Scherzinger 2018-07-24 07:51:02 +02:00 committed by GitHub
commit 7416082e4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,12 +30,8 @@ import android.support.annotation.Nullable;
import com.owncloud.android.MainApp;
import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.operations.GetCapabilitiesOperarion;
import com.owncloud.android.ui.activity.ManageAccountsActivity;
@ -163,18 +159,6 @@ public class AccountUtils {
if (found) {
SharedPreferences.Editor appPrefs = PreferenceManager.getDefaultSharedPreferences(context).edit();
appPrefs.putString(PREF_SELECT_OC_ACCOUNT, accountName);
// update credentials
Thread t = new Thread(() -> {
FileDataStorageManager storageManager = new FileDataStorageManager(account,
context.getContentResolver());
GetCapabilitiesOperarion getCapabilities = new GetCapabilitiesOperarion();
RemoteOperationResult updateResult = getCapabilities.execute(storageManager, context);
Log_OC.w(TAG, "Update Capabilities: " + updateResult.isSuccess());
});
t.start();
appPrefs.apply();
result = true;
break;