From 60f64be600b9c2ccd1fd24113e0a1b3abbd4d1a2 Mon Sep 17 00:00:00 2001 From: Meng Wang Date: Tue, 21 Jan 2020 15:29:06 -0800 Subject: [PATCH] Expose system API ACTION_SERVICE_PROVIDERS_UPDATED So other system apps can use it. Bug: 147921202 Test: make Merged-In: Iab7842f8f91d572a750b95724d10060bc642a532 Change-Id: Iab7842f8f91d572a750b95724d10060bc642a532 --- api/system-current.txt | 6 ++ .../android/telephony/TelephonyManager.java | 74 +++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/api/system-current.txt b/api/system-current.txt index 132956b0e3b02..c46d11a5c7614 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -9375,6 +9375,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateTestOtaEmergencyNumberDbFilePath(@NonNull String); field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final String ACTION_ANOMALY_REPORTED = "android.telephony.action.ANOMALY_REPORTED"; field public static final String ACTION_EMERGENCY_ASSISTANCE = "android.telephony.action.EMERGENCY_ASSISTANCE"; + field public static final String ACTION_SERVICE_PROVIDERS_UPDATED = "android.telephony.action.SERVICE_PROVIDERS_UPDATED"; field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED"; field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED"; field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED"; @@ -9387,7 +9388,12 @@ package android.telephony { field public static final int CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED = -1; // 0xffffffff field public static final String EXTRA_ANOMALY_DESCRIPTION = "android.telephony.extra.ANOMALY_DESCRIPTION"; field public static final String EXTRA_ANOMALY_ID = "android.telephony.extra.ANOMALY_ID"; + field public static final String EXTRA_DATA_SPN = "android.telephony.extra.DATA_SPN"; + field public static final String EXTRA_PLMN = "android.telephony.extra.PLMN"; + field public static final String EXTRA_SHOW_PLMN = "android.telephony.extra.SHOW_PLMN"; + field public static final String EXTRA_SHOW_SPN = "android.telephony.extra.SHOW_SPN"; field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE"; + field public static final String EXTRA_SPN = "android.telephony.extra.SPN"; field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL"; field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING"; field public static final int INVALID_EMERGENCY_NUMBER_DB_VERSION = -1; // 0xffffffff diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index ef631b8a05dcd..54dddc04f6e77 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1221,6 +1221,80 @@ public class TelephonyManager { */ public static final String EXTRA_SUBSCRIPTION_ID = "android.telephony.extra.SUBSCRIPTION_ID"; + /** + * Broadcast Action: The Service Provider string(s) have been updated. Activities or + * services that use these strings should update their display. + * + *

The intent will have the following extra values: + *

+ *
{@link #EXTRA_SHOW_PLMN}
+ *
Boolean that indicates whether the PLMN should be shown.
+ *
{@link #EXTRA_PLMN}
+ *
The operator name of the registered network, as a string.
+ *
{@link #EXTRA_SHOW_SPN}
+ *
Boolean that indicates whether the SPN should be shown.
+ *
{@link #EXTRA_SPN}
+ *
The service provider name, as a string.
+ *
{@link #EXTRA_DATA_SPN}
+ *
The service provider name for data service, as a string.
+ *
+ * + * Note that {@link #EXTRA_SHOW_PLMN} may indicate that {@link #EXTRA_PLMN} should be displayed, + * even though the value for {@link #EXTRA_PLMN} is null. This can happen, for example, if the + * phone has not registered to a network yet. In this case the receiver may substitute an + * appropriate placeholder string (eg, "No service"). + * + * It is recommended to display {@link #EXTRA_PLMN} before / above {@link #EXTRA_SPN} if + * both are displayed. + * + *

Note: this is a protected intent that can only be sent by the system. + * @hide + */ + @SystemApi + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_SERVICE_PROVIDERS_UPDATED = + "android.telephony.action.SERVICE_PROVIDERS_UPDATED"; + + /** + * String intent extra to be used with {@link ACTION_SERVICE_PROVIDERS_UPDATED} to indicate + * whether the PLMN should be shown. + * @hide + */ + @SystemApi + public static final String EXTRA_SHOW_PLMN = "android.telephony.extra.SHOW_PLMN"; + + /** + * String intent extra to be used with {@link ACTION_SERVICE_PROVIDERS_UPDATED} to indicate + * the operator name of the registered network. + * @hide + */ + @SystemApi + public static final String EXTRA_PLMN = "android.telephony.extra.PLMN"; + + /** + * String intent extra to be used with {@link ACTION_SERVICE_PROVIDERS_UPDATED} to indicate + * whether the PLMN should be shown. + * @hide + */ + @SystemApi + public static final String EXTRA_SHOW_SPN = "android.telephony.extra.SHOW_SPN"; + + /** + * String intent extra to be used with {@link ACTION_SERVICE_PROVIDERS_UPDATED} to indicate + * the service provider name. + * @hide + */ + @SystemApi + public static final String EXTRA_SPN = "android.telephony.extra.SPN"; + + /** + * String intent extra to be used with {@link ACTION_SERVICE_PROVIDERS_UPDATED} to indicate + * the service provider name for data service. + * @hide + */ + @SystemApi + public static final String EXTRA_DATA_SPN = "android.telephony.extra.DATA_SPN"; + /** * Broadcast intent action indicating that when data stall recovery is attempted by Telephony, * intended for report every data stall recovery step attempted.