Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47bd62bd authored by Tsung-Mao Fang's avatar Tsung-Mao Fang
Browse files

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
parent 4abbe803
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -695,9 +695,8 @@
        emergency responders when you call or text an emergency number.
    </string>
    <!-- Location settings footer link to support page [CHAR LIMIT=NONE] -->
    <string name="location_settings_footer_learn_more">
        &lt;a href="<xliff:g example="http://www.google.com"
        id="url"> https://support.google.com/android/answer/3467281</xliff:g>">Learn more&lt;/a>
    <string name="location_settings_footer_learn_more_link" translatable="false">
        https://support.google.com/android/answer/3467281
    </string>
    <!-- Location settings footer link content description [CHAR LIMIT=NONE] -->
    <string name="location_settings_footer_learn_more_content_description">
+0 −1
Original line number Diff line number Diff line
@@ -71,7 +71,6 @@
    <com.android.settingslib.widget.FooterPreference
        android:title="@string/location_settings_footer_general"
        android:key="location_footer"
        android:selectable="false"
        settings:searchable="false"
        settings:controller="com.android.settings.location.LocationSettingsFooterPreferenceController"/>
</PreferenceScreen>
+14 −6
Original line number Diff line number Diff line
@@ -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,13 +105,20 @@ 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);
    }

    /**