Android 8.1 설정 에서 선 호 하 는 네트워크 유형 은 LTE 가 없습니다.
60616 단어 android
RK3399 + Android 8.1
질문:
설정 > 더 많은 > 모 바 일 네트워크 > 첫 번 째 네트워크 형식 옵션 은 3G 와 2G 만 표시 되 고 LTE 가 부족 하 며 자체 모듈 과 SIM 카드 는 LTE 를 지원 합 니 다.
관련 코드:
|-- packages/services/Telephony/res/xml/network_setting_fragment.xml
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/mobile_networks">
<PreferenceScreen
android:key="cdma_lte_data_service_key"
android:title="@string/cdma_lte_data_service">
PreferenceScreen>
<com.android.phone.MobileDataPreference
android:key="mobile_data_enable"
android:title="@string/mobile_data_settings_title"
android:summary="@string/mobile_data_settings_summary"/>
<com.android.phone.RestrictedSwitchPreference
android:key="button_roaming_key"
android:title="@string/roaming"
android:persistent="false"
android:summaryOn="@string/roaming_enable"
android:summaryOff="@string/roaming_disable"/>
<com.android.phone.DataUsagePreference
android:key="data_usage_summary"
android:title="@string/data_usage_title" />
<com.android.phone.AdvancedOptionsPreference
android:key="advanced_options"/>
<SwitchPreference
android:key="enhanced_4g_lte"
android:title="@string/enhanced_4g_lte_mode_title"
android:persistent="false"
android:summary="@string/enhanced_4g_lte_mode_summary"/>
<ListPreference
android:key="preferred_network_mode_key"
android:title="@string/preferred_network_mode_title"
android:summary="@string/preferred_network_mode_summary"
android:entries="@array/preferred_network_mode_choices"
android:entryValues="@array/preferred_network_mode_values"
android:dialogTitle="@string/preferred_network_mode_dialogtitle" />
<ListPreference
android:key="enabled_networks_key"
android:title="@string/preferred_network_mode_title"
android:summary="@string/preferred_network_mode_summary"
android:entries="@array/enabled_networks_choices"
android:entryValues="@array/enabled_networks_values"
android:dialogTitle="@string/preferred_network_mode_dialogtitle" />
<Preference
android:key="carrier_settings_euicc_key"
android:title="@string/carrier_settings_euicc" />
<PreferenceCategory
android:key="calling"
android:title="@string/call_category">
<PreferenceScreen
android:key="wifi_calling_key"
android:title="@string/wifi_calling_settings_title">
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.Settings$WifiCallingSettingsActivity">
<extra android:name="show_drawer_menu" android:value="true" />
intent>
PreferenceScreen>
<SwitchPreference
android:key="video_calling_key"
android:title="@string/video_calling_settings_title"
android:persistent="true"/>
PreferenceCategory>
PreferenceScreen>
|-- packages/services/Telephony/src/com/android/phone/MobileNetworkSettings.java
public class MobileNetworkSettings extends Activity {
public static class MobileNetworkFragment extends PreferenceFragment implements
Preference.OnPreferenceChangeListener, RoamingDialogFragment.RoamingDialogListener {
private static final String BUTTON_PREFERED_NETWORK_MODE = "preferred_network_mode_key";
@Override
public void onCreate(Bundle icicle) {
Log.i(LOG_TAG, "onCreate:+");
super.onCreate(icicle);
...
//
addPreferencesFromResource(R.xml.network_setting_fragment);
mButtonPreferredNetworkMode = (ListPreference) prefSet.findPreference(
BUTTON_PREFERED_NETWORK_MODE);
}
private void updateBodyAdvancedFields(Activity activity, PreferenceScreen prefSet,
int phoneSubId, boolean hasActiveSubscriptions) {
boolean isLteOnCdma = mPhone.getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE;
if (DBG) {
log("updateBody: isLteOnCdma=" + isLteOnCdma + " phoneSubId=" + phoneSubId);
}
prefSet.addPreference(mButtonPreferredNetworkMode);
prefSet.addPreference(mButtonEnabledNetworks);
prefSet.addPreference(mButton4glte);
if (showEuiccSettings(getActivity())) {
prefSet.addPreference(mEuiccSettingsPref);
String spn = mTelephonyManager.getSimOperatorName();
if (TextUtils.isEmpty(spn)) {
mEuiccSettingsPref.setSummary(null);
} else {
mEuiccSettingsPref.setSummary(spn);
}
}
int settingsNetworkMode = android.provider.Settings.Global.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Global.PREFERRED_NETWORK_MODE + phoneSubId,
preferredNetworkMode);
PersistableBundle carrierConfig =
PhoneGlobals.getInstance().getCarrierConfigForSubId(mPhone.getSubId());
mIsGlobalCdma = isLteOnCdma
&& carrierConfig.getBoolean(CarrierConfigManager.KEY_SHOW_CDMA_CHOICES_BOOL);
if (carrierConfig.getBoolean(
CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL)) {
prefSet.removePreference(mButtonPreferredNetworkMode);
prefSet.removePreference(mButtonEnabledNetworks);
prefSet.removePreference(mLteDataServicePref);
} else if (carrierConfig.getBoolean(CarrierConfigManager
.KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL)
&& !mPhone.getServiceState().getRoaming()
&& mPhone.getServiceState().getDataRegState()
== ServiceState.STATE_IN_SERVICE) {
prefSet.removePreference(mButtonPreferredNetworkMode);
prefSet.removePreference(mButtonEnabledNetworks);
final int phoneType = mPhone.getPhoneType();
if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
updateCdmaOptions(this, prefSet, mPhone);
} else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
updateGsmUmtsOptions(this, prefSet, phoneSubId, mNetworkQueryService);
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
}
// Since pref is being hidden from user, set network mode to default
// in case it is currently something else. That is possible if user
// changed the setting while roaming and is now back to home network.
settingsNetworkMode = preferredNetworkMode;
} else if (carrierConfig.getBoolean(
CarrierConfigManager.KEY_WORLD_PHONE_BOOL) == true) {
prefSet.removePreference(mButtonEnabledNetworks);
// set the listener for the mButtonPreferredNetworkMode list preference so we can issue
// change Preferred Network Mode.
mButtonPreferredNetworkMode.setOnPreferenceChangeListener(this);
updateCdmaOptions(this, prefSet, mPhone);
updateGsmUmtsOptions(this, prefSet, phoneSubId, mNetworkQueryService);
} else {
prefSet.removePreference(mButtonPreferredNetworkMode);
final int phoneType = mPhone.getPhoneType();
if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
int lteForced = android.provider.Settings.Global.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Global.LTE_SERVICE_FORCED + mPhone.getSubId(),
0);
if (isLteOnCdma) {
if (lteForced == 0) {
mButtonEnabledNetworks.setEntries(
R.array.enabled_networks_cdma_choices);
mButtonEnabledNetworks.setEntryValues(
R.array.enabled_networks_cdma_values);
} else {
switch (settingsNetworkMode) {
case Phone.NT_MODE_CDMA:
case Phone.NT_MODE_CDMA_NO_EVDO:
case Phone.NT_MODE_EVDO_NO_CDMA:
mButtonEnabledNetworks.setEntries(
R.array.enabled_networks_cdma_no_lte_choices);
mButtonEnabledNetworks.setEntryValues(
R.array.enabled_networks_cdma_no_lte_values);
break;
case Phone.NT_MODE_GLOBAL:
case Phone.NT_MODE_LTE_CDMA_AND_EVDO:
case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
case Phone.NT_MODE_LTE_ONLY:
mButtonEnabledNetworks.setEntries(
R.array.enabled_networks_cdma_only_lte_choices);
mButtonEnabledNetworks.setEntryValues(
R.array.enabled_networks_cdma_only_lte_values);
break;
default:
mButtonEnabledNetworks.setEntries(
R.array.enabled_networks_cdma_choices);
mButtonEnabledNetworks.setEntryValues(
R.array.enabled_networks_cdma_values);
break;
}
}
}
updateCdmaOptions(this, prefSet, mPhone);
} else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
if (isSupportTdscdma()) {
mButtonEnabledNetworks.setEntries(
R.array.enabled_networks_tdscdma_choices);
mButtonEnabledNetworks.setEntryValues(
R.array.enabled_networks_tdscdma_values);
} else if (!carrierConfig.getBoolean(CarrierConfigManager.KEY_PREFER_2G_BOOL)
&& !getResources().getBoolean(R.bool.config_enabled_lte)) {
mButtonEnabledNetworks.setEntries(
R.array.enabled_networks_except_gsm_lte_choices);
mButtonEnabledNetworks.setEntryValues(
R.array.enabled_networks_except_gsm_lte_values);
} else if (!carrierConfig.getBoolean(CarrierConfigManager.KEY_PREFER_2G_BOOL)) {
int select = (mShow4GForLTE == true) ?
R.array.enabled_networks_except_gsm_4g_choices
: R.array.enabled_networks_except_gsm_choices;
mButtonEnabledNetworks.setEntries(select);
mButtonEnabledNetworks.setEntryValues(
R.array.enabled_networks_except_gsm_values);
} else if (!getResources().getBoolean(R.bool.config_enabled_lte)) {
//
mButtonEnabledNetworks.setEntries(
R.array.enabled_networks_except_lte_choices);
mButtonEnabledNetworks.setEntryValues(
R.array.enabled_networks_except_lte_values);
} else if (mIsGlobalCdma) {
mButtonEnabledNetworks.setEntries(
R.array.enabled_networks_cdma_choices);
mButtonEnabledNetworks.setEntryValues(
R.array.enabled_networks_cdma_values);
} else {
int select = (mShow4GForLTE == true) ? R.array.enabled_networks_4g_choices
: R.array.enabled_networks_choices;
mButtonEnabledNetworks.setEntries(select);
mButtonEnabledNetworks.setEntryValues(
R.array.enabled_networks_values);
}
updateGsmUmtsOptions(this, prefSet, phoneSubId, mNetworkQueryService);
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
}
if (isWorldMode()) {
mButtonEnabledNetworks.setEntries(
R.array.preferred_network_mode_choices_world_mode);
mButtonEnabledNetworks.setEntryValues(
R.array.preferred_network_mode_values_world_mode);
}
mButtonEnabledNetworks.setOnPreferenceChangeListener(this);
if (DBG) log("settingsNetworkMode: " + settingsNetworkMode);
}
|-- packages/services/Telephony/res/values/strings.xml
<string-array name="enabled_networks_except_lte_choices" translatable="false">
<item>@string/network_3Gitem>
<item>@string/network_2Gitem>
string-array>
config_enabled_lt 의 값 은: | -- packages / services / Telephony / res / values / config. xml 입 니 다.
<bool name="config_enabled_lte" translatable="false">falsebool>
기 존 코드 (이하 RK 3288 Android 7.1) 에서 이 값 은 true: | -- device / rockchip / common / overlay / packages / services / Telephony / res / values / config. xml 입 니 다.
<bool name="config_enabled_lte" translatable="false">truebool>
따라서 configenabled_lt 의 값 을 true 로 바 꾸 면 LTE 를 표시 할 수 있 습 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Kotlin의 기초 - 2부지난 글에서는 Kotlin이 무엇인지, Kotlin의 특징, Kotlin에서 변수 및 데이터 유형을 선언하는 방법과 같은 Kotlin의 기본 개념에 대해 배웠습니다. 유형 변환은 데이터 변수의 한 유형을 다른 데이터...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.