Loading api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -8720,7 +8720,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isTetherApnRequired(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isTetheringApnRequired(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isVideoCallingEnabled(); method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVisualVoicemailEnabled(android.telecom.PhoneAccountHandle); method public boolean needsOtaServiceProvisioning(); core/res/res/values/config.xml +1 −1 Original line number Diff line number Diff line Loading @@ -529,7 +529,7 @@ - TYPE_ETHERNET (9) is prepended to this list, and - the return value of TelephonyManager.isTetherApnRequired() - the return value of TelephonyManager.isTetheringApnRequired() determines how the array is further modified: * TRUE (DUN REQUIRED). Loading packages/Tethering/src/com/android/server/connectivity/tethering/TetheringConfiguration.java +1 −1 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ public class TetheringConfiguration { /** Check whether dun is required. */ public static boolean checkDunRequired(Context ctx, int id) { final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(TELEPHONY_SERVICE); return (tm != null) ? tm.isTetherApnRequired(id) : false; return (tm != null) ? tm.isTetheringApnRequired(id) : false; } private static Collection<Integer> getUpstreamIfaceTypes(Resources res, boolean dunRequired) { Loading packages/Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringConfigurationTest.java +5 −5 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ public class TetheringConfigurationTest { @Test public void testDunFromTelephonyManagerMeansDun() { when(mTelephonyManager.isTetherApnRequired(anyInt())).thenReturn(true); when(mTelephonyManager.isTetheringApnRequired(anyInt())).thenReturn(true); final TetheringConfiguration cfgWifi = getTetheringConfiguration(TYPE_WIFI); final TetheringConfiguration cfgMobileWifiHipri = getTetheringConfiguration( Loading @@ -169,7 +169,7 @@ public class TetheringConfigurationTest { @Test public void testDunNotRequiredFromTelephonyManagerMeansNoDun() { when(mTelephonyManager.isTetherApnRequired(anyInt())).thenReturn(false); when(mTelephonyManager.isTetheringApnRequired(anyInt())).thenReturn(false); final TetheringConfiguration cfgWifi = getTetheringConfiguration(TYPE_WIFI); final TetheringConfiguration cfgMobileWifiHipri = getTetheringConfiguration( Loading Loading @@ -212,7 +212,7 @@ public class TetheringConfigurationTest { @Test public void testNoDefinedUpstreamTypesAddsEthernet() { when(mResources.getIntArray(config_tether_upstream_types)).thenReturn(new int[]{}); when(mTelephonyManager.isTetherApnRequired(anyInt())).thenReturn(false); when(mTelephonyManager.isTetheringApnRequired(anyInt())).thenReturn(false); final TetheringConfiguration cfg = new TetheringConfiguration( mMockContext, mLog, INVALID_SUBSCRIPTION_ID); Loading @@ -235,7 +235,7 @@ public class TetheringConfigurationTest { public void testDefinedUpstreamTypesSansEthernetAddsEthernet() { when(mResources.getIntArray(config_tether_upstream_types)).thenReturn( new int[]{TYPE_WIFI, TYPE_MOBILE_HIPRI}); when(mTelephonyManager.isTetherApnRequired(anyInt())).thenReturn(false); when(mTelephonyManager.isTetheringApnRequired(anyInt())).thenReturn(false); final TetheringConfiguration cfg = new TetheringConfiguration( mMockContext, mLog, INVALID_SUBSCRIPTION_ID); Loading @@ -253,7 +253,7 @@ public class TetheringConfigurationTest { public void testDefinedUpstreamTypesWithEthernetDoesNotAddEthernet() { when(mResources.getIntArray(config_tether_upstream_types)) .thenReturn(new int[]{TYPE_WIFI, TYPE_ETHERNET, TYPE_MOBILE_HIPRI}); when(mTelephonyManager.isTetherApnRequired(anyInt())).thenReturn(false); when(mTelephonyManager.isTetheringApnRequired(anyInt())).thenReturn(false); final TetheringConfiguration cfg = new TetheringConfiguration( mMockContext, mLog, INVALID_SUBSCRIPTION_ID); Loading telephony/java/android/telephony/TelephonyManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -7853,8 +7853,8 @@ public class TelephonyManager { */ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @SystemApi public boolean isTetherApnRequired() { return isTetherApnRequired(getSubId(SubscriptionManager.getActiveDataSubscriptionId())); public boolean isTetheringApnRequired() { return isTetheringApnRequired(getSubId(SubscriptionManager.getActiveDataSubscriptionId())); } /** Loading @@ -7864,11 +7864,11 @@ public class TelephonyManager { * @return {@code true} if DUN APN is required for tethering. * @hide */ public boolean isTetherApnRequired(int subId) { public boolean isTetheringApnRequired(int subId) { try { ITelephony telephony = getITelephony(); if (telephony != null) return telephony.isTetherApnRequiredForSubscriber(subId); return telephony.isTetheringApnRequiredForSubscriber(subId); } catch (RemoteException ex) { Rlog.e(TAG, "hasMatchedTetherApnSetting RemoteException", ex); } catch (NullPointerException ex) { Loading Loading
api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -8720,7 +8720,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isTetherApnRequired(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isTetheringApnRequired(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isVideoCallingEnabled(); method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVisualVoicemailEnabled(android.telecom.PhoneAccountHandle); method public boolean needsOtaServiceProvisioning();
core/res/res/values/config.xml +1 −1 Original line number Diff line number Diff line Loading @@ -529,7 +529,7 @@ - TYPE_ETHERNET (9) is prepended to this list, and - the return value of TelephonyManager.isTetherApnRequired() - the return value of TelephonyManager.isTetheringApnRequired() determines how the array is further modified: * TRUE (DUN REQUIRED). Loading
packages/Tethering/src/com/android/server/connectivity/tethering/TetheringConfiguration.java +1 −1 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ public class TetheringConfiguration { /** Check whether dun is required. */ public static boolean checkDunRequired(Context ctx, int id) { final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(TELEPHONY_SERVICE); return (tm != null) ? tm.isTetherApnRequired(id) : false; return (tm != null) ? tm.isTetheringApnRequired(id) : false; } private static Collection<Integer> getUpstreamIfaceTypes(Resources res, boolean dunRequired) { Loading
packages/Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringConfigurationTest.java +5 −5 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ public class TetheringConfigurationTest { @Test public void testDunFromTelephonyManagerMeansDun() { when(mTelephonyManager.isTetherApnRequired(anyInt())).thenReturn(true); when(mTelephonyManager.isTetheringApnRequired(anyInt())).thenReturn(true); final TetheringConfiguration cfgWifi = getTetheringConfiguration(TYPE_WIFI); final TetheringConfiguration cfgMobileWifiHipri = getTetheringConfiguration( Loading @@ -169,7 +169,7 @@ public class TetheringConfigurationTest { @Test public void testDunNotRequiredFromTelephonyManagerMeansNoDun() { when(mTelephonyManager.isTetherApnRequired(anyInt())).thenReturn(false); when(mTelephonyManager.isTetheringApnRequired(anyInt())).thenReturn(false); final TetheringConfiguration cfgWifi = getTetheringConfiguration(TYPE_WIFI); final TetheringConfiguration cfgMobileWifiHipri = getTetheringConfiguration( Loading Loading @@ -212,7 +212,7 @@ public class TetheringConfigurationTest { @Test public void testNoDefinedUpstreamTypesAddsEthernet() { when(mResources.getIntArray(config_tether_upstream_types)).thenReturn(new int[]{}); when(mTelephonyManager.isTetherApnRequired(anyInt())).thenReturn(false); when(mTelephonyManager.isTetheringApnRequired(anyInt())).thenReturn(false); final TetheringConfiguration cfg = new TetheringConfiguration( mMockContext, mLog, INVALID_SUBSCRIPTION_ID); Loading @@ -235,7 +235,7 @@ public class TetheringConfigurationTest { public void testDefinedUpstreamTypesSansEthernetAddsEthernet() { when(mResources.getIntArray(config_tether_upstream_types)).thenReturn( new int[]{TYPE_WIFI, TYPE_MOBILE_HIPRI}); when(mTelephonyManager.isTetherApnRequired(anyInt())).thenReturn(false); when(mTelephonyManager.isTetheringApnRequired(anyInt())).thenReturn(false); final TetheringConfiguration cfg = new TetheringConfiguration( mMockContext, mLog, INVALID_SUBSCRIPTION_ID); Loading @@ -253,7 +253,7 @@ public class TetheringConfigurationTest { public void testDefinedUpstreamTypesWithEthernetDoesNotAddEthernet() { when(mResources.getIntArray(config_tether_upstream_types)) .thenReturn(new int[]{TYPE_WIFI, TYPE_ETHERNET, TYPE_MOBILE_HIPRI}); when(mTelephonyManager.isTetherApnRequired(anyInt())).thenReturn(false); when(mTelephonyManager.isTetheringApnRequired(anyInt())).thenReturn(false); final TetheringConfiguration cfg = new TetheringConfiguration( mMockContext, mLog, INVALID_SUBSCRIPTION_ID); Loading
telephony/java/android/telephony/TelephonyManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -7853,8 +7853,8 @@ public class TelephonyManager { */ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @SystemApi public boolean isTetherApnRequired() { return isTetherApnRequired(getSubId(SubscriptionManager.getActiveDataSubscriptionId())); public boolean isTetheringApnRequired() { return isTetheringApnRequired(getSubId(SubscriptionManager.getActiveDataSubscriptionId())); } /** Loading @@ -7864,11 +7864,11 @@ public class TelephonyManager { * @return {@code true} if DUN APN is required for tethering. * @hide */ public boolean isTetherApnRequired(int subId) { public boolean isTetheringApnRequired(int subId) { try { ITelephony telephony = getITelephony(); if (telephony != null) return telephony.isTetherApnRequiredForSubscriber(subId); return telephony.isTetheringApnRequiredForSubscriber(subId); } catch (RemoteException ex) { Rlog.e(TAG, "hasMatchedTetherApnSetting RemoteException", ex); } catch (NullPointerException ex) { Loading