From c039eb89bc018b9d97e568ee8ca6d2488afa61bc Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 30 Jun 2023 10:05:32 +0930 Subject: [PATCH] Fix debug screen security default (#1256) --- app/src/main/res/xml/preferences_app_protection.xml | 2 +- libsession/src/debug/res/values/values.xml | 4 ++++ .../org/session/libsession/utilities/TextSecurePreferences.kt | 2 +- libsession/src/main/res/values/values.xml | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 libsession/src/debug/res/values/values.xml diff --git a/app/src/main/res/xml/preferences_app_protection.xml b/app/src/main/res/xml/preferences_app_protection.xml index 0a7a15f70..611971993 100644 --- a/app/src/main/res/xml/preferences_app_protection.xml +++ b/app/src/main/res/xml/preferences_app_protection.xml @@ -14,7 +14,7 @@ diff --git a/libsession/src/debug/res/values/values.xml b/libsession/src/debug/res/values/values.xml new file mode 100644 index 000000000..207edfc84 --- /dev/null +++ b/libsession/src/debug/res/values/values.xml @@ -0,0 +1,4 @@ + + + false + diff --git a/libsession/src/main/java/org/session/libsession/utilities/TextSecurePreferences.kt b/libsession/src/main/java/org/session/libsession/utilities/TextSecurePreferences.kt index 1f05e4f13..807c40b43 100644 --- a/libsession/src/main/java/org/session/libsession/utilities/TextSecurePreferences.kt +++ b/libsession/src/main/java/org/session/libsession/utilities/TextSecurePreferences.kt @@ -649,7 +649,7 @@ interface TextSecurePreferences { @JvmStatic fun isScreenSecurityEnabled(context: Context): Boolean { - return getBooleanPreference(context, SCREEN_SECURITY_PREF, !BuildConfig.DEBUG) + return getBooleanPreference(context, SCREEN_SECURITY_PREF, context.resources.getBoolean(R.bool.screen_security_default)) } fun getLastVersionCode(context: Context): Int { diff --git a/libsession/src/main/res/values/values.xml b/libsession/src/main/res/values/values.xml index 369e27339..f493249a8 100644 --- a/libsession/src/main/res/values/values.xml +++ b/libsession/src/main/res/values/values.xml @@ -2,4 +2,5 @@ true false + true