Merge "Add ims registration status"
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 5b2892b..3c841a4 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -1500,6 +1500,14 @@
public static final String IMSI_KEY_EXPIRATION_DAYS_TIME_INT =
"imsi_key_expiration_days_time_int";
+ /**
+ * Flag specifying whether IMS registration state menu is shown in Status Info setting,
+ * default to false.
+ * @hide
+ */
+ public static final String KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL =
+ "show_ims_registration_status_bool";
+
/** The default value for every variable. */
private final static PersistableBundle sDefaults;
@@ -1752,6 +1760,7 @@
sDefaults.putStringArray(KEY_ROAMING_OPERATOR_STRING_ARRAY, null);
sDefaults.putInt(IMSI_KEY_EXPIRATION_DAYS_TIME_INT, IMSI_ENCRYPTION_DAYS_TIME_DISABLED);
sDefaults.putString(IMSI_KEY_DOWNLOAD_URL_STRING, null);
+ sDefaults.putBoolean(KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL, false);
}
/**
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 2b4991f..4edb069 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -5796,6 +5796,25 @@
}
/**
+ * Returns the IMS Registration Status for a particular Subscription ID
+ *
+ * @param subId Subscription ID
+ * @return true if IMS status is registered, false if the IMS status is not registered or a
+ * RemoteException occurred.
+ *
+ * @hide
+ */
+ public boolean isImsRegistered(int subId) {
+ try {
+ return getITelephony().isImsRegisteredForSubscriber(subId);
+ } catch (RemoteException ex) {
+ return false;
+ } catch (NullPointerException ex) {
+ return false;
+ }
+ }
+
+ /**
* Returns the Status of Volte
* @hide
*/
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index ab7c5e7..0dd846e 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -1080,6 +1080,15 @@
boolean isImsRegistered();
/**
+ * Get IMS Registration Status on a particular subid.
+ *
+ * @param subId user preferred subId.
+ *
+ * @return {@code true} if the IMS status is registered.
+ */
+ boolean isImsRegisteredForSubscriber(int subId);
+
+ /**
* Returns the Status of Wi-Fi Calling
*/
boolean isWifiCallingAvailable();