mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-11-04 04:17:50 +00:00 
			
		
		
		
	Compare commits
	
		
			No commits in common. "8a8a931e66249d2382a4bfca3ccdb79e9a14718e" and "00948ffd73f950e443eb0214206e8a1c9e16e957" have entirely different histories.
		
	
	
		
			8a8a931e66
			...
			00948ffd73
		
	
		
@ -31,6 +31,7 @@ import android.net.Uri;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.owncloud.android.lib.common.accounts.AccountUtils;
 | 
					import com.owncloud.android.lib.common.accounts.AccountUtils;
 | 
				
			||||||
import com.owncloud.android.lib.common.authentication.OwnCloudCredentials;
 | 
					import com.owncloud.android.lib.common.authentication.OwnCloudCredentials;
 | 
				
			||||||
 | 
					import com.owncloud.android.lib.common.http.HttpClient;
 | 
				
			||||||
import timber.log.Timber;
 | 
					import timber.log.Timber;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.io.IOException;
 | 
					import java.io.IOException;
 | 
				
			||||||
@ -123,24 +124,6 @@ public class SingleSessionManager {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            Timber.v("reusing client for account %s", accountName);
 | 
					            Timber.v("reusing client for account %s", accountName);
 | 
				
			||||||
            if (client.getAccount() != null &&
 | 
					 | 
				
			||||||
                    client.getAccount().getCredentials() != null &&
 | 
					 | 
				
			||||||
                    (client.getAccount().getCredentials().getAuthToken() == null || client.getAccount().getCredentials().getAuthToken().isEmpty())
 | 
					 | 
				
			||||||
            ) {
 | 
					 | 
				
			||||||
                Timber.i("Client " + client.getAccount().getName() + " needs to refresh credentials");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                //the next two lines are a hack because okHttpclient is used as a singleton instead of being an
 | 
					 | 
				
			||||||
                //injected instance that can be deleted when required
 | 
					 | 
				
			||||||
                client.clearCookies();
 | 
					 | 
				
			||||||
                client.clearCredentials();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                client.setAccount(account);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                account.loadCredentials(context);
 | 
					 | 
				
			||||||
                client.setCredentials(account.getCredentials());
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                Timber.i("Client " + account.getName() + " with credentials size" + client.getAccount().getCredentials().getAuthToken().length());
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            reusingKnown = true;
 | 
					            reusingKnown = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user