diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 4930255734b51..e4885a112f8e0 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -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. diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 5b6db4d1b8821..7bf3b3fd97b32 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -583,6 +583,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.