Enable session support for all authentication methods in the app

This commit is contained in:
David A. Velasco 2015-02-03 13:04:19 +01:00
parent 1ee808f3a2
commit 02372fde24

View file

@ -36,26 +36,15 @@ public class MainApp extends Application {
private static final String AUTH_ON = "on";
@SuppressWarnings("unused")
private static final String POLICY_SINGLE_SESSION_PER_ACCOUNT = "single session per account";
@SuppressWarnings("unused")
private static final String POLICY_ALWAYS_NEW_CLIENT = "always new client";
private static Context mContext;
public void onCreate(){
super.onCreate();
MainApp.mContext = getApplicationContext();
boolean isSamlAuth = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));
if (isSamlAuth) {
// keep a single session per account handling session cookie in requests (& all the other cookies)
OwnCloudClientManagerFactory.setDefaultPolicy(Policy.SINGLE_SESSION_PER_ACCOUNT);
} else {
OwnCloudClientManagerFactory.setDefaultPolicy(Policy.ALWAYS_NEW_CLIENT);
}
// initialise thumbnails cache on background thread
new ThumbnailsCacheManager.InitDiskCacheTask().execute();