diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 0e0644488f77f..7d3cef5596720 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -9274,6 +9274,35 @@ public class TelephonyManager { return false; } + /** + * Get the mobile provisioning url that is used to launch a browser to allow users to manage + * their mobile plan. + * + *
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 diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 7c5047c2deaff..33acc159e18ac 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(); }