Show approprate text when enrolling fingerprint

am: ae093e2428

Change-Id: I536e3bafd65461038544e6f24e35bac902d768bc
This commit is contained in:
Rubin Xu
2016-09-14 17:29:00 +00:00
committed by android-build-merger
2 changed files with 27 additions and 1 deletions

View File

@@ -746,8 +746,12 @@
<string name="security_settings_fingerprint_preference_summary_none"></string>
<!-- Introduction title shown in fingerprint enrollment to introduce the fingerprint feature[CHAR LIMIT=29] -->
<string name="security_settings_fingerprint_enroll_introduction_title">Unlock with fingerprint</string>
<!-- Introduction title shown in fingerprint enrollment to introduce the fingerprint feature, when fingerprint unlock is disabed by device admin [CHAR LIMIT=29] -->
<string name="security_settings_fingerprint_enroll_introduction_title_unlock_disabled">Use your fingerprint</string>
<!-- Introduction detail message shown in fingerprint enrollment dialog [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_enroll_introduction_message">Just touch the fingerprint sensor to unlock your phone, authorize purchases, or sign in to apps. Be careful whose fingerprints you add. Even one added print can do any of these things.\n\nNote: Your fingerprint may be less secure than a strong pattern or PIN.</string>
<!-- Introduction detail message shown in fingerprint enrollment dialog, when fingerprint unlock is disabled by device admin [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_enroll_introduction_message_unlock_disabled">Just touch the fingerprint sensor to authorize purchases, or sign in to apps. Be careful whose fingerprints you add. Even one added print can do any of these things.\n\nNote: You can\u2019t use your fingerprint to unlock this device. For more information, contact your organization\u2019s admin.</string>
<!-- Introduction detail message shown in fingerprint enrollment screen in setup wizard. [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_enroll_introduction_message_setup">Just touch the fingerprint sensor to unlock your phone, authorize purchases, or sign in to apps. Be careful whose fingerprints you add. Even one added print can do any of these things.\n\nNote: Your fingerprint may be less secure than a strong pattern or PIN.</string>
<!-- Button text to cancel enrollment from the introduction [CHAR LIMIT=22] -->

View File

@@ -26,12 +26,14 @@ import android.os.UserManager;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.android.internal.logging.MetricsProto.MetricsEvent;
import com.android.settings.ChooseLockGeneric;
import com.android.settings.ChooseLockSettingsHelper;
import com.android.settings.R;
import com.android.settingslib.HelpUtils;
import com.android.settingslib.RestrictedLockUtils;
import com.android.setupwizardlib.span.LinkSpan;
/**
@@ -48,12 +50,21 @@ public class FingerprintEnrollIntroduction extends FingerprintEnrollBase
private UserManager mUserManager;
private boolean mHasPassword;
private boolean mFingerprintUnlockDisabledByAdmin;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mFingerprintUnlockDisabledByAdmin = RestrictedLockUtils.checkIfKeyguardFeaturesDisabled(
this, DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT, mUserId) != null;
setContentView(R.layout.fingerprint_enroll_introduction);
setHeaderText(R.string.security_settings_fingerprint_enroll_introduction_title);
if (mFingerprintUnlockDisabledByAdmin) {
setHeaderText(R.string
.security_settings_fingerprint_enroll_introduction_title_unlock_disabled);
} else {
setHeaderText(R.string.security_settings_fingerprint_enroll_introduction_title);
}
final Button cancelButton = (Button) findViewById(R.id.fingerprint_cancel_button);
cancelButton.setOnClickListener(this);
@@ -160,6 +171,17 @@ public class FingerprintEnrollIntroduction extends FingerprintEnrollBase
finish();
}
@Override
protected void initViews() {
super.initViews();
TextView description = (TextView) findViewById(R.id.description_text);
if (mFingerprintUnlockDisabledByAdmin) {
description.setText(R.string
.security_settings_fingerprint_enroll_introduction_message_unlock_disabled);
}
}
@Override
public void onClick(LinkSpan span) {
if ("url".equals(span.getId())) {