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