Add a TestApi, TelephonyManager#isDomainSelectionSupported

To check whether the domain selection service is supported.

Bug: 243344927
Test: atest EmergencyCallDomainSelectionTestOnMockModem
Change-Id: I7d5397d3765eba8ceaa4f65c688ac327eee95aba
This commit is contained in:
Hunsuk Choi
2022-10-16 06:01:12 +00:00
parent d70ac512e9
commit 9854fdc30e
3 changed files with 32 additions and 0 deletions

View File

@@ -2684,6 +2684,7 @@ package android.telephony {
method @NonNull public android.util.Pair<java.lang.Integer,java.lang.Integer> getHalVersion(int);
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getLine1AlphaTag();
method @Deprecated public android.util.Pair<java.lang.Integer,java.lang.Integer> 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);

View File

@@ -17933,4 +17933,28 @@ public class TelephonyManager {
ex.rethrowFromSystemServer();
}
}
/**
* Returns whether the domain selection service is supported.
*
* <p>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;
}
}

View File

@@ -2670,4 +2670,11 @@ interface ITelephony {
*/
void setCellBroadcastIdRanges(int subId, in List<CellBroadcastIdRange> ranges,
IIntegerConsumer callback);
/**
* Returns whether the domain selection service is supported.
*
* @return {@code true} if the domain selection service is supported.
*/
boolean isDomainSelectionSupported();
}