Added a broadcast intent for clients to listen for country changes

Added a broadcast intent ACTION_NETWORK_COUNTRY_CHANGED for clients
to listen for network country code changes. The same value can be
retrieved from TelephonyManager.getNetworkCountryIso().

Test: Manual + unit tests
Bug: 122900588
Change-Id: Ifec87dda7bae386118b7bc7523844342bd16c3ea
This commit is contained in:
Jack Yu
2019-01-25 14:50:15 -08:00
parent 84f1cc60fd
commit 3d33698bf5
2 changed files with 24 additions and 0 deletions

View File

@@ -44848,6 +44848,7 @@ package android.telephony {
method @Deprecated public void setVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle, boolean); method @Deprecated public void setVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle, boolean);
method public boolean updateAvailableNetworks(java.util.List<android.telephony.AvailableNetworkInfo>); method public boolean updateAvailableNetworks(java.util.List<android.telephony.AvailableNetworkInfo>);
field public static final String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL"; field public static final String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL";
field public static final String ACTION_NETWORK_COUNTRY_CHANGED = "android.telephony.action.NETWORK_COUNTRY_CHANGED";
field @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE"; field @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
field public static final String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE"; field public static final String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE";
field public static final String ACTION_SECRET_CODE = "android.telephony.action.SECRET_CODE"; field public static final String ACTION_SECRET_CODE = "android.telephony.action.SECRET_CODE";
@@ -44886,6 +44887,7 @@ package android.telephony {
field public static final String EXTRA_INCOMING_NUMBER = "incoming_number"; field public static final String EXTRA_INCOMING_NUMBER = "incoming_number";
field public static final String EXTRA_IS_REFRESH = "android.telephony.extra.IS_REFRESH"; field public static final String EXTRA_IS_REFRESH = "android.telephony.extra.IS_REFRESH";
field public static final String EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT = "android.telephony.extra.LAUNCH_VOICEMAIL_SETTINGS_INTENT"; field public static final String EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT = "android.telephony.extra.LAUNCH_VOICEMAIL_SETTINGS_INTENT";
field public static final String EXTRA_NETWORK_COUNTRY = "android.telephony.extra.NETWORK_COUNTRY";
field public static final String EXTRA_NOTIFICATION_COUNT = "android.telephony.extra.NOTIFICATION_COUNT"; field public static final String EXTRA_NOTIFICATION_COUNT = "android.telephony.extra.NOTIFICATION_COUNT";
field public static final String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telephony.extra.PHONE_ACCOUNT_HANDLE"; field public static final String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telephony.extra.PHONE_ACCOUNT_HANDLE";
field public static final String EXTRA_PRECISE_CARRIER_ID = "android.telephony.extra.PRECISE_CARRIER_ID"; field public static final String EXTRA_PRECISE_CARRIER_ID = "android.telephony.extra.PRECISE_CARRIER_ID";

View File

@@ -10133,4 +10133,26 @@ public class TelephonyManager {
} }
return ret; return ret;
} }
/**
* Broadcast intent action for network country code changes.
*
* <p>
* The {@link #EXTRA_NETWORK_COUNTRY} extra indicates the country code of the current
* network returned by {@link #getNetworkCountryIso()}.
*
* @see #EXTRA_NETWORK_COUNTRY
* @see #getNetworkCountryIso()
*/
public static final String ACTION_NETWORK_COUNTRY_CHANGED =
"android.telephony.action.NETWORK_COUNTRY_CHANGED";
/**
* The extra used with an {@link #ACTION_NETWORK_COUNTRY_CHANGED} to specify the
* the country code in ISO 3166 format.
* <p class="note">
* Retrieve with {@link android.content.Intent#getStringExtra(String)}.
*/
public static final String EXTRA_NETWORK_COUNTRY =
"android.telephony.extra.NETWORK_COUNTRY";
} }