commit | 8b23aa2c1674227db396c3d62ef3b3d8b639a522 | [log] [tgz] |
---|---|---|
author | TreeHugger Robot <treehugger-gerrit@google.com> | Wed Nov 02 00:35:02 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Nov 02 00:35:02 2022 +0000 |
tree | bec826b4ccc8c82ce65f1d228557853565124490 | |
parent | 0c688c9e7c9eeca9233ecaef881db0720a3b0a87 [diff] | |
parent | 34471a7160240fd279e1d38b894d3de5c6b6423b [diff] |
Merge "Disallow screenshot on Wi-Fi QR code settings" into tm-qpr-dev am: d2635580fb am: 34471a7160 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20309947 Change-Id: I27396019f31117f69f9088174ed52c6ce3526556 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java index e6f0b31..6c9d498 100644 --- a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java +++ b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
@@ -28,6 +28,7 @@ import android.provider.Settings; import android.util.EventLog; import android.util.Log; +import android.view.WindowManager; import androidx.annotation.VisibleForTesting; import androidx.fragment.app.FragmentTransaction; @@ -99,6 +100,7 @@ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); if (savedInstanceState != null) { String qrCode = savedInstanceState.getString(KEY_QR_CODE);
diff --git a/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivityTest.java b/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivityTest.java index d8605de..88fa83a 100644 --- a/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivityTest.java +++ b/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivityTest.java
@@ -16,6 +16,10 @@ package com.android.settings.wifi.dpp; +import static android.view.WindowManager.LayoutParams.FLAG_SECURE; + +import static com.google.common.truth.Truth.assertThat; + import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; @@ -73,6 +77,12 @@ } @Test + public void launchActivity_shouldAddFlagSecure() { + assertThat(mActivity.getWindow().getAttributes().flags & FLAG_SECURE) + .isEqualTo(FLAG_SECURE); + } + + @Test public void handleIntent_isGuestUser_shouldFinish() { when(mUserManager.isGuestUser()).thenReturn(true);