Merge "Fix fail to search by input "4G Calling""

This commit is contained in:
Stanley Wang
2019-08-07 02:37:30 +00:00
committed by Android (Google) Code Review
5 changed files with 17 additions and 4 deletions

View File

@@ -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>

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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;
}