From df4bf9b688b4e90ee73fcefa7b7e7c188b0655bf Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 28 Mar 2020 19:48:32 +0530 Subject: [PATCH] Disable screen capture in tunnel editor Signed-off-by: Harsh Shandilya --- .../com/wireguard/android/fragment/TunnelEditorFragment.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt index 894c0e05..99a77494 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt +++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt @@ -13,6 +13,7 @@ import android.view.MenuInflater import android.view.MenuItem import android.view.View import android.view.ViewGroup +import android.view.WindowManager import android.view.inputmethod.InputMethodManager import android.widget.Toast import com.google.android.material.snackbar.Snackbar @@ -73,10 +74,12 @@ class TunnelEditorFragment : BaseFragment(), AppExclusionListener { setUpRoot(root as ViewGroup) setUpScrollingContent(mainContainer, null) } + requireActivity().window.addFlags(WindowManager.LayoutParams.FLAG_SECURE) return binding?.root } override fun onDestroyView() { + requireActivity().window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE) binding = null super.onDestroyView() }