1
0
Fork 0

For #11153:Add FLAG_SECURE on pause and clear on resume for private session.

master
mcarare 2020-06-03 08:32:43 +03:00 committed by Emily Kager
parent 7013e8198b
commit 138c12696f
1 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import android.content.Intent
import android.os.Bundle
import android.util.AttributeSet
import android.view.View
import android.view.WindowManager
import androidx.annotation.CallSuper
import androidx.annotation.IdRes
import androidx.annotation.VisibleForTesting
@ -166,6 +167,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
@CallSuper
override fun onResume() {
checkAndUpdateScreenshotPermission(settings())
super.onResume()
components.backgroundServices.accountManagerAvailableQueue.runIfReadyOrQueue {
@ -181,6 +183,11 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
}
final override fun onPause() {
if (settings().lastKnownMode.isPrivate) {
window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
} else {
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
}
super.onPause()
// Every time the application goes into the background, it is possible that the user