From e63b35d0b22db8769ffd3378fc305d5f3d27fd50 Mon Sep 17 00:00:00 2001 From: Brad Ebinger Date: Fri, 17 Feb 2017 14:50:48 -0800 Subject: [PATCH] Remove Session ID from ImsService APIs that do not need it. Traditionally, to initiate a new call with the ImsService APIs, you have to "open()" the interface, which returns a session ID. This is not needed for querying other information, such as the provisioning status of the ImsService slot. Test: Manual Change-Id: I155b291a49b9aa5ed9599f5a78b1e8d7ff9f8e1c --- .../android/telephony/ims/ImsService.java | 50 +++++++++---------- .../telephony/ims/ImsServiceProxy.java | 49 +++++++++--------- .../telephony/ims/ImsServiceProxyCompat.java | 37 +++++++------- .../telephony/ims/feature/IMMTelFeature.java | 27 ++++------ .../telephony/ims/feature/MMTelFeature.java | 22 ++++---- .../ims/internal/IImsServiceController.aidl | 27 +++++----- 6 files changed, 102 insertions(+), 110 deletions(-) diff --git a/telephony/java/android/telephony/ims/ImsService.java b/telephony/java/android/telephony/ims/ImsService.java index 0f865a8437579..fe8dbfbd9f241 100644 --- a/telephony/java/android/telephony/ims/ImsService.java +++ b/telephony/java/android/telephony/ims/ImsService.java @@ -128,23 +128,23 @@ public abstract class ImsService extends ImsServiceBase { } @Override - public boolean isConnected(int slotId, int featureType, int sessionId, int callSessionType, - int callType) throws RemoteException { + public boolean isConnected(int slotId, int featureType, int callSessionType, int callType) + throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - return feature.isConnected(sessionId, callSessionType, callType); + return feature.isConnected(callSessionType, callType); } } return false; } @Override - public boolean isOpened(int slotId, int featureType, int sessionId) throws RemoteException { + public boolean isOpened(int slotId, int featureType) throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - return feature.isOpened(sessionId); + return feature.isOpened(); } } return false; @@ -166,23 +166,23 @@ public abstract class ImsService extends ImsServiceBase { } @Override - public void addRegistrationListener(int slotId, int featureType, int sessionId, + public void addRegistrationListener(int slotId, int featureType, IImsRegistrationListener listener) throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - feature.addRegistrationListener(sessionId, listener); + feature.addRegistrationListener(listener); } } } @Override - public void removeRegistrationListener(int slotId, int featureType, int sessionId, + public void removeRegistrationListener(int slotId, int featureType, IImsRegistrationListener listener) throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - feature.removeRegistrationListener(sessionId, listener); + feature.removeRegistrationListener(listener); } } } @@ -224,79 +224,79 @@ public abstract class ImsService extends ImsServiceBase { } @Override - public IImsUt getUtInterface(int slotId, int featureType, int sessionId) + public IImsUt getUtInterface(int slotId, int featureType) throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - return feature.getUtInterface(sessionId); + return feature.getUtInterface(); } } return null; } @Override - public IImsConfig getConfigInterface(int slotId, int featureType, int sessionId) + public IImsConfig getConfigInterface(int slotId, int featureType) throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - return feature.getConfigInterface(sessionId); + return feature.getConfigInterface(); } } return null; } @Override - public void turnOnIms(int slotId, int featureType, int sessionId) throws RemoteException { + public void turnOnIms(int slotId, int featureType) throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - feature.turnOnIms(sessionId); + feature.turnOnIms(); } } } @Override - public void turnOffIms(int slotId, int featureType, int sessionId) throws RemoteException { + public void turnOffIms(int slotId, int featureType) throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - feature.turnOffIms(sessionId); + feature.turnOffIms(); } } } @Override - public IImsEcbm getEcbmInterface(int slotId, int featureType, int sessionId) + public IImsEcbm getEcbmInterface(int slotId, int featureType) throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - return feature.getEcbmInterface(sessionId); + return feature.getEcbmInterface(); } } return null; } @Override - public void setUiTTYMode(int slotId, int featureType, int sessionId, int uiTtyMode, - Message onComplete) throws RemoteException { + public void setUiTTYMode(int slotId, int featureType, int uiTtyMode, Message onComplete) + throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - feature.setUiTTYMode(sessionId, uiTtyMode, onComplete); + feature.setUiTTYMode(uiTtyMode, onComplete); } } } @Override - public IImsMultiEndpoint getMultiEndpointInterface(int slotId, int featureType, - int sessionId) throws RemoteException { + public IImsMultiEndpoint getMultiEndpointInterface(int slotId, int featureType) + throws RemoteException { synchronized (mFeatures) { MMTelFeature feature = resolveMMTelFeature(slotId, featureType); if (feature != null) { - return feature.getMultiEndpointInterface(sessionId); + return feature.getMultiEndpointInterface(); } } return null; diff --git a/telephony/java/android/telephony/ims/ImsServiceProxy.java b/telephony/java/android/telephony/ims/ImsServiceProxy.java index b2cdba213771e..38ea6e6ff9a07 100644 --- a/telephony/java/android/telephony/ims/ImsServiceProxy.java +++ b/telephony/java/android/telephony/ims/ImsServiceProxy.java @@ -135,40 +135,40 @@ public class ImsServiceProxy extends ImsServiceProxyCompat implements IRcsFeatur } @Override - public boolean isConnected(int sessionId, int callServiceType, int callType) + public boolean isConnected(int callServiceType, int callType) throws RemoteException { synchronized (mLock) { checkBinderConnection(); - return getServiceInterface(mBinder).isConnected(mSlotId, mSupportedFeature, sessionId, + return getServiceInterface(mBinder).isConnected(mSlotId, mSupportedFeature, callServiceType, callType); } } @Override - public boolean isOpened(int sessionId) throws RemoteException { + public boolean isOpened() throws RemoteException { synchronized (mLock) { checkBinderConnection(); - return getServiceInterface(mBinder).isOpened(mSlotId, mSupportedFeature, sessionId); + return getServiceInterface(mBinder).isOpened(mSlotId, mSupportedFeature); } } @Override - public void addRegistrationListener(int sessionId, IImsRegistrationListener listener) + public void addRegistrationListener(IImsRegistrationListener listener) throws RemoteException { synchronized (mLock) { checkBinderConnection(); getServiceInterface(mBinder).addRegistrationListener(mSlotId, mSupportedFeature, - sessionId, listener); + listener); } } @Override - public void removeRegistrationListener(int sessionId, IImsRegistrationListener listener) + public void removeRegistrationListener(IImsRegistrationListener listener) throws RemoteException { synchronized (mLock) { checkBinderConnection(); getServiceInterface(mBinder).removeRegistrationListener(mSlotId, mSupportedFeature, - sessionId, listener); + listener); } } @@ -203,64 +203,61 @@ public class ImsServiceProxy extends ImsServiceProxyCompat implements IRcsFeatur } @Override - public IImsUt getUtInterface(int sessionId) throws RemoteException { + public IImsUt getUtInterface() throws RemoteException { synchronized (mLock) { checkBinderConnection(); - return getServiceInterface(mBinder).getUtInterface(mSlotId, mSupportedFeature, - sessionId); + return getServiceInterface(mBinder).getUtInterface(mSlotId, mSupportedFeature); } } @Override - public IImsConfig getConfigInterface(int sessionId) throws RemoteException { + public IImsConfig getConfigInterface() throws RemoteException { synchronized (mLock) { checkBinderConnection(); - return getServiceInterface(mBinder).getConfigInterface(mSlotId, mSupportedFeature, - sessionId); + return getServiceInterface(mBinder).getConfigInterface(mSlotId, mSupportedFeature); } } @Override - public void turnOnIms(int sessionId) throws RemoteException { + public void turnOnIms() throws RemoteException { synchronized (mLock) { checkBinderConnection(); - getServiceInterface(mBinder).turnOnIms(mSlotId, mSupportedFeature, sessionId); + getServiceInterface(mBinder).turnOnIms(mSlotId, mSupportedFeature); } } @Override - public void turnOffIms(int sessionId) throws RemoteException { + public void turnOffIms() throws RemoteException { synchronized (mLock) { checkBinderConnection(); - getServiceInterface(mBinder).turnOffIms(mSlotId, mSupportedFeature, sessionId); + getServiceInterface(mBinder).turnOffIms(mSlotId, mSupportedFeature); } } @Override - public IImsEcbm getEcbmInterface(int sessionId) throws RemoteException { + public IImsEcbm getEcbmInterface() throws RemoteException { synchronized (mLock) { checkBinderConnection(); - return getServiceInterface(mBinder).getEcbmInterface(mSlotId, mSupportedFeature, - sessionId); + return getServiceInterface(mBinder).getEcbmInterface(mSlotId, mSupportedFeature); } } @Override - public void setUiTTYMode(int sessionId, int uiTtyMode, Message onComplete) + public void setUiTTYMode(int uiTtyMode, Message onComplete) throws RemoteException { synchronized (mLock) { checkBinderConnection(); - getServiceInterface(mBinder).setUiTTYMode(mSlotId, mSupportedFeature, sessionId, - uiTtyMode, onComplete); + getServiceInterface(mBinder).setUiTTYMode(mSlotId, mSupportedFeature, uiTtyMode, + onComplete); } } @Override - public IImsMultiEndpoint getMultiEndpointInterface(int sessionId) throws RemoteException { + public IImsMultiEndpoint getMultiEndpointInterface() throws RemoteException { synchronized (mLock) { checkBinderConnection(); return getServiceInterface(mBinder).getMultiEndpointInterface(mSlotId, - mSupportedFeature, sessionId); + mSupportedFeature); } } diff --git a/telephony/java/android/telephony/ims/ImsServiceProxyCompat.java b/telephony/java/android/telephony/ims/ImsServiceProxyCompat.java index ff538584de45f..bbd5f0279913a 100644 --- a/telephony/java/android/telephony/ims/ImsServiceProxyCompat.java +++ b/telephony/java/android/telephony/ims/ImsServiceProxyCompat.java @@ -42,6 +42,8 @@ import com.android.ims.internal.IImsUt; public class ImsServiceProxyCompat implements IMMTelFeature { + private static final int SERVICE_ID = ImsFeature.MMTEL; + protected final int mSlotId; protected IBinder mBinder; @@ -65,29 +67,28 @@ public class ImsServiceProxyCompat implements IMMTelFeature { } @Override - public boolean isConnected(int sessionId, int callServiceType, int callType) + public boolean isConnected(int callServiceType, int callType) throws RemoteException { checkBinderConnection(); - return getServiceInterface(mBinder).isConnected(sessionId, callServiceType, callType); + return getServiceInterface(mBinder).isConnected(SERVICE_ID, callServiceType, callType); } @Override - public boolean isOpened(int sessionId) throws RemoteException { + public boolean isOpened() throws RemoteException { checkBinderConnection(); - return getServiceInterface(mBinder).isOpened(sessionId); + return getServiceInterface(mBinder).isOpened(SERVICE_ID); } @Override - public void addRegistrationListener(int sessionId, IImsRegistrationListener listener) + public void addRegistrationListener(IImsRegistrationListener listener) throws RemoteException { checkBinderConnection(); getServiceInterface(mBinder).addRegistrationListener(mSlotId, ImsFeature.MMTEL, listener); } @Override - public void removeRegistrationListener(int sessionId, IImsRegistrationListener listener) + public void removeRegistrationListener(IImsRegistrationListener listener) throws RemoteException { - checkBinderConnection(); // Not Implemented in old ImsService. If the registration listener becomes invalid, the // ImsService will remove. } @@ -114,46 +115,46 @@ public class ImsServiceProxyCompat implements IMMTelFeature { } @Override - public IImsUt getUtInterface(int sessionId) throws RemoteException { + public IImsUt getUtInterface() throws RemoteException { checkBinderConnection(); - return getServiceInterface(mBinder).getUtInterface(sessionId); + return getServiceInterface(mBinder).getUtInterface(SERVICE_ID); } @Override - public IImsConfig getConfigInterface(int sessionId) throws RemoteException { + public IImsConfig getConfigInterface() throws RemoteException { checkBinderConnection(); return getServiceInterface(mBinder).getConfigInterface(mSlotId); } @Override - public void turnOnIms(int sessionId) throws RemoteException { + public void turnOnIms() throws RemoteException { checkBinderConnection(); getServiceInterface(mBinder).turnOnIms(mSlotId); } @Override - public void turnOffIms(int sessionId) throws RemoteException { + public void turnOffIms() throws RemoteException { checkBinderConnection(); getServiceInterface(mBinder).turnOffIms(mSlotId); } @Override - public IImsEcbm getEcbmInterface(int sessionId) throws RemoteException { + public IImsEcbm getEcbmInterface() throws RemoteException { checkBinderConnection(); - return getServiceInterface(mBinder).getEcbmInterface(sessionId); + return getServiceInterface(mBinder).getEcbmInterface(SERVICE_ID); } @Override - public void setUiTTYMode(int sessionId, int uiTtyMode, Message onComplete) + public void setUiTTYMode(int uiTtyMode, Message onComplete) throws RemoteException { checkBinderConnection(); - getServiceInterface(mBinder).setUiTTYMode(sessionId, uiTtyMode, onComplete); + getServiceInterface(mBinder).setUiTTYMode(SERVICE_ID, uiTtyMode, onComplete); } @Override - public IImsMultiEndpoint getMultiEndpointInterface(int sessionId) throws RemoteException { + public IImsMultiEndpoint getMultiEndpointInterface() throws RemoteException { checkBinderConnection(); - return getServiceInterface(mBinder).getMultiEndpointInterface(sessionId); + return getServiceInterface(mBinder).getMultiEndpointInterface(SERVICE_ID); } /** diff --git a/telephony/java/android/telephony/ims/feature/IMMTelFeature.java b/telephony/java/android/telephony/ims/feature/IMMTelFeature.java index e180843c8fa1a..d65e27ebbb51b 100644 --- a/telephony/java/android/telephony/ims/feature/IMMTelFeature.java +++ b/telephony/java/android/telephony/ims/feature/IMMTelFeature.java @@ -68,7 +68,6 @@ public interface IMMTelFeature { * Checks if the IMS service has successfully registered to the IMS network with the specified * service & call type. * - * @param sessionId a session id which is obtained from {@link #startSession} * @param callServiceType a service type that is specified in {@link ImsCallProfile} * {@link ImsCallProfile#SERVICE_TYPE_NORMAL} * {@link ImsCallProfile#SERVICE_TYPE_EMERGENCY} @@ -80,31 +79,28 @@ public interface IMMTelFeature { * @return true if the specified service id is connected to the IMS network; false otherwise * @throws RemoteException */ - boolean isConnected(int sessionId, int callServiceType, int callType) throws RemoteException; + boolean isConnected(int callServiceType, int callType) throws RemoteException; /** * Checks if the specified IMS service is opened. * - * @param sessionId a service id which is obtained from {@link #startSession} * @return true if the specified service id is opened; false otherwise */ - boolean isOpened(int sessionId) throws RemoteException; + boolean isOpened() throws RemoteException; /** * Add a new registration listener for the client associated with the session Id. - * @param sessionId a session id which is obtained from {@link #startSession} * @param listener An implementation of IImsRegistrationListener. */ - void addRegistrationListener(int sessionId, IImsRegistrationListener listener) + void addRegistrationListener(IImsRegistrationListener listener) throws RemoteException; /** * Remove a previously registered listener using {@link #addRegistrationListener} for the client * associated with the session Id. - * @param sessionId a session id which is obtained from {@link #startSession} * @param listener A previously registered IImsRegistrationListener */ - void removeRegistrationListener(int sessionId, IImsRegistrationListener listener) + void removeRegistrationListener(IImsRegistrationListener listener) throws RemoteException; /** @@ -152,41 +148,40 @@ public interface IMMTelFeature { /** * @return The Ut interface for the supplementary service configuration. */ - IImsUt getUtInterface(int sessionId) throws RemoteException; + IImsUt getUtInterface() throws RemoteException; /** * @return The config interface for IMS Configuration */ - IImsConfig getConfigInterface(int sessionId) throws RemoteException; + IImsConfig getConfigInterface() throws RemoteException; /** * Signal the MMTelFeature to turn on IMS when it has been turned off using {@link #turnOffIms} * @param sessionId a session id which is obtained from {@link #startSession} */ - void turnOnIms(int sessionId) throws RemoteException; + void turnOnIms() throws RemoteException; /** * Signal the MMTelFeature to turn off IMS when it has been turned on using {@link #turnOnIms} * @param sessionId a session id which is obtained from {@link #startSession} */ - void turnOffIms(int sessionId) throws RemoteException; + void turnOffIms() throws RemoteException; /** * @return The Emergency call-back mode interface for emergency VoLTE calls that support it. */ - IImsEcbm getEcbmInterface(int sessionId) throws RemoteException; + IImsEcbm getEcbmInterface() throws RemoteException; /** * Sets the current UI TTY mode for the MMTelFeature. - * @param sessionId a session id which is obtained from {@link #startSession} * @param uiTtyMode An integer containing the new UI TTY Mode. * @param onComplete A {@link Message} to be used when the mode has been set. * @throws RemoteException */ - void setUiTTYMode(int sessionId, int uiTtyMode, Message onComplete) throws RemoteException; + void setUiTTYMode(int uiTtyMode, Message onComplete) throws RemoteException; /** * @return MultiEndpoint interface for DEP notifications */ - IImsMultiEndpoint getMultiEndpointInterface(int sessionId) throws RemoteException; + IImsMultiEndpoint getMultiEndpointInterface() throws RemoteException; } diff --git a/telephony/java/android/telephony/ims/feature/MMTelFeature.java b/telephony/java/android/telephony/ims/feature/MMTelFeature.java index 570cd65b0e0bf..a71f0bf0c7fd4 100644 --- a/telephony/java/android/telephony/ims/feature/MMTelFeature.java +++ b/telephony/java/android/telephony/ims/feature/MMTelFeature.java @@ -50,21 +50,21 @@ public class MMTelFeature extends ImsFeature implements IMMTelFeature { } @Override - public boolean isConnected(int sessionId, int callSessionType, int callType) { + public boolean isConnected(int callSessionType, int callType) { return false; } @Override - public boolean isOpened(int sessionId) { + public boolean isOpened() { return false; } @Override - public void addRegistrationListener(int sessionId, IImsRegistrationListener listener) { + public void addRegistrationListener(IImsRegistrationListener listener) { } @Override - public void removeRegistrationListener(int sessionId, IImsRegistrationListener listener) { + public void removeRegistrationListener(IImsRegistrationListener listener) { } @Override @@ -84,34 +84,34 @@ public class MMTelFeature extends ImsFeature implements IMMTelFeature { } @Override - public IImsUt getUtInterface(int sessionId) { + public IImsUt getUtInterface() { return null; } @Override - public IImsConfig getConfigInterface(int sessionId) { + public IImsConfig getConfigInterface() { return null; } @Override - public void turnOnIms(int sessionId) { + public void turnOnIms() { } @Override - public void turnOffIms(int sessionId) { + public void turnOffIms() { } @Override - public IImsEcbm getEcbmInterface(int sessionId) { + public IImsEcbm getEcbmInterface() { return null; } @Override - public void setUiTTYMode(int sessionId, int uiTtyMode, Message onComplete) { + public void setUiTTYMode(int uiTtyMode, Message onComplete) { } @Override - public IImsMultiEndpoint getMultiEndpointInterface(int sessionId) { + public IImsMultiEndpoint getMultiEndpointInterface() { return null; } diff --git a/telephony/java/com/android/ims/internal/IImsServiceController.aidl b/telephony/java/com/android/ims/internal/IImsServiceController.aidl index b700f497d0373..712816f9d20c7 100644 --- a/telephony/java/com/android/ims/internal/IImsServiceController.aidl +++ b/telephony/java/com/android/ims/internal/IImsServiceController.aidl @@ -42,24 +42,23 @@ interface IImsServiceController { int startSession(int slotId, int featureType, in PendingIntent incomingCallIntent, in IImsRegistrationListener listener); void endSession(int slotId, int featureType, int sessionId); - boolean isConnected(int slotId, int featureType, int sessionId, int callSessionType, int callType); - boolean isOpened(int slotId, int featureType, int sessionId); + boolean isConnected(int slotId, int featureType, int callSessionType, int callType); + boolean isOpened(int slotId, int featureType); int getFeatureStatus(int slotId, int featureType); - void addRegistrationListener(int slotId, int featureType, int sessionId, + void addRegistrationListener(int slotId, int featureType, in IImsRegistrationListener listener); + void removeRegistrationListener(int slotId, int featureType, in IImsRegistrationListener listener); - void removeRegistrationListener(int slotId, int featureType, int sessionId, - in IImsRegistrationListener listener); - ImsCallProfile createCallProfile(int slotId, int featureType, int sessionId, int callSessionType, int callType); + ImsCallProfile createCallProfile(int slotId, int featureType, int sessionId, + int callSessionType, int callType); IImsCallSession createCallSession(int slotId, int featureType, int sessionId, in ImsCallProfile profile, IImsCallSessionListener listener); IImsCallSession getPendingCallSession(int slotId, int featureType, int sessionId, String callId); - IImsUt getUtInterface(int slotId, int featureType, int sessionId); - IImsConfig getConfigInterface(int slotId, int featureType, int sessionId); - void turnOnIms(int slotId, int featureType, int sessionId); - void turnOffIms(int slotId, int featureType, int sessionId); - IImsEcbm getEcbmInterface(int slotId, int featureType, int sessionId); - void setUiTTYMode(int slotId, int featureType, int sessionId, int uiTtyMode, - in Message onComplete); - IImsMultiEndpoint getMultiEndpointInterface(int slotId, int featureType, int sessionId); + IImsUt getUtInterface(int slotId, int featureType); + IImsConfig getConfigInterface(int slotId, int featureType); + void turnOnIms(int slotId, int featureType); + void turnOffIms(int slotId, int featureType); + IImsEcbm getEcbmInterface(int slotId, int featureType); + void setUiTTYMode(int slotId, int featureType, int uiTtyMode, in Message onComplete); + IImsMultiEndpoint getMultiEndpointInterface(int slotId, int featureType); }