diff --git a/core/api/test-current.txt b/core/api/test-current.txt index 28b370680df46..72e159cd55026 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -2684,6 +2684,7 @@ package android.telephony { method @NonNull public android.util.Pair getHalVersion(int); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getLine1AlphaTag(); method @Deprecated public android.util.Pair getRadioHalVersion(); + method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDomainSelectionSupported(); method public boolean modifyDevicePolicyOverrideApn(@NonNull android.content.Context, int, @NonNull android.telephony.data.ApnSetting); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void refreshUiccProfile(); method @Deprecated public void setCarrierTestOverride(String, String, String, String, String, String, String); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 5d188b77c5fe3..b53897d293f5c 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -17933,4 +17933,28 @@ public class TelephonyManager { ex.rethrowFromSystemServer(); } } + + /** + * Returns whether the domain selection service is supported. + * + *

Requires Permission: + * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}. + * + * @return {@code true} if the domain selection service is supported. + * @hide + */ + @TestApi + @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + @RequiresFeature(PackageManager.FEATURE_TELEPHONY_CALLING) + public boolean isDomainSelectionSupported() { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.isDomainSelectionSupported(); + } + } catch (RemoteException ex) { + Rlog.w(TAG, "RemoteException", ex); + } + return false; + } } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 33da4549820e3..356d87b061b98 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -2670,4 +2670,11 @@ interface ITelephony { */ void setCellBroadcastIdRanges(int subId, in List ranges, IIntegerConsumer callback); + + /** + * Returns whether the domain selection service is supported. + * + * @return {@code true} if the domain selection service is supported. + */ + boolean isDomainSelectionSupported(); }