diff options
Diffstat (limited to 'src/java/com/android/ims/ImsManager.java')
-rw-r--r-- | src/java/com/android/ims/ImsManager.java | 66 |
1 files changed, 26 insertions, 40 deletions
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java index 3ad6c72e..a01bbbbd 100644 --- a/src/java/com/android/ims/ImsManager.java +++ b/src/java/com/android/ims/ImsManager.java @@ -368,18 +368,16 @@ public class ImsManager { private int mPhoneId; private final boolean mConfigDynamicBind; private @Nullable MmTelFeatureConnection mMmTelFeatureConnection = null; - private ImsServiceDeathRecipient mDeathRecipient = new ImsServiceDeathRecipient(); - // Ut interface for the supplementary service configuration - private ImsUt mUt = null; - // Interface to get/set ims config items - private ImsConfig mConfig = null; private boolean mConfigUpdated = false; private ImsConfigListener mImsConfigListener; + //TODO: Move these caches into the MmTelFeature Connection and restrict their lifetimes to the + // lifetime of the MmTelFeature. + // Ut interface for the supplementary service configuration + private ImsUt mUt = null; // ECBM interface private ImsEcbm mEcbm = null; - private ImsMultiEndpoint mMultiEndpoint = null; private Set<MmTelFeatureConnection.IFeatureUpdate> mStatusCallbacks = @@ -774,7 +772,7 @@ public class ImsManager { log("setVtSetting(b) : imsServiceAllowTurnOff -> turnOffIms"); turnOffIms(); } - } catch (ImsException | RemoteException e) { + } catch (ImsException e) { // The ImsService is down. Since the SubscriptionManager already recorded the user's // preference, it will be resent in updateImsServiceConfig when the ImsPhoneCallTracker // reconnects. @@ -902,7 +900,7 @@ public class ImsManager { } setWfcModeInternal(imsWfcModeFeatureValue); - } catch (ImsException | RemoteException e) { + } catch (ImsException e) { loge("setWfcSetting(): ", e); } } @@ -1301,7 +1299,7 @@ public class ImsManager { } mConfigUpdated = true; - } catch (ImsException | RemoteException e) { + } catch (ImsException e) { loge("updateImsServiceConfig: ", e); mConfigUpdated = false; } @@ -1313,7 +1311,7 @@ public class ImsManager { * @return whether feature is On * @throws ImsException */ - private boolean updateVolteFeatureValue() throws RemoteException { + private boolean updateVolteFeatureValue() throws ImsException { boolean available = isVolteEnabledByPlatform(); boolean enabled = isEnhanced4gLteModeSettingEnabledByUser(); boolean isNonTty = isNonTtyOrTtyOnVolteEnabled(); @@ -1334,7 +1332,7 @@ public class ImsManager { * @return whether feature is On * @throws ImsException */ - private boolean updateVideoCallFeatureValue() throws RemoteException { + private boolean updateVideoCallFeatureValue() throws ImsException { boolean available = isVtEnabledByPlatform(); boolean enabled = isVtEnabledByUser(); boolean isNonTty = isNonTtyOrTtyOnVolteEnabled(); @@ -1361,7 +1359,7 @@ public class ImsManager { * @return whether feature is On * @throws ImsException */ - private boolean updateWfcFeatureAndProvisionedValues() throws RemoteException { + private boolean updateWfcFeatureAndProvisionedValues() throws ImsException { TelephonyManager tm = new TelephonyManager(mContext, getSubId()); boolean isNetworkRoaming = tm.isNetworkRoaming(); boolean available = isWfcEnabledByPlatform(); @@ -1652,7 +1650,6 @@ public class ImsManager { mMmTelFeatureConnection.closeConnection(); } mUt = null; - mConfig = null; mEcbm = null; mMultiEndpoint = null; } @@ -1801,41 +1798,44 @@ public class ImsManager { * @throws ImsException if getting the setting interface results in an error. */ public ImsConfig getConfigInterface() throws ImsException { - if (mConfig != null && mConfig.isBinderAlive()) { - return mConfig; - } - checkAndThrowExceptionIfServiceUnavailable(); + try { IImsConfig config = mMmTelFeatureConnection.getConfigInterface(); if (config == null) { throw new ImsException("getConfigInterface()", ImsReasonInfo.CODE_LOCAL_SERVICE_UNAVAILABLE); } - mConfig = new ImsConfig(config, mContext); + return new ImsConfig(config); } catch (RemoteException e) { throw new ImsException("getConfigInterface()", e, ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); } - return mConfig; } public void changeMmTelCapability( @MmTelFeature.MmTelCapabilities.MmTelCapability int capability, @ImsRegistrationImplBase.ImsRegistrationTech int radioTech, - boolean isEnabled) throws RemoteException { + boolean isEnabled) throws ImsException { + checkAndThrowExceptionIfServiceUnavailable(); + CapabilityChangeRequest request = new CapabilityChangeRequest(); if (isEnabled) { request.addCapabilitiesToEnableForTech(capability, radioTech); } else { request.addCapabilitiesToDisableForTech(capability, radioTech); } - mMmTelFeatureConnection.changeEnabledCapabilities(request, null); - if (mImsConfigListener != null) { - mImsConfigListener.onSetFeatureResponse(capability, - mMmTelFeatureConnection.getRegistrationTech(), - isEnabled ? ImsConfig.FeatureValueConstants.ON - : ImsConfig.FeatureValueConstants.OFF, -1); + try { + mMmTelFeatureConnection.changeEnabledCapabilities(request, null); + if (mImsConfigListener != null) { + mImsConfigListener.onSetFeatureResponse(capability, + mMmTelFeatureConnection.getRegistrationTech(), + isEnabled ? ImsConfig.FeatureValueConstants.ON + : ImsConfig.FeatureValueConstants.OFF, -1); + } + } catch (RemoteException e) { + throw new ImsException("changeMmTelCapability()", e, + ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); } } @@ -2150,20 +2150,6 @@ public class ImsManager { } /** - * Death recipient class for monitoring IMS service. - */ - private class ImsServiceDeathRecipient implements IBinder.DeathRecipient { - @Override - public void binderDied() { - mMmTelFeatureConnection = null; - mUt = null; - mConfig = null; - mEcbm = null; - mMultiEndpoint = null; - } - } - - /** * Gets the ECBM interface to request ECBM exit. * * @return the ECBM interface instance |