Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 130a6477 authored by Milton Wu's avatar Milton Wu
Browse files

Fix Learn more link not work

Old span text shall not be used in preference footer. Change
implementation to use footer learnMore APIs

Bug: 228101275
Test: Make sure "Learn more" can be clicked on Fingerprint setting page
Change-Id: Ied2326b1a75fc02e7a3fe2321735f2f9f5ac066f
parent a82a1ff8
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1044,8 +1044,12 @@
    <!-- Acquire message received during fingerprint enrollment to inform the user they've reached the maximum number of enrollments. [CHAR LIMIT=NONE]-->
    <string name="security_settings_fingerprint_v2_enroll_error_max_attempts">You\u2019ve reached the maximum number of attempts</string>
    <!-- Message shown in fingerprint security settings home screen. [CHAR LIMIT=NONE]-->
    <string name="security_settings_fingerprint_v2_home_screen">Use your fingerprint to unlock your phone or verify it\u2019s you, like when you sign in to apps\n\n<annotation id="url">Learn more</annotation></string>
    <!-- Message text only shown in fingerprint security settings home screen. (tablet) [CHAR LIMIT=NONE]-->
    <string name="security_settings_fingerprint_v2_home_screen_text" product="tablet">Use your fingerprint to unlock your tablet or verify it\u2019s you, like when you sign in to apps</string>
    <!-- Message text only shown in fingerprint security settings home screen. (device) [CHAR LIMIT=NONE]-->
    <string name="security_settings_fingerprint_v2_home_screen_text" product="device">Use your fingerprint to unlock your device or verify it\u2019s you, like when you sign in to apps</string>
    <!-- Message text only shown in fingerprint security settings home screen. (phone) [CHAR LIMIT=NONE]-->
    <string name="security_settings_fingerprint_v2_home_screen_text" product="default">Use your fingerprint to unlock your phone or verify it\u2019s you, like when you sign in to apps</string>
    <!-- Biometric settings --><skip />
    <!-- Title shown for menu item that launches biometric settings. [CHAR LIMIT=66] -->
+9 −5
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ public class FingerprintSettings extends SubSettings {
        private Drawable mHighlightDrawable;
        private int mUserId;
        private CharSequence mFooterTitle;
        private View.OnClickListener mLearnMoreListener = null;
        private boolean mEnrollClicked;

        private long mChallenge;
@@ -372,9 +373,8 @@ public class FingerprintSettings extends SubSettings {

                mFooterTitle = AnnotationSpan.linkify(footerText, linkInfo, adminLinkInfo);
            } else {
                mFooterTitle = AnnotationSpan.linkify(
                        getText(R.string.security_settings_fingerprint_v2_home_screen),
                        linkInfo, adminLinkInfo);
                mFooterTitle = getText(R.string.security_settings_fingerprint_v2_home_screen_text);
                mLearnMoreListener = (v) -> activity.startActivityForResult(helpIntent, 0);
            }


@@ -474,8 +474,12 @@ public class FingerprintSettings extends SubSettings {
            if (context == null) {
                return;
            }
            root.addPreference(new FooterPreference.Builder(context).setTitle(
                    mFooterTitle).build());
            final FooterPreference footer = new FooterPreference.Builder(context)
                    .setTitle(mFooterTitle).build();
            if (mLearnMoreListener != null) {
                footer.setLearnMoreAction(mLearnMoreListener);
            }
            root.addPreference(footer);
        }

        private static String genKey(int id) {