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 ...@@ -7,6 +7,7 @@ import android.content.Context
import android.content.IntentFilter import android.content.IntentFilter
import android.content.pm.ActivityInfo import android.content.pm.ActivityInfo
import android.os.Bundle import android.os.Bundle
import android.view.WindowManager
import androidx.lifecycle.Lifecycle import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent import androidx.lifecycle.OnLifecycleEvent
...@@ -94,13 +95,15 @@ class CoronaWarnApplication : Application(), LifecycleObserver, ...@@ -94,13 +95,15 @@ class CoronaWarnApplication : Application(), LifecycleObserver,
@SuppressLint("SourceLockedOrientationActivity") @SuppressLint("SourceLockedOrientationActivity")
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) { override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
// prevents screenshot of the app for all activities // prevents screenshot of the app for all activities,
// TODO temporarily removed screenshot prevention for testing purposes // except for deviceForTesters build flavor, which is used for testing
/* if (BuildConfig.FLAVOR != "deviceForTesters") {
activity.window.setFlags( activity.window.setFlags(
WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE WindowManager.LayoutParams.FLAG_SECURE
)*/ )
}
// set screen orientation to portrait // set screen orientation to portrait
activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
} }
......
...@@ -60,7 +60,6 @@ class SettingsResetFragment : Fragment() { ...@@ -60,7 +60,6 @@ class SettingsResetFragment : Fragment() {
} }
} }
// TODO verify that all local data is deleted
private fun deleteAllAppContent() { private fun deleteAllAppContent() {
lifecycleScope.launch { lifecycleScope.launch {
try { 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