diff options
| author | 2020-10-01 19:08:19 +0000 | |
|---|---|---|
| committer | 2020-10-01 19:08:19 +0000 | |
| commit | ed1d2560ff012b717ba133b19b7c0f265eb647e8 (patch) | |
| tree | 38992646cca17981148fe4e1674aab2835e0d96a | |
| parent | 11b68dfbe3173ef216c202eea1bfc4f1d0c822d0 (diff) | |
| parent | ee052afb4f928519831fbcfb61d60df8a21d5df7 (diff) | |
Merge "Added getEquivalentHomePlmns API" am: 6c541722ff am: ee052afb4f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1441700
Change-Id: I61089b3173ea142e8517eacaf64e1e69ebc83275
| -rwxr-xr-x | api/system-current.txt | 1 | ||||
| -rw-r--r-- | non-updatable-api/system-current.txt | 1 | ||||
| -rw-r--r-- | telephony/api/system-current.txt | 1 | ||||
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 34 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 8 |
5 files changed, 45 insertions, 0 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 6d13582bb49d..ddf9c4d97e6f 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -11188,6 +11188,7 @@ package android.telephony { method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDeviceSoftwareVersion(int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEmergencyNumberDbVersion(); + method @NonNull @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<java.lang.String> getEquivalentHomePlmns(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst(); method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping(); diff --git a/non-updatable-api/system-current.txt b/non-updatable-api/system-current.txt index 419d40185655..b67c22c27cb8 100644 --- a/non-updatable-api/system-current.txt +++ b/non-updatable-api/system-current.txt @@ -10070,6 +10070,7 @@ package android.telephony { method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDeviceSoftwareVersion(int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEmergencyNumberDbVersion(); + method @NonNull @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<java.lang.String> getEquivalentHomePlmns(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst(); method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping(); diff --git a/telephony/api/system-current.txt b/telephony/api/system-current.txt index ac88560dbbd9..ddc608413db8 100644 --- a/telephony/api/system-current.txt +++ b/telephony/api/system-current.txt @@ -660,6 +660,7 @@ package android.telephony { method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDeviceSoftwareVersion(int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEmergencyNumberDbVersion(); + method @NonNull @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<java.lang.String> getEquivalentHomePlmns(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst(); method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 85dca2b4e9b3..66eadb5f71e0 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -13388,4 +13388,38 @@ public class TelephonyManager { return true; } } + + /** + * Returns a list of the equivalent home PLMNs (EF_EHPLMN) from the USIM app. + * + * <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} + * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}). + * + * @return A list of equivalent home PLMNs. Returns an empty list if EF_EHPLMN is empty or + * does not exist on the SIM card. + * + * @throws IllegalStateException if the Telephony process is not currently available. + * @throws SecurityException if the caller doesn't have the permission. + * + * @hide + */ + @SystemApi + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) + public @NonNull List<String> getEquivalentHomePlmns() { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.getEquivalentHomePlmns(getSubId(), mContext.getOpPackageName(), + getAttributionTag()); + } else { + throw new IllegalStateException("telephony service is null."); + } + } catch (RemoteException ex) { + if (!isSystemProcess()) { + ex.rethrowAsRuntimeException(); + } + } + + return Collections.emptyList(); + } } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index ae1b5c1b50bd..659d9cd38faf 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -2297,4 +2297,12 @@ interface ITelephony { * Whether device can connect to 5G network when two SIMs are active. */ boolean canConnectTo5GInDsdsMode(); + + /** + * Returns a list of the equivalent home PLMNs (EF_EHPLMN) from the USIM app. + * + * @return A list of equivalent home PLMNs. Returns an empty list if EF_EHPLMN is empty or + * does not exist on the SIM card. + */ + List<String> getEquivalentHomePlmns(int subId, String callingPackage, String callingFeatureId); } |