am cd4636ec: Add LteOnCdmaDevice system property.

* commit 'cd4636ec08a50ab890acab0cf0c3c3f07f91896a':
  Add LteOnCdmaDevice system property.
This commit is contained in:
Wink Saville
2011-07-18 18:39:41 -07:00
committed by Android Git Automerger
2 changed files with 26 additions and 12 deletions

View File

@@ -23,7 +23,6 @@ import android.os.Registrant;
import android.os.Handler; import android.os.Handler;
import android.os.AsyncResult; import android.os.AsyncResult;
import android.os.SystemProperties; import android.os.SystemProperties;
import android.util.Config;
import android.util.Log; import android.util.Log;
import java.io.FileInputStream; import java.io.FileInputStream;
@@ -691,7 +690,7 @@ public abstract class BaseCommands implements CommandsInterface {
RadioState oldState; RadioState oldState;
synchronized (mStateMonitor) { synchronized (mStateMonitor) {
if (Config.LOGV) { if (false) {
Log.v(LOG_TAG, "setRadioState old: " + mState Log.v(LOG_TAG, "setRadioState old: " + mState
+ " new " + newState); + " new " + newState);
} }
@@ -858,22 +857,28 @@ public abstract class BaseCommands implements CommandsInterface {
*/ */
public static int getLteOnCdmaModeStatic() { public static int getLteOnCdmaModeStatic() {
int retVal; int retVal;
String productType; int curVal;
String productType = "";
Matcher matcher = sProductTypePattern.matcher(sKernelCmdLine); curVal = SystemProperties.getInt(TelephonyProperties.PROPERTY_LTE_ON_CDMA_DEVICE,
if (matcher.find()) { Phone.LTE_ON_CDMA_UNKNOWN);
productType = matcher.group(1); retVal = curVal;
if (sLteOnCdmaProductType.equals(productType)) { if (retVal == Phone.LTE_ON_CDMA_UNKNOWN) {
retVal = Phone.LTE_ON_CDMA_TRUE; Matcher matcher = sProductTypePattern.matcher(sKernelCmdLine);
if (matcher.find()) {
productType = matcher.group(1);
if (sLteOnCdmaProductType.equals(productType)) {
retVal = Phone.LTE_ON_CDMA_TRUE;
} else {
retVal = Phone.LTE_ON_CDMA_FALSE;
}
} else { } else {
retVal = Phone.LTE_ON_CDMA_FALSE; retVal = Phone.LTE_ON_CDMA_FALSE;
} }
} else {
retVal = Phone.LTE_ON_CDMA_FALSE;
productType = "";
} }
Log.d(LOG_TAG, "getLteOnCdmaMode=" + retVal + " product_type='" + productType + Log.d(LOG_TAG, "getLteOnCdmaMode=" + retVal + " curVal=" + curVal +
" product_type='" + productType +
"' lteOnCdmaProductType='" + sLteOnCdmaProductType + "'"); "' lteOnCdmaProductType='" + sLteOnCdmaProductType + "'");
return retVal; return retVal;
} }

View File

@@ -79,6 +79,15 @@ public interface TelephonyProperties
*/ */
static final String PROPERTY_LTE_ON_CDMA_PRODUCT_TYPE = "telephony.lteOnCdmaProductType"; static final String PROPERTY_LTE_ON_CDMA_PRODUCT_TYPE = "telephony.lteOnCdmaProductType";
/**
* The contents of this property is the one of {@link Phone#LTE_ON_CDMA_TRUE} or
* {@link Phone#LTE_ON_CDMA_FALSE}. If absent the value will assumed to be false
* and the {@see #PROPERTY_LTE_ON_CDMA_PRODUCT_TYPE} will be used to determine its
* final value which could also be {@link Phone#LTE_ON_CDMA_FALSE}.
* {@see BaseCommands#getLteOnCdmaMode()}
*/
static final String PROPERTY_LTE_ON_CDMA_DEVICE = "telephony.lteOnCdmaDevice";
static final String CURRENT_ACTIVE_PHONE = "gsm.current.phone-type"; static final String CURRENT_ACTIVE_PHONE = "gsm.current.phone-type";
//****** SIM Card //****** SIM Card