am e7663c09: Update ImsManager to use carrier configs.
Junda Liu [Thu, 25 Jun 2015 19:16:46 +0000 (19:16 +0000)]
* commit 'e7663c09acfdfa34d423be3c1ac7fecf2eb5e3e1':
  Update ImsManager to use carrier configs.

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

@@@ -955,25 -920,22 +975,25 @@@ public class ImsManager 
      private void setAdvanced4GMode(boolean turnOn) throws ImsException {
          checkAndThrowExceptionIfServiceUnavailable();
  
 -        ImsConfig config = getConfigInterface();
 -        if (config != null) {
 -            config.setFeatureValue(ImsConfig.FeatureConstants.FEATURE_TYPE_VOICE_OVER_LTE,
 -                    TelephonyManager.NETWORK_TYPE_LTE, turnOn ? 1 : 0, null);
 -            if (isVtEnabledByPlatform(mContext)) {
 -                // TODO: once VT is available on platform replace the '1' with the current
 -                // user configuration of VT.
 -                config.setFeatureValue(ImsConfig.FeatureConstants.FEATURE_TYPE_VIDEO_OVER_LTE,
 +        try {
 +            ImsConfig config = getConfigInterface();
 +            if (config != null) {
 +                config.setFeatureValue(ImsConfig.FeatureConstants.FEATURE_TYPE_VOICE_OVER_LTE,
                          TelephonyManager.NETWORK_TYPE_LTE, turnOn ? 1 : 0, null);
 +                if (isVtEnabledByPlatform(mContext)) {
 +                    // TODO: once VT is available on platform replace the '1' with the current
 +                    // user configuration of VT.
 +                    config.setFeatureValue(ImsConfig.FeatureConstants.FEATURE_TYPE_VIDEO_OVER_LTE,
 +                            TelephonyManager.NETWORK_TYPE_LTE, turnOn ? 1 : 0, null);
 +                }
              }
 +        } catch (ImsException e) {
 +            log("setAdvanced4GMode() : " + e);
          }
 -
          if (turnOn) {
              turnOnIms();
-         } else if (mContext.getResources().getBoolean(
-                 com.android.internal.R.bool.imsServiceAllowTurnOff)
+         } else if (getBooleanCarrierConfig(mContext,
+                 CarrierConfigManager.KEY_CARRIER_ALLOW_TURNOFF_IMS_BOOL)
                  && (!isWfcEnabledByPlatform(mContext)
                  || !isWfcEnabledByUser(mContext))) {
              log("setAdvanced4GMode() : imsServiceAllowTurnOff -> turnOffIms");