Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Fix] Clear FLAG_SECURE after passcode screen #4172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/java/com/nextcloud/talk/lock/LockedActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
Expand Down
Loading