如何通过修改build.prop文件来修改Android 首选网络模式默认值
答案:1 悬赏:20 手机版
解决时间 2021-03-27 10:32
- 提问者网友:放下
- 2021-03-27 06:48
如何通过修改build.prop文件来修改Android 首选网络模式默认值
最佳答案
- 五星知识达人网友:风格不统一
- 2021-03-27 07:27
修改系统属性:ro.telephony.default_network修改说明:可连续给两个值(如4,1),卡1用的是4,卡2用的是1。数字代表的意义见下方的相关代码片段。相关源码位置:frameworks/base/telephony/java/com/android/internal/telephony/RILConstants.javaframeworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java相关代码片段:int NETWORK_MODE_WCDMA_PREF = 0; int NETWORK_MODE_GSM_ONLY = 1; int NETWORK_MODE_WCDMA_ONLY = 2; int NETWORK_MODE_GSM_UMTS = 3; int NETWORK_MODE_CDMA = 4; int NETWORK_MODE_CDMA_NO_EVDO = 5; int NETWORK_MODE_EVDO_NO_CDMA = 6; int NETWORK_MODE_GLOBAL = 7; int NETWORK_MODE_LTE_CDMA_EVDO = 8; int NETWORK_MODE_LTE_GSM_WCDMA = 9; int NETWORK_MODE_LTE_CMDA_EVDO_GSM_WCDMA = 10; int NETWORK_MODE_LTE_ONLY = 11; int NETWORK_MODE_LTE_WCDMA = 12; int NETWORK_MODE_TD_SCDMA_ONLY = 13; int NETWORK_MODE_TD_SCDMA_WCDMA = 14; int NETWORK_MODE_TD_SCDMA_LTE = 15; int NETWORK_MODE_TD_SCDMA_GSM = 16; int NETWORK_MODE_TD_SCDMA_GSM_LTE = 17; int NETWORK_MODE_TD_SCDMA_GSM_WCDMA = 18; int NETWORK_MODE_TD_SCDMA_WCDMA_LTE = 19; int NETWORK_MODE_TD_SCDMA_GSM_WCDMA_LTE = 20; int NETWORK_MODE_TD_SCDMA_CDMA_EVDO_GSM_WCDMA = 21; int NETWORK_MODE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA = 22; 复制代码// Set the preferred network modeint defaultNetworkType = RILConstants.PREFERRED_NETWORK_MODE;int numPhones = MSimTelephonyManager.getDefault().getPhoneCount();String networkMode = SystemProperties.get("ro.telephony.default_network");if (networkMode != null) { if (numPhones == MSimConstants.MAX_PHONE_COUNT_SINGLE_SIM) { loadSetting( stmt, Settings.Global.PREFERRED_NETWORK_MODE, MSimTelephonyManager.getTelephonyProperty( "ro.telephony.default_network", 0, Integer.toString(defaultNetworkType))); } else { loadSetting(stmt, Settings.Global.PREFERRED_NETWORK_MODE, networkMode); }} else { StringBuilder sb = new StringBuilder(defaultNetworkType); for (int i = 0; i < numPhones - 1; i++) { sb.append(","); sb.append(RILConstants.NETWORK_MODE_GSM_ONLY); } loadSetting(stmt, Settings.Global.PREFERRED_NETWORK_MODE, sb.toString());
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯