Fix NPE issue of usage detailed page learn more button click event am: 8f0291cd1a am: b85bf67314

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

Change-Id: I210c941a06b9d905bb8b37500377ad088f1d3230
This commit is contained in:
ykhung
2021-11-02 18:25:27 +00:00
committed by Automerger Merge Worker

View File

@@ -383,12 +383,14 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements
footerString = context.getString(R.string.manager_battery_usage_footer); footerString = context.getString(R.string.manager_battery_usage_footer);
} }
mFooterPreference.setTitle(footerString); mFooterPreference.setTitle(footerString);
mFooterPreference.setLearnMoreAction(v -> final Intent helpIntent = HelpUtils.getHelpIntent(context, context.getString(
startActivityForResult(HelpUtils.getHelpIntent(context, R.string.help_url_app_usage_settings), /*backupContext=*/ "");
context.getString(R.string.help_url_app_usage_settings), if (helpIntent != null) {
/*backupContext=*/ ""), /*requestCode=*/ 0)); mFooterPreference.setLearnMoreAction(v ->
mFooterPreference.setLearnMoreContentDescription( startActivityForResult(helpIntent, /*requestCode=*/ 0));
context.getString(R.string.manager_battery_usage_link_a11y)); mFooterPreference.setLearnMoreContentDescription(
context.getString(R.string.manager_battery_usage_link_a11y));
}
} }
@Override @Override