OSDN Git Service

resolved conflicts for merge 322f7d6e to master-nova
authorEvan Charlton <evanc@google.com>
Thu, 6 Mar 2014 18:08:06 +0000 (10:08 -0800)
committerEvan Charlton <evanc@google.com>
Thu, 6 Mar 2014 18:08:06 +0000 (10:08 -0800)
Change-Id: I31de6084253ce21f50224582f82b7f7e630ef34e

1  2 
telephony/java/android/telephony/TelephonyManager.java
telephony/java/com/android/internal/telephony/ITelephony.aidl

@@@ -1905,30 -1842,40 +1905,67 @@@ public class TelephonyManager 
          return false;
      }
  
 +    /*
 +     * Obtain the current state of Wi-Fi calling.
 +     *
 +     * @hide
 +     * @see android.telephony.TelephonyManager.WifiCallingChoices
 +     */
 +    public int getWhenToMakeWifiCalls() {
 +        try {
 +            return getITelephony().getWhenToMakeWifiCalls();
 +        } catch (RemoteException ex) {
 +            return WifiCallingChoices.NEVER_USE;
 +        }
 +    }
 +
 +    /**
 +     * Set the current state of Wi-Fi calling.
 +     *
 +     * @hide
 +     * @see android.telephony.TelephonyManager.WifiCallingChoices
 +     */
 +    public void setWhenToMakeWifiCalls(int state) {
 +        try {
 +            getITelephony().setWhenToMakeWifiCalls(state);
 +        } catch (RemoteException ex) {
 +        }
 +    }
++
+     /**
+      * 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;
+     }
  }
@@@ -418,27 -405,19 +418,44 @@@ interface ITelephony 
      boolean nvResetConfig(int resetType);
  
      /**
 +     * Inform the phone about a new incoming third party call. The phone will bind to the service
 +     * identified by component to handle the call.
 +     * @param component the component that should handle the intent.
 +     * @param callId the unique id of the call.
 +     * @param callerDisplayName the name shown to the user. Normally this will be the caller's phone
 +     *                          number.
 +     */
 +    void newIncomingThirdPartyCall(in ComponentName component, String callId,
 +            String callerDisplayName);
 +
 +    /**
 +     * Obtain the current state of Wi-Fi calling.
 +     *
 +     * @see android.telephony.TelephonyManager.WifiCallingChoices
 +     */
 +    int getWhenToMakeWifiCalls();
 +
 +    /**
 +     * Set the current state of Wi-Fi calling.
 +     *
 +     * @see android.telephony.TelephonyManager.WifiCallingChoices
 +     */
 +    void setWhenToMakeWifiCalls(int state);
++
++    /*
+      * 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);
  }