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

Commit 7b489d57 authored by Stanley Wang's avatar Stanley Wang
Browse files

Fix fail to search by input "4G Calling"

Fixed step:
1.Update resource xml file in SearchIndexProvider.
2.Add keywords for preference title array.
3.Initizlize data member.
When getAvailabilityStatus called by updateNonIndexableKeys,
the data member should be initialized,
otherwise it always returns CONDITIONALLY_UNAVAILABLE

Fixes: 137155154
Test: manual
Change-Id: Id06d78bffdeba247741dcfe81e9ed7e179141397
parent 31ef4055
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7437,6 +7437,9 @@
    <!-- Battery Saver: Search terms for battery saver schedule preference. Feel free to add additional terms when translating if appropriate [CHAR_LIMIT=NONE] -->
    <string name="keywords_battery_saver_schedule">routine, schedule, battery saver, power saver, battery, automatic, percent</string>
    <!-- List of synonyms for the enhance 4G LTE titles, used to match in settings search [CHAR LIMIT=NONE] -->
    <string name="keywords_enhance_4g_lte">volte, advanced calling, 4g calling</string>
    <!-- Option title for the default sound, context based on screen -->
    <string name="default_sound">Default sound</string>
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@
        android:title="@string/enhanced_4g_lte_mode_title"
        android:persistent="false"
        android:summary="@string/enhanced_4g_lte_mode_summary"
        settings:keywords="@string/keywords_enhance_4g_lte"
        settings:controller="com.android.settings.network.telephony.Enhanced4gLtePreferenceController"/>

    <ListPreference
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

    <com.android.settingslib.widget.LayoutPreference
        android:key="use_sim_switch"
        android:title="@string/summary_placeholder"
        android:layout="@layout/styled_switch_bar"
        settings:controller="com.android.settings.network.telephony.MobileNetworkSwitchController"/>

@@ -96,6 +97,7 @@
            android:title="@string/enhanced_4g_lte_mode_title"
            android:persistent="false"
            android:summary="@string/enhanced_4g_lte_mode_summary"
            settings:keywords="@string/keywords_enhance_4g_lte"
            settings:controller="com.android.settings.network.telephony.Enhanced4gLtePreferenceController"/>

        <ListPreference
+6 −2
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ public class Enhanced4gLtePreferenceController extends TelephonyTogglePreference

    @Override
    public int getAvailabilityStatus(int subId) {
        init(subId);
        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
        final boolean isVisible = subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
                && mImsManager != null && carrierConfig != null
@@ -135,6 +136,9 @@ public class Enhanced4gLtePreferenceController extends TelephonyTogglePreference
    }

    public Enhanced4gLtePreferenceController init(int subId) {
        if (mSubId == subId) {
            return this;
        }
        mSubId = subId;
        mTelephonyManager = TelephonyManager.from(mContext).createForSubscriptionId(mSubId);
        mCarrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
+5 −2
Original line number Diff line number Diff line
@@ -275,7 +275,10 @@ public class MobileNetworkSettings extends RestrictedDashboardFragment {
                    final ArrayList<SearchIndexableResource> result = new ArrayList<>();

                    final SearchIndexableResource sir = new SearchIndexableResource(context);
                    sir.xmlResId = R.xml.mobile_network_settings;
                    sir.xmlResId = FeatureFlagPersistent.isEnabled(context,
                            FeatureFlags.NETWORK_INTERNET_V2)
                            ? R.xml.mobile_network_settings_v2
                            : R.xml.mobile_network_settings;
                    result.add(sir);
                    return result;
                }