Merge "Added new slot status related broadcast."
diff --git a/api/system-current.txt b/api/system-current.txt
index 306a573..97f82e9 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -794,8 +794,6 @@
field public static final java.lang.String ACTION_QUERY_PACKAGE_RESTART = "android.intent.action.QUERY_PACKAGE_RESTART";
field public static final java.lang.String ACTION_RESOLVE_INSTANT_APP_PACKAGE = "android.intent.action.RESOLVE_INSTANT_APP_PACKAGE";
field public static final java.lang.String ACTION_REVIEW_PERMISSIONS = "android.intent.action.REVIEW_PERMISSIONS";
- field public static final java.lang.String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.intent.action.SIM_APPLICATION_STATE_CHANGED";
- field public static final java.lang.String ACTION_SIM_CARD_STATE_CHANGED = "android.intent.action.SIM_CARD_STATE_CHANGED";
field public static final deprecated java.lang.String ACTION_SIM_STATE_CHANGED = "android.intent.action.SIM_STATE_CHANGED";
field public static final java.lang.String ACTION_UPGRADE_SETUP = "android.intent.action.UPGRADE_SETUP";
field public static final java.lang.String ACTION_USER_REMOVED = "android.intent.action.USER_REMOVED";
@@ -4527,6 +4525,9 @@
method public int[] supplyPukReportResult(java.lang.String, java.lang.String);
method public void toggleRadioOnOff();
method public void updateServiceLocation();
+ field public static final java.lang.String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
+ field public static final java.lang.String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
+ field public static final java.lang.String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index f05a4d1..ef1bcb0 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -3525,74 +3525,6 @@
public static final String ACTION_SIM_STATE_CHANGED = "android.intent.action.SIM_STATE_CHANGED";
/**
- * Broadcast Action: The sim card state has changed.
- * The intent will have the following extra values:</p>
- * <dl>
- * <dt>{@link android.telephony.TelephonyManager.EXTRA_SIM_STATE}</dt>
- * <dd>The sim card state. One of:
- * <dl>
- * <dt>{@link android.telephony.TelephonyManager.SIM_STATE_ABSENT}</dt>
- * <dd>SIM card not found</dd>
- * <dt>{@link android.telephony.TelephonyManager.SIM_STATE_CARD_IO_ERROR}</dt>
- * <dd>SIM card IO error</dd>
- * <dt>{@link android.telephony.TelephonyManager.SIM_STATE_CARD_RESTRICTED}</dt>
- * <dd>SIM card is restricted</dd>
- * <dt>{@link android.telephony.TelephonyManager.SIM_STATE_PRESENT}</dt>
- * <dd>SIM card is present</dd>
- * </dl>
- * </dd>
- * </dl>
- *
- * <p class="note">Requires the READ_PRIVILEGED_PHONE_STATE permission.
- *
- * <p class="note">The current state can also be queried using
- * {@link android.telephony.TelephonyManager.getSimCardState()}
- *
- * <p class="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_SIM_CARD_STATE_CHANGED =
- "android.intent.action.SIM_CARD_STATE_CHANGED";
-
- /**
- * Broadcast Action: The sim application state has changed.
- * The intent will have the following extra values:</p>
- * <dl>
- * <dt>{@link android.telephony.TelephonyManager.EXTRA_SIM_STATE}</dt>
- * <dd>The sim application state. One of:
- * <dl>
- * <dt>{@link android.telephony.TelephonyManager.SIM_STATE_NOT_READY}</dt>
- * <dd>SIM card applications not ready</dd>
- * <dt>{@link android.telephony.TelephonyManager.SIM_STATE_PIN_REQUIRED}</dt>
- * <dd>SIM card PIN locked</dd>
- * <dt>{@link android.telephony.TelephonyManager.SIM_STATE_PUK_REQUIRED}</dt>
- * <dd>SIM card PUK locked</dd>
- * <dt>{@link android.telephony.TelephonyManager.SIM_STATE_NETWORK_LOCKED}</dt>
- * <dd>SIM card network locked</dd>
- * <dt>{@link android.telephony.TelephonyManager.SIM_STATE_PERM_DISABLED}</dt>
- * <dd>SIM card permanently disabled due to PUK failures</dd>
- * <dt>{@link android.telephony.TelephonyManager.SIM_STATE_LOADED}</dt>
- * <dd>SIM card data loaded</dd>
- * </dl>
- * </dd>
- * </dl>
- *
- * <p class="note">Requires the READ_PRIVILEGED_PHONE_STATE permission.
- *
- * <p class="note">The current state can also be queried using
- * {@link android.telephony.TelephonyManager.getSimApplicationState()}
- *
- * <p class="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_SIM_APPLICATION_STATE_CHANGED =
- "android.intent.action.SIM_APPLICATION_STATE_CHANGED";
-
- /**
* Broadcast Action: indicate that the phone service state has changed.
* The intent will have the following extra values:</p>
* <p>
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 17f809d..e33b25e 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -2136,8 +2136,8 @@
public static final int SIM_STATE_PRESENT = 11;
/**
- * Extra included in {@link Intent.ACTION_SIM_CARD_STATE_CHANGED} and
- * {@link Intent.ACTION_SIM_APPLICATION_STATE_CHANGED} to indicate the card/application state.
+ * Extra included in {@link #ACTION_SIM_CARD_STATE_CHANGED} and
+ * {@link #ACTION_SIM_APPLICATION_STATE_CHANGED} to indicate the card/application state.
*
* @hide
*/
@@ -2145,6 +2145,89 @@
public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
/**
+ * Broadcast Action: The sim card state has changed.
+ * The intent will have the following extra values:</p>
+ * <dl>
+ * <dt>{@link #EXTRA_SIM_STATE}</dt>
+ * <dd>The sim card state. One of:
+ * <dl>
+ * <dt>{@link #SIM_STATE_ABSENT}</dt>
+ * <dd>SIM card not found</dd>
+ * <dt>{@link #SIM_STATE_CARD_IO_ERROR}</dt>
+ * <dd>SIM card IO error</dd>
+ * <dt>{@link #SIM_STATE_CARD_RESTRICTED}</dt>
+ * <dd>SIM card is restricted</dd>
+ * <dt>{@link #SIM_STATE_PRESENT}</dt>
+ * <dd>SIM card is present</dd>
+ * </dl>
+ * </dd>
+ * </dl>
+ *
+ * <p class="note">Requires the READ_PRIVILEGED_PHONE_STATE permission.
+ *
+ * <p class="note">The current state can also be queried using {@link #getSimCardState()}.
+ *
+ * <p class="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_SIM_CARD_STATE_CHANGED =
+ "android.telephony.action.SIM_CARD_STATE_CHANGED";
+
+ /**
+ * Broadcast Action: The sim application state has changed.
+ * The intent will have the following extra values:</p>
+ * <dl>
+ * <dt>{@link #EXTRA_SIM_STATE}</dt>
+ * <dd>The sim application state. One of:
+ * <dl>
+ * <dt>{@link #SIM_STATE_NOT_READY}</dt>
+ * <dd>SIM card applications not ready</dd>
+ * <dt>{@link #SIM_STATE_PIN_REQUIRED}</dt>
+ * <dd>SIM card PIN locked</dd>
+ * <dt>{@link #SIM_STATE_PUK_REQUIRED}</dt>
+ * <dd>SIM card PUK locked</dd>
+ * <dt>{@link #SIM_STATE_NETWORK_LOCKED}</dt>
+ * <dd>SIM card network locked</dd>
+ * <dt>{@link #SIM_STATE_PERM_DISABLED}</dt>
+ * <dd>SIM card permanently disabled due to PUK failures</dd>
+ * <dt>{@link #SIM_STATE_LOADED}</dt>
+ * <dd>SIM card data loaded</dd>
+ * </dl>
+ * </dd>
+ * </dl>
+ *
+ * <p class="note">Requires the READ_PRIVILEGED_PHONE_STATE permission.
+ *
+ * <p class="note">The current state can also be queried using
+ * {@link #getSimApplicationState()}.
+ *
+ * <p class="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_SIM_APPLICATION_STATE_CHANGED =
+ "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
+
+ /**
+ * Broadcast Action: Status of the SIM slots on the device has changed.
+ *
+ * <p class="note">Requires the READ_PRIVILEGED_PHONE_STATE permission.
+ *
+ * <p class="note">The status can be queried using
+ * {@link #getUiccSlotsInfo()}
+ *
+ * <p class="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_SIM_SLOT_STATUS_CHANGED =
+ "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
+
+ /**
* @return true if a ICC card is present
*/
public boolean hasIccCard() {