Merge "Show generic ChooseLockPattern title for suw." into main

This commit is contained in:
Hao Dong
2024-01-19 19:08:50 +00:00
committed by Android (Google) Code Review
3 changed files with 19 additions and 2 deletions

View File

@@ -469,9 +469,9 @@ public class ChooseLockPattern extends SettingsActivity {
private void updateActivityTitle() { private void updateActivityTitle() {
final String msg; final String msg;
if (mForFingerprint) { if (mForFingerprint && !shouldShowGenericTitle()) {
msg = getString(R.string.lockpassword_choose_your_pattern_header_for_fingerprint); msg = getString(R.string.lockpassword_choose_your_pattern_header_for_fingerprint);
} else if (mForFace) { } else if (mForFace && !shouldShowGenericTitle()) {
msg = getString(R.string.lockpassword_choose_your_pattern_header_for_face); msg = getString(R.string.lockpassword_choose_your_pattern_header_for_face);
} else if (mIsManagedProfile) { } else if (mIsManagedProfile) {
msg = getContext().getSystemService(DevicePolicyManager.class).getResources() msg = getContext().getSystemService(DevicePolicyManager.class).getResources()
@@ -486,6 +486,10 @@ public class ChooseLockPattern extends SettingsActivity {
getActivity().setTitle(msg); getActivity().setTitle(msg);
} }
protected boolean shouldShowGenericTitle() {
return false;
}
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,

View File

@@ -160,6 +160,11 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
} }
} }
@Override
protected boolean shouldShowGenericTitle() {
return true;
}
@Override @Override
protected Intent getRedactionInterstitialIntent(Context context) { protected Intent getRedactionInterstitialIntent(Context context) {
// Setup wizard's redaction interstitial is deferred to optional step. Enable that // Setup wizard's redaction interstitial is deferred to optional step. Enable that

View File

@@ -220,6 +220,14 @@ public class SetupChooseLockPatternTest {
application.getString(R.string.lockpassword_choose_your_pattern_description)); application.getString(R.string.lockpassword_choose_your_pattern_description));
} }
@Test
public void createActivity_patternTitle_shouldShowGenericText() {
final CharSequence headerView = mActivity.getTitle();
assertThat(headerView).isEqualTo(
application.getString(R.string.lockpassword_choose_your_pattern_header));
}
@Test @Test
public void inIntroductionStage_theHeaderHeight_shouldSetMinLinesTwoToPreventFlicker() { public void inIntroductionStage_theHeaderHeight_shouldSetMinLinesTwoToPreventFlicker() {
final PartnerCustomizationLayout layout = mActivity.findViewById(R.id.setup_wizard_layout); final PartnerCustomizationLayout layout = mActivity.findViewById(R.id.setup_wizard_layout);