Merge "Fix null pointer issue of accesibility learn more button click event" into sc-v2-dev am: e8582f9c31

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15678258

Change-Id: Ifc595fa8d33e5244b96d28ef17615e1955b20551
This commit is contained in:
Menghan Li
2021-09-01 06:28:24 +00:00
committed by Automerger Merge Worker
2 changed files with 14 additions and 8 deletions

View File

@@ -104,11 +104,17 @@ public class AccessibilityFooterPreferenceController extends BasePreferenceContr
sb.append(getIntroductionTitle()).append("\n\n").append(footerPreference.getTitle());
footerPreference.setContentDescription(sb);
final Intent helpIntent;
if (getHelpResource() != 0) {
// Returns may be null if content is wrong or empty.
helpIntent = HelpUtils.getHelpIntent(mContext, mContext.getString(getHelpResource()),
mContext.getClass().getName());
} else {
helpIntent = null;
}
if (helpIntent != null) {
footerPreference.setLearnMoreAction(view -> {
final Intent helpIntent = HelpUtils.getHelpIntent(
mContext, mContext.getString(getHelpResource()),
mContext.getClass().getName());
view.startActivityForResult(helpIntent, 0);
});
footerPreference.setLearnMoreContentDescription(getLearnMoreContentDescription());