diff options
| author | 2020-12-29 00:24:12 +0000 | |
|---|---|---|
| committer | 2020-12-29 00:24:12 +0000 | |
| commit | cdf7105f72ec991d8f0667e1f2d3e9e62bb2374c (patch) | |
| tree | c4a5ceb0af80fc7bdbeed589077948bb940a4ecb | |
| parent | d93844466790cad074214b46dd897164e81d5ccb (diff) | |
| parent | 228306b008a97eab6841a1cb9c93b750f2e18bb2 (diff) | |
Merge "Create getMobileProvisioningUrl in telephony"
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 29 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 6 |
2 files changed, 35 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 0e0644488f77..7d3cef559672 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -9275,6 +9275,35 @@ public class TelephonyManager { } /** + * Get the mobile provisioning url that is used to launch a browser to allow users to manage + * their mobile plan. + * + * <p>Requires Permission: + * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE}. + * + * TODO: The legacy design only supports single sim design. Ideally, this should support + * multi-sim design in current world. + * + * {@hide} + */ + @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + public @Nullable String getMobileProvisioningUrl() { + try { + final ITelephony service = getITelephony(); + if (service != null) { + return service.getMobileProvisioningUrl(); + } else { + throw new IllegalStateException("telephony service is null."); + } + } catch (RemoteException ex) { + if (!isSystemProcess()) { + ex.rethrowAsRuntimeException(); + } + } + return null; + } + + /** * Turns mobile data on or off. * If this object has been created with {@link #createForSubscriptionId}, applies to the given * subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 7c5047c2deaf..33acc159e18a 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -2352,4 +2352,10 @@ interface ITelephony { * Gets the config of RCS VoLTE single registration enabled for the carrier/subscription. */ boolean getCarrierSingleRegistrationEnabled(int subId); + + /** + * Return the mobile provisioning url that is used to launch a browser to allow users to manage + * their mobile plan. + */ + String getMobileProvisioningUrl(); } |