Loading telephony/java/android/telephony/TelephonyManager.java +37 −0 Original line number Diff line number Diff line Loading @@ -1841,4 +1841,41 @@ public class TelephonyManager { } return false; } /** * Get the preferred network type. * Used for device configuration by some CDMA operators. * * @return the preferred network type, defined in RILConstants.java. * @hide */ public int getPreferredNetworkType() { try { return getITelephony().getPreferredNetworkType(); } catch (RemoteException ex) { Rlog.e(TAG, "getPreferredNetworkType RemoteException", ex); } catch (NullPointerException ex) { Rlog.e(TAG, "getPreferredNetworkType NPE", ex); } return -1; } /** * Set the preferred network type. * Used for device configuration by some CDMA operators. * * @param networkType the preferred network type, defined in RILConstants.java. * @return true on success; false on any failure. * @hide */ public boolean setPreferredNetworkType(int networkType) { try { return getITelephony().setPreferredNetworkType(networkType); } catch (RemoteException ex) { Rlog.e(TAG, "setPreferredNetworkType RemoteException", ex); } catch (NullPointerException ex) { Rlog.e(TAG, "setPreferredNetworkType NPE", ex); } return false; } } telephony/java/com/android/internal/telephony/ITelephony.aidl +17 −0 Original line number Diff line number Diff line Loading @@ -403,4 +403,21 @@ interface ITelephony { * @return true on success; false on any failure. */ boolean nvResetConfig(int resetType); /** * Get the preferred network type. * Used for device configuration by some CDMA operators. * * @return the preferred network type, defined in RILConstants.java. */ int getPreferredNetworkType(); /** * Set the preferred network type. * Used for device configuration by some CDMA operators. * * @param networkType the preferred network type, defined in RILConstants.java. * @return true on success; false on any failure. */ boolean setPreferredNetworkType(int networkType); } Loading
telephony/java/android/telephony/TelephonyManager.java +37 −0 Original line number Diff line number Diff line Loading @@ -1841,4 +1841,41 @@ public class TelephonyManager { } return false; } /** * Get the preferred network type. * Used for device configuration by some CDMA operators. * * @return the preferred network type, defined in RILConstants.java. * @hide */ public int getPreferredNetworkType() { try { return getITelephony().getPreferredNetworkType(); } catch (RemoteException ex) { Rlog.e(TAG, "getPreferredNetworkType RemoteException", ex); } catch (NullPointerException ex) { Rlog.e(TAG, "getPreferredNetworkType NPE", ex); } return -1; } /** * Set the preferred network type. * Used for device configuration by some CDMA operators. * * @param networkType the preferred network type, defined in RILConstants.java. * @return true on success; false on any failure. * @hide */ public boolean setPreferredNetworkType(int networkType) { try { return getITelephony().setPreferredNetworkType(networkType); } catch (RemoteException ex) { Rlog.e(TAG, "setPreferredNetworkType RemoteException", ex); } catch (NullPointerException ex) { Rlog.e(TAG, "setPreferredNetworkType NPE", ex); } return false; } }
telephony/java/com/android/internal/telephony/ITelephony.aidl +17 −0 Original line number Diff line number Diff line Loading @@ -403,4 +403,21 @@ interface ITelephony { * @return true on success; false on any failure. */ boolean nvResetConfig(int resetType); /** * Get the preferred network type. * Used for device configuration by some CDMA operators. * * @return the preferred network type, defined in RILConstants.java. */ int getPreferredNetworkType(); /** * Set the preferred network type. * Used for device configuration by some CDMA operators. * * @param networkType the preferred network type, defined in RILConstants.java. * @return true on success; false on any failure. */ boolean setPreferredNetworkType(int networkType); }