From 47bd62bdab2d2a36f3df17417ae2f66e1c9014b9 Mon Sep 17 00:00:00 2001 From: Tsung-Mao Fang Date: Tue, 1 Jun 2021 14:58:21 +0800 Subject: [PATCH] Fix voice access problem on location page. - Remove the seletcable attribute on footer preference so that voice access can identify learn more. - Apply latest footer preference API to set an action on learn more. - Remove unuse string resource. Test: Verify that talkback and voice access work well. Fix: 189652942 Change-Id: I45fcd21d6a2d693d8b5eaa446aaccb769f1c0c7f --- res/values/strings.xml | 5 ++--- res/xml/location_settings.xml | 1 - ...ionSettingsFooterPreferenceController.java | 20 +++++++++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index c6ea2d273ba..fcb97e02cf6 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -695,9 +695,8 @@ emergency responders when you call or text an emergency number. - - <a href=" https://support.google.com/android/answer/3467281">Learn more</a> + + https://support.google.com/android/answer/3467281 diff --git a/res/xml/location_settings.xml b/res/xml/location_settings.xml index cffab3ee06b..fe87efd73d7 100644 --- a/res/xml/location_settings.xml +++ b/res/xml/location_settings.xml @@ -71,7 +71,6 @@ diff --git a/src/com/android/settings/location/LocationSettingsFooterPreferenceController.java b/src/com/android/settings/location/LocationSettingsFooterPreferenceController.java index 281cc5abf9d..a3b68be7da2 100644 --- a/src/com/android/settings/location/LocationSettingsFooterPreferenceController.java +++ b/src/com/android/settings/location/LocationSettingsFooterPreferenceController.java @@ -31,6 +31,7 @@ import androidx.preference.Preference; import androidx.preference.PreferenceScreen; import com.android.settings.R; +import com.android.settingslib.HelpUtils; import com.android.settingslib.widget.FooterPreference; import java.util.ArrayList; @@ -104,15 +105,22 @@ public class LocationSettingsFooterPreferenceController extends LocationBasePref + footerString; } if (mFooterPreference != null) { - mFooterPreference.setTitle(Html.fromHtml(footerString - + PARAGRAPH_SEPARATOR - + mContext.getString( - R.string.location_settings_footer_learn_more))); - mFooterPreference.setContentDescription(Html.fromHtml(footerString + mContext.getString( - R.string.location_settings_footer_learn_more_content_description))); + mFooterPreference.setTitle(Html.fromHtml(footerString)); + mFooterPreference.setLearnMoreAction(v -> openLocationLearnMoreLink()); + mFooterPreference.setLearnMoreContentDescription(mContext.getString( + R.string.location_settings_footer_learn_more_content_description)); } } + private void openLocationLearnMoreLink() { + mFragment.startActivityForResult( + HelpUtils.getHelpIntent( + mContext, + mContext.getString(R.string.location_settings_footer_learn_more_link), + /*backupContext=*/""), + /*requestCode=*/ 0); + } + /** * Location footer preference group should always be displayed. */