From d5b18914396648ed2023553feeb4cdef3cf8fad0 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Tue, 5 Nov 2024 15:18:08 +0100 Subject: [PATCH] fix conditions for multi account Signed-off-by: alperozturk --- .../android/authentication/AuthenticatorActivity.java | 4 ++-- .../owncloud/android/authentication/DeepLinkLoginActivity.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java b/app/src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java index 0930e8d12e..10f63668bc 100644 --- a/app/src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/app/src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java @@ -810,7 +810,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity Uri data = intent.getData(); if (data != null && data.toString().startsWith(getString(R.string.login_data_own_scheme))) { - if (!MDMConfig.INSTANCE.multiAccountSupport(this) || + if (!MDMConfig.INSTANCE.multiAccountSupport(this) && accountManager.getAccounts().length == 1) { Toast.makeText(this, R.string.no_mutliple_accounts_allowed, Toast.LENGTH_LONG).show(); finish(); @@ -1531,7 +1531,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity return; } - if (!MDMConfig.INSTANCE.multiAccountSupport(this) || + if (!MDMConfig.INSTANCE.multiAccountSupport(this) && accountManager.getAccounts().length == 1) { Toast.makeText(this, R.string.no_mutliple_accounts_allowed, Toast.LENGTH_LONG).show(); } else { diff --git a/app/src/main/java/com/owncloud/android/authentication/DeepLinkLoginActivity.kt b/app/src/main/java/com/owncloud/android/authentication/DeepLinkLoginActivity.kt index c355cdcbc9..971fde8fc0 100644 --- a/app/src/main/java/com/owncloud/android/authentication/DeepLinkLoginActivity.kt +++ b/app/src/main/java/com/owncloud/android/authentication/DeepLinkLoginActivity.kt @@ -18,7 +18,7 @@ class DeepLinkLoginActivity : AuthenticatorActivity(), Injectable { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - if (!MDMConfig.multiAccountSupport(this) || accountManager.accounts.size == 1) { + if (!MDMConfig.multiAccountSupport(this) && accountManager.accounts.size == 1) { Toast.makeText(this, R.string.no_mutliple_accounts_allowed, Toast.LENGTH_LONG).show() return }