Merge "When voicemail number is unknown, show voicemail setup on notification click." into lmp-mr1-dev
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index 6f9c9dd..5b60f8a 100644
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -901,18 +901,24 @@
     /**
      * Displays a notification when the phone receives a notice that a supplemental
      * service has failed.
-     * TODO: This is a NOOP if it isn't for conferences right now.
+     * TODO: This is a NOOP if it isn't for conferences or resuming call failures right now.
      */
     private void onSuppServiceFailed(AsyncResult r) {
-        if (r.result != Phone.SuppService.CONFERENCE) {
-            if (DBG) log("onSuppServiceFailed: not a merge failure event");
+        if (r.result != Phone.SuppService.CONFERENCE && r.result != Phone.SuppService.RESUME) {
+            if (DBG) log("onSuppServiceFailed: not a merge or resume failure event");
             return;
         }
 
-        if (DBG) log("onSuppServiceFailed: displaying merge failure message");
-
-        String mergeFailedString = mApplication.getResources().getString(
-                R.string.incall_error_supp_service_conference);
+        String mergeFailedString = "";
+        if (r.result == Phone.SuppService.CONFERENCE) {
+            if (DBG) log("onSuppServiceFailed: displaying merge failure message");
+            mergeFailedString = mApplication.getResources().getString(
+                    R.string.incall_error_supp_service_conference);
+        } else if (r.result == Phone.SuppService.RESUME) {
+            if (DBG) log("onSuppServiceFailed: displaying merge failure message");
+            mergeFailedString = mApplication.getResources().getString(
+                    R.string.incall_error_supp_service_switch);
+        }
         PhoneDisplayMessage.displayErrorMessage(mApplication, mergeFailedString);
 
         // start a timer that kills the dialog
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 30c3a39..d20df1b 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1917,9 +1917,17 @@
      * @param enable {@code true} turn turn data on, else {@code false}
      */
     @Override
-    public void setDataEnabled(boolean enable) {
+    public void setDataEnabled(int subId, boolean enable) {
         enforceModifyPermission();
-        mPhone.setDataEnabled(enable);
+        int phoneId = mSubscriptionController.getPhoneId(subId);
+        log("getDataEnabled: subId=" + subId + " phoneId=" + phoneId);
+        Phone phone = PhoneFactory.getPhone(phoneId);
+        if (phone != null) {
+            log("setDataEnabled: subId=" + subId + " enable=" + enable);
+            phone.setDataEnabled(enable);
+        } else {
+            loge("setDataEnabled: no phone for subId=" + subId);
+        }
     }
 
     /**
@@ -1932,7 +1940,7 @@
      * @return {@code true} if data is enabled else {@code false}
      */
     @Override
-    public boolean getDataEnabled() {
+    public boolean getDataEnabled(int subId) {
         try {
             mApp.enforceCallingOrSelfPermission(android.Manifest.permission.ACCESS_NETWORK_STATE,
                     null);
@@ -1940,7 +1948,17 @@
             mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE,
                     null);
         }
-        return mPhone.getDataEnabled();
+        int phoneId = mSubscriptionController.getPhoneId(subId);
+        log("getDataEnabled: subId=" + subId + " phoneId=" + phoneId);
+        Phone phone = PhoneFactory.getPhone(phoneId);
+        if (phone != null) {
+            boolean retVal = phone.getDataEnabled();
+            log("getDataEnabled: subId=" + subId + " retVal=" + retVal);
+            return retVal;
+        } else {
+            loge("getDataEnabled: no phone subId=" + subId + " retVal=false");
+            return false;
+        }
     }
 
     @Override