Merge "Telephony(MSIM): Default NW mode property for each slot"

This commit is contained in:
Pengquan Meng
2018-03-08 17:56:28 +00:00
committed by Gerrit Code Review
2 changed files with 21 additions and 8 deletions

View File

@@ -40,6 +40,7 @@ import android.os.UserHandle;
import android.provider.Settings;
import android.provider.Settings.Global;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
@@ -2601,15 +2602,26 @@ class DatabaseHelper extends SQLiteOpenHelper {
loadSetting(stmt, Settings.Global.CALL_AUTO_RETRY, 0);
// Set the preferred network mode to target desired value or Default
// value defined in RILConstants
int type;
type = RILConstants.PREFERRED_NETWORK_MODE;
loadSetting(stmt, Settings.Global.PREFERRED_NETWORK_MODE, type);
// value defined in system property
String val = "";
String mode;
for (int phoneId = 0;
phoneId < TelephonyManager.getDefault().getPhoneCount(); phoneId++) {
mode = TelephonyManager.getTelephonyProperty(phoneId,
"ro.telephony.default_network",
Integer.toString(RILConstants.PREFERRED_NETWORK_MODE));
if (phoneId == 0) {
val = mode;
} else {
val = val + "," + mode;
}
}
loadSetting(stmt, Settings.Global.PREFERRED_NETWORK_MODE, val);
// Set the preferred cdma subscription source to target desired value or default
// value defined in Phone
type = SystemProperties.getInt("ro.telephony.default_cdma_sub",
Phone.PREFERRED_CDMA_SUBSCRIPTION);
int type = SystemProperties.getInt("ro.telephony.default_cdma_sub",
Phone.PREFERRED_CDMA_SUBSCRIPTION);
loadSetting(stmt, Settings.Global.CDMA_SUBSCRIPTION_MODE, type);
loadIntegerSetting(stmt, Settings.Global.LOW_BATTERY_SOUND_TIMEOUT,

View File

@@ -25,6 +25,7 @@ package com.android.internal.telephony;
*/
import android.os.SystemProperties;
import android.telephony.TelephonyManager;
/**
* {@hide}
@@ -162,8 +163,8 @@ public interface RILConstants {
int NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA = 20; /* TD-SCDMA, GSM/WCDMA and LTE */
int NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = 21; /*TD-SCDMA,EvDo,CDMA,GSM/WCDMA*/
int NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = 22; /* TD-SCDMA/LTE/GSM/WCDMA, CDMA, and EvDo */
int PREFERRED_NETWORK_MODE = SystemProperties.getInt("ro.telephony.default_network",
NETWORK_MODE_WCDMA_PREF);
int PREFERRED_NETWORK_MODE = Integer.parseInt(TelephonyManager.getTelephonyProperty(0,
"ro.telephony.default_network", Integer.toString(NETWORK_MODE_WCDMA_PREF)));
int BAND_MODE_UNSPECIFIED = 0; //"unspecified" (selected by baseband automatically)
int BAND_MODE_EURO = 1; //"EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)