Merge "Remove subtext on the password work challenge screen" into udc-qpr-dev am: 04854b1c65

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23782668

Change-Id: I7ba3169002b1d7f7c010ca078d7a723b86788dbf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Oli Thompson
2023-08-01 17:17:00 +00:00
committed by Automerger Merge Worker
2 changed files with 17 additions and 33 deletions

View File

@@ -18,12 +18,8 @@ package com.android.settings.password;
import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_WORK_PROFILE_PASSWORD_HEADER; import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_WORK_PROFILE_PASSWORD_HEADER;
import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_WORK_PROFILE_PIN_HEADER; import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_WORK_PROFILE_PIN_HEADER;
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_CONFIRM_PASSWORD;
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_CONFIRM_PIN;
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_LAST_PASSWORD_ATTEMPT_BEFORE_WIPE; import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_LAST_PASSWORD_ATTEMPT_BEFORE_WIPE;
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_LAST_PIN_ATTEMPT_BEFORE_WIPE; import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_LAST_PIN_ATTEMPT_BEFORE_WIPE;
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PASSWORD_REQUIRED;
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PIN_REQUIRED;
import static android.app.admin.DevicePolicyResources.UNDEFINED; import static android.app.admin.DevicePolicyResources.UNDEFINED;
import static com.android.settings.biometrics.GatekeeperPasswordProvider.containsGatekeeperPasswordHandle; import static com.android.settings.biometrics.GatekeeperPasswordProvider.containsGatekeeperPasswordHandle;
@@ -75,27 +71,12 @@ import java.util.ArrayList;
public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity { public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
// The index of the array is isStrongAuth << 2 + isManagedProfile << 1 + isAlpha. // The index of the array is isStrongAuth << 1 + isAlpha.
private static final int[] DETAIL_TEXTS = new int[] { private static final int[] DETAIL_TEXTS = new int[] {
R.string.lockpassword_confirm_your_pin_generic, R.string.lockpassword_confirm_your_pin_generic,
R.string.lockpassword_confirm_your_password_generic, R.string.lockpassword_confirm_your_password_generic,
R.string.lockpassword_confirm_your_pin_generic_profile,
R.string.lockpassword_confirm_your_password_generic_profile,
R.string.lockpassword_strong_auth_required_device_pin, R.string.lockpassword_strong_auth_required_device_pin,
R.string.lockpassword_strong_auth_required_device_password, R.string.lockpassword_strong_auth_required_device_password,
R.string.lockpassword_strong_auth_required_work_pin,
R.string.lockpassword_strong_auth_required_work_password
};
private static final String[] DETAIL_TEXT_OVERRIDES = new String[] {
UNDEFINED,
UNDEFINED,
WORK_PROFILE_CONFIRM_PIN,
WORK_PROFILE_CONFIRM_PASSWORD,
UNDEFINED,
UNDEFINED,
WORK_PROFILE_PIN_REQUIRED,
WORK_PROFILE_PASSWORD_REQUIRED
}; };
public static class InternalActivity extends ConfirmLockPassword { public static class InternalActivity extends ConfirmLockPassword {
@@ -200,7 +181,12 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
detailsMessage = getDefaultDetails(); detailsMessage = getDefaultDetails();
} }
mGlifLayout.setHeaderText(headerMessage); mGlifLayout.setHeaderText(headerMessage);
mGlifLayout.setDescriptionText(detailsMessage);
if (mIsManagedProfile) {
mGlifLayout.getDescriptionTextView().setVisibility(View.GONE);
} else {
mGlifLayout.setDescriptionText(detailsMessage);
}
mCheckBoxLabel = intent.getCharSequenceExtra(KeyguardManager.EXTRA_CHECKBOX_LABEL); mCheckBoxLabel = intent.getCharSequenceExtra(KeyguardManager.EXTRA_CHECKBOX_LABEL);
} }
int currentType = mPasswordEntry.getInputType(); int currentType = mPasswordEntry.getInputType();
@@ -323,11 +309,9 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
: R.string.lockpassword_remote_validation_pin_details); : R.string.lockpassword_remote_validation_pin_details);
} }
boolean isStrongAuthRequired = isStrongAuthRequired(); boolean isStrongAuthRequired = isStrongAuthRequired();
// Map boolean flags to an index by isStrongAuth << 2 + isManagedProfile << 1 + isAlpha. // Map boolean flags to an index by isStrongAuth << 1 + isAlpha.
int index = ((isStrongAuthRequired ? 1 : 0) << 2) + ((mIsManagedProfile ? 1 : 0) << 1) int index = ((isStrongAuthRequired ? 1 : 0) << 1) + (mIsAlpha ? 1 : 0);
+ (mIsAlpha ? 1 : 0); return getString(DETAIL_TEXTS[index]);
return mDevicePolicyManager.getResources().getString(
DETAIL_TEXT_OVERRIDES[index], () -> getString(DETAIL_TEXTS[index]));
} }
private String getDefaultCheckboxLabel() { private String getDefaultCheckboxLabel() {

View File

@@ -316,12 +316,9 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
R.string.lockpassword_remote_validation_pattern_details); R.string.lockpassword_remote_validation_pattern_details);
} }
final boolean isStrongAuthRequired = isStrongAuthRequired(); final boolean isStrongAuthRequired = isStrongAuthRequired();
if (!mIsManagedProfile) { return isStrongAuthRequired
return isStrongAuthRequired ? getString(R.string.lockpassword_strong_auth_required_device_pattern)
? getString(R.string.lockpassword_strong_auth_required_device_pattern) : getString(R.string.lockpassword_confirm_your_pattern_generic);
: getString(R.string.lockpassword_confirm_your_pattern_generic);
}
return null;
} }
private Object[][] getActiveViews() { private Object[][] getActiveViews() {
@@ -371,7 +368,10 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
CharSequence detailsText = CharSequence detailsText =
mDetailsText == null ? getDefaultDetails() : mDetailsText; mDetailsText == null ? getDefaultDetails() : mDetailsText;
if (detailsText != null) {
if (mIsManagedProfile) {
mGlifLayout.getDescriptionTextView().setVisibility(View.GONE);
} else {
mGlifLayout.setDescriptionText(detailsText); mGlifLayout.setDescriptionText(detailsText);
} }