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
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user