From 094752f5a1257d77fc9454dad63f87dbe0dbc5be Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Fri, 2 Sep 2016 16:34:38 -0700 Subject: [Fingerprint] Remove learn more link if not provisioned. DO NOT MERGE Remove the learn more link during setup wizard, because HelpUtils is returning null for the intent while the device is not provisioned. Bug: 31246856 Change-Id: I4cf5c282f170188aef98a02d3b96af5e63ea7f39 (cherry picked from commit c94f2b93afa2db9d87f9d8e0dc0c8709f16a326d) --- .../settings/fingerprint/FingerprintEnrollIntroduction.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollIntroduction.java b/src/com/android/settings/fingerprint/FingerprintEnrollIntroduction.java index beb1a8f..bc2757a 100644 --- a/src/com/android/settings/fingerprint/FingerprintEnrollIntroduction.java +++ b/src/com/android/settings/fingerprint/FingerprintEnrollIntroduction.java @@ -20,6 +20,7 @@ import android.app.admin.DevicePolicyManager; import android.content.Intent; import android.os.Bundle; import android.os.UserHandle; +import android.provider.Settings.Global; import android.view.View; import com.android.internal.logging.MetricsLogger; @@ -40,7 +41,11 @@ public class FingerprintEnrollIntroduction extends FingerprintEnrollBase { setContentView(R.layout.fingerprint_enroll_introduction); setHeaderText(R.string.security_settings_fingerprint_enroll_introduction_title); findViewById(R.id.cancel_button).setOnClickListener(this); - findViewById(R.id.learn_more_button).setOnClickListener(this); + final View learnMoreButton = findViewById(R.id.learn_more_button); + learnMoreButton.setOnClickListener(this); + if (Global.getInt(getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { + learnMoreButton.setVisibility(View.GONE); + } final int passwordQuality = new ChooseLockSettingsHelper(this).utils() .getActivePasswordQuality(UserHandle.myUserId()); mHasPassword = passwordQuality != DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED; @@ -91,7 +96,9 @@ public class FingerprintEnrollIntroduction extends FingerprintEnrollBase { private void launchFingerprintHelp() { Intent helpIntent = HelpUtils.getHelpIntent(this, getString(R.string.help_url_fingerprint), getClass().getName()); - startActivity(helpIntent); + if (helpIntent != null) { + startActivity(helpIntent); + } } @Override -- cgit v1.1