Fix Settings crashes after tapping "Learn more" in fingerprint page

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
This commit is contained in:
liming.wang
2016-10-27 10:00:34 +08:00
committed by Yoshinori Hirano
parent 54eeafa052
commit 0db5a99608

View 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) {