Merge "Remove Session ID from ImsService APIs that do not need it."

This commit is contained in:
Treehugger Robot
2017-02-21 20:19:19 +00:00
committed by Gerrit Code Review
6 changed files with 102 additions and 110 deletions

View File

@@ -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;

View File

@@ -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);
}
}

View File

@@ -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);
}
/**

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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);
}