Skip to content

Commit

Permalink
Telephony: Add getLteOnGsmMode() method
Browse files Browse the repository at this point in the history
Same functionality as the existing getLteOnCdmaMode, but for GSM
LTE devices.
Enable with the telephony.lteOnGsmDevice system property

Additionally, support GSM LTE in the SystemUI LTE power widget

Change-Id: Ibfb47ca608e51393b99d3308e0a6c66050b3f32e

Conflicts:

	packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/LTEButton.java
	telephony/java/com/android/internal/telephony/BaseCommands.java
	telephony/java/com/android/internal/telephony/ITelephony.aidl
  • Loading branch information
rmcc authored and knzy committed Sep 13, 2012
1 parent de59a09 commit 5c5e47a
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 0 deletions.
15 changes: 15 additions & 0 deletions telephony/java/android/telephony/TelephonyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,21 @@ public int getLteOnCdmaMode() {
}
}

/**
* Return if the current radio is LTE on GSM
* @hide
*/
public int getLteOnGsmMode() {
try {
return getITelephony().getLteOnGsmMode();
} catch (RemoteException ex) {
return 0;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return 0;
}
}

//
//
// Subscriber Info
Expand Down
17 changes: 17 additions & 0 deletions telephony/java/com/android/internal/telephony/BaseCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -718,4 +718,21 @@ public static int getLteOnCdmaModeStatic() {

@Override
public void testingEmergencyCall() {}

/**
* @hide
*/
@Override
public int getLteOnGsmMode() {
return getLteOnGsmModeStatic();
}

/**
* Return if the current radio is LTE on GSM
* @hide
*/
public static int getLteOnGsmModeStatic() {
return SystemProperties.getInt(TelephonyProperties.PROPERTY_LTE_ON_GSM_DEVICE,
0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,12 @@ public void setupDataCall(String radioTechnology, String profile,
*/
public int getLteOnCdmaMode();

/**
* Return if the current radio is LTE on GSM
* @hide
*/
public int getLteOnGsmMode();

/**
* Request the ISIM application on the UICC to perform the AKA
* challenge/response algorithm for IMS authentication. The nonce string
Expand Down
2 changes: 2 additions & 0 deletions telephony/java/com/android/internal/telephony/ITelephony.aidl
Original file line number Diff line number Diff line change
Expand Up @@ -284,5 +284,7 @@ interface ITelephony {
* Returns the all observed cell information of the device.
*/
List<CellInfo> getAllCellInfo();

int getLteOnGsmMode();
}

7 changes: 7 additions & 0 deletions telephony/java/com/android/internal/telephony/Phone.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ enum SuppService {
int NT_MODE_GSM_ONLY = RILConstants.NETWORK_MODE_GSM_ONLY;
int NT_MODE_WCDMA_ONLY = RILConstants.NETWORK_MODE_WCDMA_ONLY;
int NT_MODE_GSM_UMTS = RILConstants.NETWORK_MODE_GSM_UMTS;
int NT_MODE_LTE_GSM_WCDMA= RILConstants.NETWORK_MODE_LTE_GSM_WCDMA;

int NT_MODE_CDMA = RILConstants.NETWORK_MODE_CDMA;

Expand Down Expand Up @@ -1732,6 +1733,12 @@ void selectNetworkManually(OperatorInfo network,
*/
public int getLteOnCdmaMode();

/**
* Return if the current radio is LTE on GSM
* @hide
*/
public int getLteOnGsmMode();

/**
* TODO: Adding a function for each property is not good.
* A fucntion of type getPhoneProp(propType) where propType is an
Expand Down
8 changes: 8 additions & 0 deletions telephony/java/com/android/internal/telephony/PhoneBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,14 @@ public int getLteOnCdmaMode() {
return mCM.getLteOnCdmaMode();
}

/**
* {@hide}
*/
@Override
public int getLteOnGsmMode() {
return mCM.getLteOnGsmMode();
}

/**
* Sets the SIM voice message waiting indicator records.
* @param line GSM Subscriber Profile Number, one-based. Only '1' is supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ public static void makeDefaultPhone(Context context) {
if (BaseCommands.getLteOnCdmaModeStatic() == Phone.LTE_ON_CDMA_TRUE) {
preferredNetworkMode = Phone.NT_MODE_GLOBAL;
}
if (BaseCommands.getLteOnGsmModeStatic() != 0) {
preferredNetworkMode = Phone.NT_MODE_LTE_GSM_WCDMA;
}
int networkMode = Settings.Secure.getInt(context.getContentResolver(),
Settings.Secure.PREFERRED_NETWORK_MODE, preferredNetworkMode);
Log.i(LOG_TAG, "Network Mode set to " + Integer.toString(networkMode));
Expand Down Expand Up @@ -196,6 +199,7 @@ public static int getPhoneType(int networkMode) {
case RILConstants.NETWORK_MODE_GSM_ONLY:
case RILConstants.NETWORK_MODE_WCDMA_ONLY:
case RILConstants.NETWORK_MODE_GSM_UMTS:
case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA:
return Phone.PHONE_TYPE_GSM;

// Use CDMA Phone for the global mode including CDMA
Expand Down
8 changes: 8 additions & 0 deletions telephony/java/com/android/internal/telephony/PhoneProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,14 @@ public int getLteOnCdmaMode() {
return mActivePhone.getLteOnCdmaMode();
}

/**
* {@hide}
*/
@Override
public int getLteOnGsmMode() {
return mActivePhone.getLteOnGsmMode();
}

@Override
public void setVoiceMessageWaiting(int line, int countWaiting) {
mActivePhone.setVoiceMessageWaiting(line, countWaiting);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public interface TelephonyProperties
*/
static final String PROPERTY_LTE_ON_CDMA_DEVICE = "telephony.lteOnCdmaDevice";

/**
* {@see BaseCommands#getLteOnGsmMode()}
*/
static final String PROPERTY_LTE_ON_GSM_DEVICE = "telephony.lteOnGsmDevice";

static final String CURRENT_ACTIVE_PHONE = "gsm.current.phone-type";

//****** SIM Card
Expand Down

0 comments on commit 5c5e47a

Please sign in to comment.