For #11153:Add FLAG_SECURE on pause and clear on resume for private session.
parent
7013e8198b
commit
138c12696f
|
@ -9,6 +9,7 @@ import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.WindowManager
|
||||||
import androidx.annotation.CallSuper
|
import androidx.annotation.CallSuper
|
||||||
import androidx.annotation.IdRes
|
import androidx.annotation.IdRes
|
||||||
import androidx.annotation.VisibleForTesting
|
import androidx.annotation.VisibleForTesting
|
||||||
|
@ -166,6 +167,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
|
||||||
|
|
||||||
@CallSuper
|
@CallSuper
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
checkAndUpdateScreenshotPermission(settings())
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
components.backgroundServices.accountManagerAvailableQueue.runIfReadyOrQueue {
|
components.backgroundServices.accountManagerAvailableQueue.runIfReadyOrQueue {
|
||||||
|
@ -181,6 +183,11 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
final override fun onPause() {
|
final override fun onPause() {
|
||||||
|
if (settings().lastKnownMode.isPrivate) {
|
||||||
|
window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
|
||||||
|
} else {
|
||||||
|
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
|
||||||
|
}
|
||||||
super.onPause()
|
super.onPause()
|
||||||
|
|
||||||
// Every time the application goes into the background, it is possible that the user
|
// Every time the application goes into the background, it is possible that the user
|
||||||
|
|
Loading…
Reference in New Issue