From a871ee0654c53cc2313059b22435831fa9cd0b62 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Mon, 4 Nov 2013 02:05:24 +0000 Subject: Telephony: Add getLteOnGsmMode() method (1/2) Same functionality as the existing getLteOnCdmaMode, but for GSM LTE devices. Enable with the telephony.lteOnGsmDevice system property Change-Id: If563e43e1f97b23966cb42ff24eb0b406f9db8e2 --- .../java/android/telephony/TelephonyManager.java | 24 ++++++++++++++++++++++ .../com/android/internal/telephony/ITelephony.aidl | 6 ++++++ .../internal/telephony/TelephonyProperties.java | 5 +++++ 3 files changed, 35 insertions(+) (limited to 'telephony/java') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 4799753..3249989 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1168,6 +1168,15 @@ public class TelephonyManager { return retVal; } + /** + * Return if the current radio is LTE on GSM + * @hide + */ + public static int getLteOnGsmModeStatic() { + return SystemProperties.getInt(TelephonyProperties.PROPERTY_LTE_ON_GSM_DEVICE, + 0); + } + // // // Current Network @@ -2004,6 +2013,21 @@ public class TelephonyManager { } } + /** + * 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 diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 2ea2be5..6e0ac88 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -538,6 +538,12 @@ interface ITelephony { */ void setCellInfoListRate(int rateInMillis); + + /** + * Return if the current radio is LTE on GSM + */ + int getLteOnGsmMode(); + /** * get default sim * @return sim id diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java index 1d142e7..bb9e7c0 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java +++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java @@ -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 -- cgit v1.1