Add skip lock screen in Notification & security lock screen settings
Users may have trouble finding this setting in face auth. Heard this from dogfood/executive feedback and customer support discussion. So add Skip Lock Screen preference in Display > Lock screen display > What to show > and App & Notifications > Notifications > Lock Screen > Bug: 138458558 Test: robotest & manual Change-Id: I10e420821423821743d65b00c8b7e6d4d1224e00
This commit is contained in:
@@ -18,10 +18,12 @@ package com.android.settings.biometrics.face;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.face.FaceManager;
|
||||
import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.preference.SwitchPreference;
|
||||
@@ -41,6 +43,8 @@ public class FaceSettingsLockscreenBypassPreferenceControllerTest {
|
||||
@Mock
|
||||
private FaceManager mFaceManager;
|
||||
private SwitchPreference mPreference;
|
||||
@Mock
|
||||
private UserManager mUserManager;
|
||||
|
||||
private Context mContext;
|
||||
private FaceSettingsLockscreenBypassPreferenceController mController;
|
||||
@@ -51,8 +55,9 @@ public class FaceSettingsLockscreenBypassPreferenceControllerTest {
|
||||
mContext = RuntimeEnvironment.application;
|
||||
mPreference = new SwitchPreference(mContext);
|
||||
|
||||
mController = new FaceSettingsLockscreenBypassPreferenceController(mContext);
|
||||
mController = new FaceSettingsLockscreenBypassPreferenceController(mContext, "test_key");
|
||||
ReflectionHelpers.setField(mController, "mFaceManager", mFaceManager);
|
||||
ReflectionHelpers.setField(mController, "mUserManager", mUserManager);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -62,6 +67,13 @@ public class FaceSettingsLockscreenBypassPreferenceControllerTest {
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isAvailable_isManagedProfile_shouldReturnUnsupported() {
|
||||
when(mUserManager.isManagedProfile(anyInt())).thenReturn(true);
|
||||
|
||||
assertThat(mController.isAvailable()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onPreferenceChange_settingIsUpdated() {
|
||||
boolean defaultValue = mContext.getResources().getBoolean(
|
||||
|
Reference in New Issue
Block a user