Skip to content

Commit cd4636e

Browse files
author
Wink Saville
committed
Add LteOnCdmaDevice system property.
Provide a system property which may be optionally set at build time. Change-Id: I253ff0df7c8f8c5627c775fb0cff2cb831157eed
1 parent 476f552 commit cd4636e

2 files changed

Lines changed: 27 additions & 13 deletions

File tree

telephony/java/com/android/internal/telephony/BaseCommands.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import android.os.Handler;
2424
import android.os.AsyncResult;
2525
import android.os.SystemProperties;
26-
import android.util.Config;
2726
import android.util.Log;
2827

2928
import java.io.FileInputStream;
@@ -691,7 +690,7 @@ protected void setRadioState(RadioState newState) {
691690
RadioState oldState;
692691

693692
synchronized (mStateMonitor) {
694-
if (Config.LOGV) {
693+
if (false) {
695694
Log.v(LOG_TAG, "setRadioState old: " + mState
696695
+ " new " + newState);
697696
}
@@ -858,22 +857,28 @@ public int getLteOnCdmaMode() {
858857
*/
859858
public static int getLteOnCdmaModeStatic() {
860859
int retVal;
861-
String productType;
862-
863-
Matcher matcher = sProductTypePattern.matcher(sKernelCmdLine);
864-
if (matcher.find()) {
865-
productType = matcher.group(1);
866-
if (sLteOnCdmaProductType.equals(productType)) {
867-
retVal = Phone.LTE_ON_CDMA_TRUE;
860+
int curVal;
861+
String productType = "";
862+
863+
curVal = SystemProperties.getInt(TelephonyProperties.PROPERTY_LTE_ON_CDMA_DEVICE,
864+
Phone.LTE_ON_CDMA_UNKNOWN);
865+
retVal = curVal;
866+
if (retVal == Phone.LTE_ON_CDMA_UNKNOWN) {
867+
Matcher matcher = sProductTypePattern.matcher(sKernelCmdLine);
868+
if (matcher.find()) {
869+
productType = matcher.group(1);
870+
if (sLteOnCdmaProductType.equals(productType)) {
871+
retVal = Phone.LTE_ON_CDMA_TRUE;
872+
} else {
873+
retVal = Phone.LTE_ON_CDMA_FALSE;
874+
}
868875
} else {
869876
retVal = Phone.LTE_ON_CDMA_FALSE;
870877
}
871-
} else {
872-
retVal = Phone.LTE_ON_CDMA_FALSE;
873-
productType = "";
874878
}
875879

876-
Log.d(LOG_TAG, "getLteOnCdmaMode=" + retVal + " product_type='" + productType +
880+
Log.d(LOG_TAG, "getLteOnCdmaMode=" + retVal + " curVal=" + curVal +
881+
" product_type='" + productType +
877882
"' lteOnCdmaProductType='" + sLteOnCdmaProductType + "'");
878883
return retVal;
879884
}

telephony/java/com/android/internal/telephony/TelephonyProperties.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ public interface TelephonyProperties
7979
*/
8080
static final String PROPERTY_LTE_ON_CDMA_PRODUCT_TYPE = "telephony.lteOnCdmaProductType";
8181

82+
/**
83+
* The contents of this property is the one of {@link Phone#LTE_ON_CDMA_TRUE} or
84+
* {@link Phone#LTE_ON_CDMA_FALSE}. If absent the value will assumed to be false
85+
* and the {@see #PROPERTY_LTE_ON_CDMA_PRODUCT_TYPE} will be used to determine its
86+
* final value which could also be {@link Phone#LTE_ON_CDMA_FALSE}.
87+
* {@see BaseCommands#getLteOnCdmaMode()}
88+
*/
89+
static final String PROPERTY_LTE_ON_CDMA_DEVICE = "telephony.lteOnCdmaDevice";
90+
8291
static final String CURRENT_ACTIVE_PHONE = "gsm.current.phone-type";
8392

8493
//****** SIM Card

0 commit comments

Comments
 (0)