Merge "ImsManager: check roaming status in setWfcSetting" into nyc-mr2-dev
Meng Wang [Wed, 23 Nov 2016 00:29:28 +0000 (00:29 +0000)]
src/java/com/android/ims/ImsManager.java

index aeb7ae6..464aeed 100644 (file)
@@ -445,9 +445,12 @@ public class ImsManager {
                     imsManager.turnOffIms();
                 }
 
-                // Force IMS to register over LTE when turning off WFC
+                TelephonyManager tm = (TelephonyManager) context
+                        .getSystemService(Context.TELEPHONY_SERVICE);
                 setWfcModeInternal(context, enabled
-                        ? getWfcMode(context)
+                        // Choose wfc mode per current roaming preference
+                        ? getWfcMode(context, tm.isNetworkRoaming())
+                        // Force IMS to register over LTE when turning off WFC
                         : ImsConfig.WfcModeFeatureValueConstants.CELLULAR_PREFERRED);
             } catch (ImsException e) {
                 loge("setWfcSetting(): ", e);