From 3be9888e5a0ab5ab8889d2e6b90b6444e1d35575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=97=E8=8B=97=20=28Miao=20Miao=29?= Date: Wed, 20 Mar 2019 14:30:45 +0800 Subject: [PATCH] Device could not use wifi hotspot when data card switch to sim2 STEPS TO REPRODUCE: 1. Test devide insert two sim card into the phone,Sim1 do not support DUN APN and sim2 support DUP APN 2. Switch data card to sim2 2. Enable wifi hotspot 3. Reference phone connect test device wifi hotspot and access website OBSERVED RESULTS: Reference phone could connect to test device wifi hotspot but could not access to Internet Test: Whether wifi hotspot available when sim2 which support DUN APN is data card Change-Id: I733ccea273b03efc6bbc59c3308d0b7941eb282b --- .../java/android/telephony/TelephonyManager.java | 13 ++++++++++++- .../com/android/internal/telephony/ITelephony.aidl | 5 +++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 973cd77916b5b..6f07652777621 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -7082,10 +7082,21 @@ public class TelephonyManager { * @hide */ public boolean getTetherApnRequired() { + return getTetherApnRequired(getSubId(SubscriptionManager.getDefaultDataSubscriptionId())); + } + + /** + * 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 + */ + public boolean getTetherApnRequired(int subId) { try { ITelephony telephony = getITelephony(); if (telephony != null) - return telephony.getTetherApnRequired(); + return telephony.getTetherApnRequiredForSubscriber(subId); } catch (RemoteException ex) { Rlog.e(TAG, "hasMatchedTetherApnSetting RemoteException", ex); } catch (NullPointerException ex) { diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 02a5bc8937ee4..5d21bb0d7fffc 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -788,12 +788,13 @@ interface ITelephony { int getPreferredNetworkType(int subId); /** - * 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 */ - boolean getTetherApnRequired(); + boolean getTetherApnRequiredForSubscriber(int subId); /** * Enables framework IMS and triggers IMS Registration.