From c039eb89bc018b9d97e568ee8ca6d2488afa61bc Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 30 Jun 2023 10:05:32 +0930 Subject: [PATCH 1/3] 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 0a7a15f70e..6119719930 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 0000000000..207edfc843 --- /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 1f05e4f135..807c40b43b 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 369e27339a..f493249a83 100644 --- a/libsession/src/main/res/values/values.xml +++ b/libsession/src/main/res/values/values.xml @@ -2,4 +2,5 @@ true false + true From ba4143c2985bc3e1cf497baedc7aa0e5ab688c6a Mon Sep 17 00:00:00 2001 From: Stefan Junker <1181362+steveej@users.noreply.github.com> Date: Mon, 3 Jul 2023 03:43:02 +0200 Subject: [PATCH 2/3] feat: increase voice recording limit to 5m (#1201) --- .../securesms/conversation/v2/ConversationActivityV2.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt index 7844ca4c22..92cf5ec639 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt @@ -1584,7 +1584,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe showVoiceMessageUI() window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) audioRecorder.startRecording() - stopAudioHandler.postDelayed(stopVoiceMessageRecordingTask, 60000) // Limit voice messages to 1 minute each + stopAudioHandler.postDelayed(stopVoiceMessageRecordingTask, 300000) // Limit voice messages to 5 minute each } else { Permissions.with(this) .request(Manifest.permission.RECORD_AUDIO) From 7da3e4f0221aa07fc418a6c8e1aebd59c55fc7a3 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 4 Jul 2023 11:39:49 +0930 Subject: [PATCH 3/3] Fix blocked contacts button (#1264) --- .../preferences/BlockedContactsLayout.kt | 9 ------- .../preferences/BlockedContactsPreference.kt | 4 +-- .../layout/blocked_contacts_preference.xml | 27 +++++++++---------- 3 files changed, 13 insertions(+), 27 deletions(-) delete mode 100644 app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsLayout.kt diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsLayout.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsLayout.kt deleted file mode 100644 index ed2970fbc4..0000000000 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsLayout.kt +++ /dev/null @@ -1,9 +0,0 @@ -package org.thoughtcrime.securesms.preferences - -import android.content.Context -import android.util.AttributeSet -import android.widget.FrameLayout - -class BlockedContactsLayout @JvmOverloads constructor( - context: Context, attrs: AttributeSet? = null -) : FrameLayout(context, attrs) \ No newline at end of file diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsPreference.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsPreference.kt index e985ba6d4f..48c7cc6dc8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsPreference.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsPreference.kt @@ -3,7 +3,6 @@ package org.thoughtcrime.securesms.preferences import android.content.Context import android.content.Intent import android.util.AttributeSet -import android.view.View import androidx.preference.PreferenceCategory import androidx.preference.PreferenceViewHolder @@ -16,8 +15,7 @@ class BlockedContactsPreference @JvmOverloads constructor( super.onBindViewHolder(holder) holder.itemView.setOnClickListener { - val intent = Intent(context, BlockedContactsActivity::class.java) - context.startActivity(intent) + Intent(context, BlockedContactsActivity::class.java).let(context::startActivity) } } } diff --git a/app/src/main/res/layout/blocked_contacts_preference.xml b/app/src/main/res/layout/blocked_contacts_preference.xml index 83fe432cf9..673d5316a1 100644 --- a/app/src/main/res/layout/blocked_contacts_preference.xml +++ b/app/src/main/res/layout/blocked_contacts_preference.xml @@ -1,18 +1,15 @@ - -