X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/75880ec5531ebefd9c57748f03d11831c233b308..24d67823860c34bccb1bd0ba6c127ba1bb5c6fd1:/src/com/owncloud/android/MainApp.java diff --git a/src/com/owncloud/android/MainApp.java b/src/com/owncloud/android/MainApp.java index f7b4720e..2d819f49 100644 --- a/src/com/owncloud/android/MainApp.java +++ b/src/com/owncloud/android/MainApp.java @@ -1,5 +1,9 @@ -/* ownCloud Android client application - * Copyright (C) 2012-2015 ownCloud Inc. +/** + * ownCloud Android client application + * + * @author masensio + * @author David A. Velasco + * Copyright (C) 2015 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -28,23 +32,31 @@ import com.owncloud.android.lib.common.utils.Log_OC; * * Contains methods to build the "static" strings. These strings were before constants in different * classes - * - * @author masensio - * @author David A. Velasco */ 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(); - - // 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 new ThumbnailsCacheManager.InitDiskCacheTask().execute();