Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
conditional screenshot prevention (#391)
Browse files Browse the repository at this point in the history
Co-authored-by: Jakob Möller <jakob.moeller@sap.com>
  • Loading branch information
htooisap and jakobmoellerdev authored Jun 11, 2020
1 parent 200a3ca commit b1ea123
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class SettingsResetFragment : Fragment() {
}
}

// TODO verify that all local data is deleted
private fun deleteAllAppContent() {
lifecycleScope.launch {
try {
Expand Down

0 comments on commit b1ea123

Please sign in to comment.