Disallow screenshot on Wi-Fi QR code settings
- Add FLAG_SECURE to WifiDppConfiguratorActivity to avoid screenshot security issue Bug: 249980936 Test: manual test make RunSettingsRoboTests ROBOTEST_FILTER=WifiDppConfiguratorActivityTest Change-Id: I5e62c2584122f79127ab505e8491565e163de296
This commit is contained in:
@@ -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;
|
||||
@@ -72,6 +76,12 @@ public class WifiDppConfiguratorActivityTest {
|
||||
Robolectric.setupActivity(WifiDppConfiguratorActivity.class);
|
||||
}
|
||||
|
||||
@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);
|
||||
|
Reference in New Issue
Block a user