Don't disable IMS if SIM is not ready
Pavel Zhamaitsiak [Wed, 30 Mar 2016 01:07:38 +0000 (18:07 -0700)]
Bug: 27904215
Change-Id: Ieb2688bb8bc4916c28d1e7d8a48f7bdc854582cb

src/java/com/android/ims/ImsManager.java

index a21af77..ba81d54 100644 (file)
@@ -543,6 +543,14 @@ public class ImsManager {
      * @param force update
      */
     public static void updateImsServiceConfig(Context context, int phoneId, boolean force) {
+        if (!force) {
+            if (TelephonyManager.getDefault().getSimState() != TelephonyManager.SIM_STATE_READY) {
+                log("updateImsServiceConfig: SIM not ready");
+                // Don't disable IMS if SIM is not ready
+                return;
+            }
+        }
+
         final ImsManager imsManager = ImsManager.getInstance(context, phoneId);
         if (imsManager != null && (!imsManager.mConfigUpdated || force)) {
             try {