Skip to content
Snippets Groups Projects
Unverified Commit b1ea123c authored by Hee Tatt Ooi's avatar Hee Tatt Ooi Committed by GitHub
Browse files

conditional screenshot prevention (#391)

parent 200a3ca2
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ import android.content.Context
import android.content.IntentFilter
import android.content.pm.ActivityInfo
import android.os.Bundle
import android.view.WindowManager
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
......@@ -94,13 +95,15 @@ class CoronaWarnApplication : Application(), LifecycleObserver,
@SuppressLint("SourceLockedOrientationActivity")
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
// prevents screenshot of the app for all activities
// TODO temporarily removed screenshot prevention for testing purposes
/*
activity.window.setFlags(
WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE
)*/
// prevents screenshot of the app for all activities,
// except for deviceForTesters build flavor, which is used for testing
if (BuildConfig.FLAVOR != "deviceForTesters") {
activity.window.setFlags(
WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE
)
}
// set screen orientation to portrait
activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
}
......
......@@ -60,7 +60,6 @@ class SettingsResetFragment : Fragment() {
}
}
// TODO verify that all local data is deleted
private fun deleteAllAppContent() {
lifecycleScope.launch {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment