diff --git a/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt b/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt index 05af8af94b..dbf469e346 100644 --- a/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt +++ b/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt @@ -233,9 +233,7 @@ abstract class VectorBaseActivity : AppCompatActivity(), Maver } // Set flag FLAG_SECURE - // Tchap: handle differently screenshot authorization not relying on Preferences flag SETTINGS_SECURITY_USE_FLAG_SECURE - // if (vectorPreferences.useFlagSecure()) { - if (!vectorPreferences.tchapAllowedScreenshot()) { + if (vectorPreferences.useFlagSecure()) { window.addFlags(WindowManager.LayoutParams.FLAG_SECURE) } diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt index c648038759..ef3e791d91 100755 --- a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt @@ -993,27 +993,8 @@ class VectorPreferences @Inject constructor( * The user does not allow screenshots of the application. */ fun useFlagSecure(): Boolean { - return defaultPrefs.getBoolean(SETTINGS_SECURITY_USE_FLAG_SECURE, true) - } - - // Tchap - /** - * Screenshot is not allowed for Tchap F-droid version. - * It is allowed for Tchap GPlay version only for DEV and Pre-Prod versions. - * It is not allowed for Tchap GPlay Tchap (Production) version. - */ - fun tchapAllowedScreenshot(): Boolean { - return when (BuildConfig.FLAVOR_store.lowercase()) { - "fdroid" -> false - "gplay" -> { - when (BuildConfig.FLAVOR_target.lowercase()) { - "devtchap" -> true - "btchap" -> true - else -> false - } - } - else -> false - } + // Tchap: Screenshot is allowed for Gplay Pre-prod and Dev versions only. + return BuildConfig.FLAVOR_store != "gplay" || BuildConfig.FLAVOR_target == "tchap" } /** Whether the keyboard should disable personalized learning. */