Merge "Device could not use wifi hotspot when data card switch to sim2" am: 675e2124f3
am: 2c9697b19f

Change-Id: I9371ce3507407f33c676b168e9c5da057444d9f2
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index afadcaa..3a3d1b9 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -4540,18 +4540,23 @@
     }
 
     /**
-     * Check whether DUN APN is required for tethering.
+     * Check whether DUN APN is required for tethering with subId.
      *
+     * @param subId the id of the subscription to require tethering.
      * @return {@code true} if DUN APN is required for tethering.
      * @hide
      */
     @Override
-    public boolean getTetherApnRequired() {
+    public boolean getTetherApnRequiredForSubscriber(int subId) {
         enforceModifyPermission();
         final long identity = Binder.clearCallingIdentity();
-        final Phone defaultPhone = getDefaultPhone();
+        final Phone phone = getPhone(subId);
         try {
-            return defaultPhone.hasMatchedTetherApnSetting();
+            if (phone != null) {
+                return phone.hasMatchedTetherApnSetting();
+            } else {
+                return false;
+            }
         } finally {
             Binder.restoreCallingIdentity(identity);
         }