Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 787f6952 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Steve Kondik
Browse files

Telephony: Add getLteOnGsmMode() method (1/2)

Same functionality as the existing getLteOnCdmaMode, but for GSM
LTE devices.
Enable with the telephony.lteOnGsmDevice system property

From CM 10.0: Ibfb47ca608e51393b99d3308e0a6c66050b3f32e
- Moved getLteOnGsmModeStatic() to TelephonyManager.

Change-Id: I3203cd6abdf94d23df1f6b33a3d1463b330307f7
parent 016f830b
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -1060,6 +1060,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
@@ -1865,6 +1874,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
+6 −0
Original line number Diff line number Diff line
@@ -525,6 +525,12 @@ interface ITelephony {
     */
    void setCellInfoListRate(int rateInMillis);


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

    /**
     * get default sim
     * @return sim id
+5 −0
Original line number Diff line number Diff line
@@ -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