Prompt user to Setup a device lock if not set
This add below changes on selecting private space setting: 1. Prompt user to setup device lock if not already set 2. If device lock is set authenticate user first before displaying private space settings page Screenshot - https://screenshot.googleplex.com/4SrYHbBMJfVuoRy.png https://screenshot.googleplex.com/6vNWm7Lg83vfnH8.png RecordingLink - https://drive.google.com/file/d/1r4zb3ILPRqwvP5tlwfjQ9GgnDAW4vZg6/view?usp=drive_link Bug: 289016927 Test: atest PrivateSpaceSettingsAuthenticatorTest , atest SecuritySettingsTest Change-Id: I0e5dfb30213843c0dec60a17d01c30cd91db89b0
This commit is contained in:
@@ -18,8 +18,11 @@ package com.android.settings.privatespace;
|
||||
|
||||
|
||||
import static android.safetycenter.SafetyEvent.SAFETY_EVENT_TYPE_DEVICE_REBOOTED;
|
||||
|
||||
import static com.android.settings.privatespace.PrivateSpaceSafetySource.SAFETY_SOURCE_ID;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.never;
|
||||
@@ -122,9 +125,9 @@ public class PrivateSpaceSafetySourceTest {
|
||||
assertThat(safetySourceStatus.isEnabled()).isTrue();
|
||||
}
|
||||
|
||||
/** Tests that setSafetySourceData sets the PS settings page intent. */
|
||||
/** Tests that setSafetySourceData sets the PS settings page authenticator intent. */
|
||||
@Test
|
||||
public void setSafetySourceData_setsPsIntent() {
|
||||
public void setSafetySourceData_setsPsAuthenticatorIntent() {
|
||||
when(mSafetyCenterManagerWrapper.isEnabled(mContext)).thenReturn(true);
|
||||
mSetFlagsRule.enableFlags(Flags.FLAG_ALLOW_PRIVATE_PROFILE);
|
||||
|
||||
@@ -135,7 +138,7 @@ public class PrivateSpaceSafetySourceTest {
|
||||
any(), eq(SAFETY_SOURCE_ID), captor.capture(), eq(EVENT_TYPE_DEVICE_REBOOTED));
|
||||
SafetySourceData safetySourceData = captor.getValue();
|
||||
SafetySourceStatus safetySourceStatus = safetySourceData.getStatus();
|
||||
assertThat(safetySourceStatus.getPendingIntent().getIntent().getIdentifier())
|
||||
.isEqualTo(SAFETY_SOURCE_ID);
|
||||
assertThat(safetySourceStatus.getPendingIntent().getIntent()
|
||||
.equals(PrivateSpaceAuthenticationActivity.class));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user