diff --git a/app/src/main/java/com/nextcloud/talk/activities/BaseActivity.kt b/app/src/main/java/com/nextcloud/talk/activities/BaseActivity.kt index 1f8d2916a..23b7c7d29 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/BaseActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/activities/BaseActivity.kt @@ -101,7 +101,7 @@ open class BaseActivity : AppCompatActivity() { disableKeyboardPersonalisedLearning(viewGroup) } - if (appPreferences.isScreenSecured || appPreferences.isScreenLocked) { + if (appPreferences.isScreenSecured) { window.addFlags(WindowManager.LayoutParams.FLAG_SECURE) } else { window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE) diff --git a/app/src/main/java/com/nextcloud/talk/lock/LockedActivity.kt b/app/src/main/java/com/nextcloud/talk/lock/LockedActivity.kt index 5906bbd37..829ddbcb5 100644 --- a/app/src/main/java/com/nextcloud/talk/lock/LockedActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/lock/LockedActivity.kt @@ -14,6 +14,7 @@ import android.content.Context import android.os.Bundle import android.util.Log import android.view.View +import android.view.WindowManager import androidx.activity.result.ActivityResult import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AppCompatActivity @@ -49,6 +50,9 @@ class LockedActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + + window.addFlags(WindowManager.LayoutParams.FLAG_SECURE) + NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this) binding = ActivityLockedBinding.inflate(layoutInflater) @@ -144,6 +148,11 @@ class LockedActivity : AppCompatActivity() { } } + override fun onDestroy() { + super.onDestroy() + window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE) + } + companion object { private val TAG = LockedActivity::class.java.simpleName }