9820E是Android.4.4平台。
ssda_mode的配置是位于工程配置目录下:
device/sprd/sharkle/sp9820e_2h10_ft02/sp9820e_2h10_base.mk
persist.radio.ssda.mode=fdd-csfb
关于CSFB的解释CSFB、LTE_CSFB、FDD_CSFB等概念简介
该属性影响了手机的网络模式。
在TelephonyManager.java中有如下定义:
public static enum RadioCapbility { NONE, TDD_SVLTE, FDD_CSFB, TDD_CSFB, CSFB };
获取属性
private static String PROP_SSDA_MODE = "persist.radio.ssda.mode"; // ssda mode private static String MODE_SVLTE = "svlte"; private static String MODE_TDD_CSFB = "tdd-csfb"; private static String MODE_FDD_CSFB = "fdd-csfb"; private static String MODE_CSFB = "csfb"; public static RadioCapbility getRadioCapbility() { String ssdaMode = SystemProperties.get(PROP_SSDA_MODE); Log.d(TAG, "getRadioCapbility: ssdaMode=" + ssdaMode); if (ssdaMode.equals(MODE_SVLTE)) { return RadioCapbility.TDD_SVLTE; } else if (ssdaMode.equals(MODE_TDD_CSFB)) { return RadioCapbility.TDD_CSFB; } else if (ssdaMode.equals(MODE_FDD_CSFB)) { return RadioCapbility.FDD_CSFB; }else if (ssdaMode.equals(MODE_CSFB)) { return RadioCapbility.CSFB; } return RadioCapbility.NONE; }
手机设置中的首先网络模式也跟它有关:
代码packages/services/Telephony/src/com/android/phone/NetworkTypeOptions.java
if (TelephonyManager.getRadioCapbility() == RadioCapbility.CSFB) { mButtonEnabledNetworks.setEntries(R.array.lte_preferred_networks_choices_for_common); mButtonEnabledNetworks.setEntryValues(R.array.lte_network_mode_choices_values_for_common); } else if (TelephonyManager.getRadioCapbility() == RadioCapbility.FDD_CSFB) { mButtonEnabledNetworks.setEntries(R.array.lte_preferred_networks_for_common); mButtonEnabledNetworks.setEntryValues(R.array.lte_network_mode_choices_values_for_3mode); } else { mButtonEnabledNetworks.setEntries(R.array.lte_preferred_networks_choices_for_3mode); mButtonEnabledNetworks.setEntryValues(R.array.lte_network_mode_choices_values_for_3mode); }
其中对应的字符串和值,举例说明我当前项目配置为FDD_CSFB,则
lte_preferred_networks_for_common
位于:
packages/services/Telephony/res/values-zh-rCN/strings_ex.xml
<string-array name="lte_preferred_networks_for_common"> <item>4G/3G/2G多模式</item> <item>仅3G/2G模式</item> <item>仅2G模式</item> </string-array>
对应的值:
<string-array name="lte_network_mode_choices_values_for_3mode" translatable="false"> <item>"0"</item> <item>"1"</item> <item>"4"</item> </string-array>
所以在修改网络模式时要设置对应的value值:
if ((networkMode != -1) && (SimManager.isValidPhoneId(phoneId))) { RadioTaskManager.getDefault().setPreferredNetworkModeForPhone(phoneId, networkMode); }