Force IMS to register over LTE when turning off WFC
Pavel Zhamaitsiak [Mon, 16 Mar 2015 22:30:53 +0000 (15:30 -0700)]
Bug: 19697174
Change-Id: I4b1538052f4bc2bf5d7c55f78467c6c52b49efd8

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

index 5443533..ed1a43a 100644 (file)
@@ -324,6 +324,11 @@ public class ImsManager {
                     log("setWfcSetting() : imsServiceAllowTurnOff -> turnOffIms");
                     imsManager.turnOffIms();
                 }
+
+                // Force IMS to register over LTE when turning off WFC
+                setWfcModeInternal(context, enabled
+                        ? getWfcMode(context)
+                        : ImsConfig.WfcModeFeatureValueConstants.CELLULAR_PREFERRED);
             } catch (ImsException e) {
                 loge("setWfcSetting(): " + e);
             }
@@ -349,6 +354,10 @@ public class ImsManager {
         android.provider.Settings.Global.putInt(context.getContentResolver(),
                 android.provider.Settings.Global.WFC_IMS_MODE, wfcMode);
 
+        setWfcModeInternal(context, wfcMode);
+    }
+
+    private static void setWfcModeInternal(Context context, int wfcMode) {
         final ImsManager imsManager = ImsManager.getInstance(context,
                 SubscriptionManager.getDefaultVoicePhoneId());
         if (imsManager != null) {