Merge "Adjust names of call video provider methods."
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 71574b6..7f75ab2 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -105,6 +105,8 @@
     private static final int EVENT_SET_PREFERRED_NETWORK_TYPE_DONE = 24;
     private static final int CMD_SEND_ENVELOPE = 25;
     private static final int EVENT_SEND_ENVELOPE_DONE = 26;
+    private static final int CMD_SET_CDMA_SUBSCRIPTION = 27;
+    private static final int EVENT_SET_CDMA_SUBSCRIPTION_DONE = 28;
 
     /** The singleton instance. */
     private static PhoneInterfaceManager sInstance;
@@ -440,6 +442,17 @@
                     handleNullReturnEvent(msg, "setPreferredNetworkType");
                     break;
 
+                case CMD_SET_CDMA_SUBSCRIPTION:
+                    request = (MainThreadRequest) msg.obj;
+                    onCompleted = obtainMessage(EVENT_SET_CDMA_SUBSCRIPTION_DONE, request);
+                    int subscriptionType = (Integer) request.argument;
+                    mPhone.setCdmaSubscription(subscriptionType, onCompleted);
+                    break;
+
+                case EVENT_SET_CDMA_SUBSCRIPTION_DONE:
+                    handleNullReturnEvent(msg, "setCdmaSubscription");
+                    break;
+
                 default:
                     Log.w(LOG_TAG, "MainThreadHandler: unexpected message code: " + msg.what);
                     break;
@@ -1573,6 +1586,31 @@
     }
 
     /**
+     * Set the CDMA subscription source.
+     * Used for device supporting both NV and RUIM for CDMA.
+     *
+     * @param subscriptionType the subscription type, 0 for RUIM, 1 for NV.
+     * @return true on success; false on any failure.
+     */
+    @Override
+    public boolean setCdmaSubscription(int subscriptionType) {
+        enforceModifyPermission();
+        if (DBG) log("setCdmaSubscription: type " + subscriptionType);
+        if (subscriptionType != mPhone.CDMA_SUBSCRIPTION_RUIM_SIM &&
+            subscriptionType != mPhone.CDMA_SUBSCRIPTION_NV) {
+           loge("setCdmaSubscription: unsupported subscriptionType.");
+           return false;
+        }
+        Boolean success = (Boolean) sendRequest(CMD_SET_CDMA_SUBSCRIPTION, subscriptionType);
+        if (DBG) log("setCdmaSubscription: " + (success ? "ok" : "fail"));
+        if (success) {
+            Settings.Global.putInt(mPhone.getContext().getContentResolver(),
+                    Settings.Global.CDMA_SUBSCRIPTION_MODE, subscriptionType);
+        }
+        return success;
+    }
+
+    /**
      * Set mobile data enabled
      * Used by the user through settings etc to turn on/off mobile data
      *
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index a009bc8..f0cda57 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -117,8 +117,7 @@
             PostDialListener postDialListener = new PostDialListener() {
                 @Override
                 public void onPostDialWait() {
-                    TelephonyConnectionService.this.onPostDialWait(telephonyConnection,
-                            connectionFinal.getRemainingPostDialString());
+                    telephonyConnection.setPostDialWait(connectionFinal.getRemainingPostDialString());
                 }
             };
             connection.addPostDialListener(postDialListener);