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

Commit 1365703d authored by Junda Liu's avatar Junda Liu
Browse files

Add calculatePreferredNetworkType to TelephonyManager.

Bug: b/14134668
Change-Id: Iba7dcd50c1ba84b634eed53030456a2f84af6e3c
parent 1e1f2e89
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -2755,6 +2755,25 @@ public class TelephonyManager {
        }
    }

    /**
     * Get the calculated preferred network type.
     * Used for debugging incorrect network type.
     *
     * @return the preferred network type, defined in RILConstants.java or -1 if
     *         none available.
     * @hide
     */
    public int getCalculatedPreferredNetworkType() {
        try {
            return getITelephony().getCalculatedPreferredNetworkType();
        } catch (RemoteException ex) {
            Rlog.e(TAG, "getCalculatedPreferredNetworkType RemoteException", ex);
        } catch (NullPointerException ex) {
            Rlog.e(TAG, "getCalculatedPreferredNetworkType NPE", ex);
        }
        return -1;
    }

    /**
     * Get the preferred network type.
     * Used for device configuration by some CDMA operators.
+8 −0
Original line number Diff line number Diff line
@@ -588,6 +588,14 @@ interface ITelephony {
     */
    boolean nvResetConfig(int resetType);

    /*
     * Get the calculated preferred network type.
     * Used for device configuration by some CDMA operators.
     *
     * @return the calculated preferred network type, defined in RILConstants.java.
     */
    int getCalculatedPreferredNetworkType();

    /*
     * Get the preferred network type.
     * Used for device configuration by some CDMA operators.