Update titles & messages for password enrolment flows

Show different titles and description messages when
enrolling password under various conditions:
* personal lock verus work lock
* adding a new lock versus updating existing lock
* enrolling a PIN verus password versus pattern

Add icons to options in screen lock picker.

Add an option to redirect to work lock flow if the admin
has set device-wide password requirement.

Bug: 183922696
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.password
Change-Id: I40417b113814659d3226a44eb7f9d553386e3c58
This commit is contained in:
Rubin Xu
2021-03-25 10:34:28 +00:00
parent cdd73e7fec
commit 1ac05237ab
17 changed files with 283 additions and 99 deletions

View File

@@ -18,6 +18,8 @@ package com.android.settings.password;
import static android.app.admin.DevicePolicyManager.PASSWORD_COMPLEXITY_NONE;
import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_NONE;
import android.app.admin.DevicePolicyManager.PasswordComplexity;
import android.app.admin.PasswordMetrics;
import android.content.Context;
@@ -88,7 +90,7 @@ public class ChooseLockGenericController {
}
/**
* Returns the highest quality among the specified {@code quality}, the password requiremnet
* Returns the highest quality among the specified {@code quality}, the password requirement
* set by device admins (legacy password quality metrics and password complexity), and the
* min password complexity requested by the calling app.
*/
@@ -207,4 +209,9 @@ public class ChooseLockGenericController {
mLockPatternUtils.getRequestedPasswordComplexity(
mUserId, mDevicePasswordRequirementOnly));
}
public boolean isScreenLockRestrictedByAdmin() {
return getAggregatedPasswordMetrics().credType != CREDENTIAL_TYPE_NONE
|| getAggregatedPasswordComplexity() != PASSWORD_COMPLEXITY_NONE;
}
}