diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java index f448e45b..a12f4796 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java @@ -32,6 +32,7 @@ import android.content.Context; import android.net.Uri; import com.owncloud.android.lib.common.accounts.AccountUtils; +import com.owncloud.android.lib.common.authentication.OwnCloudCredentials; import com.owncloud.android.lib.common.http.HttpClient; import timber.log.Timber; @@ -191,6 +192,15 @@ public class SingleSessionManager { } } + public void refreshCredentialsForAccount(String accountName, OwnCloudCredentials credentials) { + OwnCloudClient ownCloudClient = mClientsWithKnownUsername.get(accountName); + if (ownCloudClient == null) { + return; + } + ownCloudClient.setCredentials(credentials); + mClientsWithKnownUsername.replace(accountName, ownCloudClient); + } + // this method is just a patch; we need to distinguish accounts in the same host but // different paths; but that requires updating the accountNames for apps upgrading private void keepUriUpdated(OwnCloudAccount account, OwnCloudClient reusedClient) {