mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-11-04 04:17:50 +00:00 
			
		
		
		
	Fix credentials in switch accounts
This commit is contained in:
		
							parent
							
								
									782361267d
								
							
						
					
					
						commit
						f3eb0c4431
					
				@ -117,6 +117,10 @@ public class OwnCloudClient extends HttpClient {
 | 
				
			|||||||
        mCredentials.applyTo(this);
 | 
					        mCredentials.applyTo(this);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void applyCredentials() {
 | 
				
			||||||
 | 
					        mCredentials.applyTo(this);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public int executeHttpMethod (HttpBaseMethod method) throws Exception {
 | 
					    public int executeHttpMethod (HttpBaseMethod method) throws Exception {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        boolean repeatWithFreshCredentials;
 | 
					        boolean repeatWithFreshCredentials;
 | 
				
			||||||
 | 
				
			|||||||
@ -145,7 +145,7 @@ public abstract class RemoteOperation<T extends Object> implements Runnable {
 | 
				
			|||||||
                OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, mContext);
 | 
					                OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, mContext);
 | 
				
			||||||
                mClient = OwnCloudClientManagerFactory.getDefaultSingleton().
 | 
					                mClient = OwnCloudClientManagerFactory.getDefaultSingleton().
 | 
				
			||||||
                        getClientFor(ocAccount, mContext);
 | 
					                        getClientFor(ocAccount, mContext);
 | 
				
			||||||
 | 
					                mClient.applyCredentials();
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                throw new IllegalStateException("Trying to run a remote operation " +
 | 
					                throw new IllegalStateException("Trying to run a remote operation " +
 | 
				
			||||||
                        "asynchronously with no client and no chance to create one (no account)");
 | 
					                        "asynchronously with no client and no chance to create one (no account)");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user