OSDN Git Service

Fix Settings crashes after tapping "Learn more" in fingerprint page
authorliming.wang <liming.wang@sonymobile.com>
Thu, 27 Oct 2016 02:00:34 +0000 (10:00 +0800)
committerYoshinori Hirano <Yoshinori.Hirano@sonymobile.com>
Wed, 23 Aug 2017 03:32:40 +0000 (03:32 +0000)
It is possible in certain build configurations to have an invalid
link. Instead of crashing, swallow the error and write to logs.

Fixes: 64322876
Test: manual - go to Settings > Security & Location > Fingerprint
               and then tap "Learn more"

Change-Id: I70beca880261df0ee3eef94f5469f44130ffd95a

src/com/android/settings/fingerprint/FingerprintSettings.java

index fb59c59..64ce901 100644 (file)
@@ -829,7 +829,7 @@ public class FingerprintSettings extends SubSettings {
     };
 
     private static class LearnMoreSpan extends URLSpan {
-
+        private static final String TAG = "LearnMoreSpan";
         private static final Typeface TYPEFACE_MEDIUM =
                 Typeface.create("sans-serif-medium", Typeface.NORMAL);
 
@@ -854,6 +854,10 @@ public class FingerprintSettings extends SubSettings {
                 RestrictedLockUtils.sendShowAdminSupportDetailsIntent(ctx, mEnforcedAdmin);
             } else {
                 Intent intent = HelpUtils.getHelpIntent(ctx, getURL(), ctx.getClass().getName());
+                if (intent == null) {
+                    Log.w(LearnMoreSpan.TAG, "Null help intent.");
+                    return;
+                }
                 try {
                     widget.startActivityForResult(intent, 0);
                 } catch (ActivityNotFoundException e) {