Merge "Device could not use wifi hotspot when data card switch to sim2"
am: 675e2124f3
Change-Id: I6e72fc21c5a0ac5a26bca6d4ee5e8bee05784ef6
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);
}