diff options
author | Omkar Kolangade <omkark@codeaurora.org> | 2014-10-24 11:10:52 -0700 |
---|---|---|
committer | Pavel Zhamaitsiak <pavelz@google.com> | 2015-08-05 12:06:07 -0700 |
commit | 75f3ca3a51c8d16dbb83af1cfcc151ec596dc5f5 (patch) | |
tree | ad7dccdcb9d41644c1c10180a3c3dabd29523dd4 | |
parent | 3a99f7878b7f4fb49f3f383272b7ba56b99904ee (diff) | |
download | ims-marshmallow-dev.tar.gz |
Fix unncessary IMS re-registration with networkmarshmallow-dev
When entire IMS stack turn off is going to follow the IMS
re-registration request for a specific service, there is an
unncessary overhead with extra signalling during the process of
re-registration. Also this delays the IMS turn off process.
Fixed by not performing a setFeatureValue operation for a service
turn off when the configuration allows for entire IMS stack to
be turned off.
Add Exception Handling To setAdvanced4GMode API
Bug: 22717994
Bug: 21800429
Change-Id: Ic5d7c54802818de5c8e241cacce62feb02629743
-rw-r--r-- | src/java/com/android/ims/ImsManager.java | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java index eb78fd01..47d1405a 100644 --- a/src/java/com/android/ims/ImsManager.java +++ b/src/java/com/android/ims/ImsManager.java @@ -915,27 +915,36 @@ public class ImsManager { } } + private boolean isImsTurnOffAllowed() { + return getBooleanCarrierConfig(mContext, + CarrierConfigManager.KEY_CARRIER_ALLOW_TURNOFF_IMS_BOOL) + && (!isWfcEnabledByPlatform(mContext) + || !isWfcEnabledByUser(mContext)); + } + 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 && (turnOn || !isImsTurnOffAllowed())) { + 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. + // - separate exception checks for setFeatureValue() failures for VoLTE and VT. + // I.e. if VoLTE fails still try to configure 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 (getBooleanCarrierConfig(mContext, - CarrierConfigManager.KEY_CARRIER_ALLOW_TURNOFF_IMS_BOOL) - && (!isWfcEnabledByPlatform(mContext) - || !isWfcEnabledByUser(mContext))) { + } else if (isImsTurnOffAllowed()) { log("setAdvanced4GMode() : imsServiceAllowTurnOff -> turnOffIms"); turnOffIms(); } |