aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Ebinger <breadley@google.com>2017-02-21 20:23:27 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-02-21 20:23:27 +0000
commit8dcc70a6a7d8a6454ea2484d792cac0aa37892d8 (patch)
treece624675e3a8c94408734790d7d90243fcaa3a1a
parent3b0513a12010ba06efda40dedce444aac0591345 (diff)
parentb5f30c78548f04c613958ed1bb0ad9e1399cce19 (diff)
downloadims-8dcc70a6a7d8a6454ea2484d792cac0aa37892d8.tar.gz
Remove Session Id from ImsService APIs that do not need it.
am: b5f30c7854 Change-Id: I064d41d55246dbc5ed4fa131852320070c40dd9d
-rw-r--r--src/java/com/android/ims/ImsManager.java73
1 files changed, 18 insertions, 55 deletions
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java
index 7d90d935..96debae6 100644
--- a/src/java/com/android/ims/ImsManager.java
+++ b/src/java/com/android/ims/ImsManager.java
@@ -1010,37 +1010,6 @@ public class ImsManager {
* @throws NullPointerException if {@code listener} is null
* @throws ImsException if calling the IMS service results in an error
*/
- public void addRegistrationListener(int sessionId, int serviceClass,
- ImsConnectionStateListener listener)
- throws ImsException {
- checkAndThrowExceptionIfServiceUnavailable();
-
- if (listener == null) {
- throw new NullPointerException("listener can't be null");
- }
-
- try {
- ImsRegistrationListenerProxy p = createRegistrationListenerProxy(serviceClass,
- listener);
- mRegistrationListeners.add(p);
- mImsServiceProxy.addRegistrationListener(sessionId, p);
- } catch (RemoteException e) {
- throw new ImsException("addRegistrationListener()", e,
- ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
- }
- }
-
- /**
- * Adds registration listener to the IMS service.
- *
- * @param serviceClass a service class specified in {@link ImsServiceClass}
- * For VoLTE service, it MUST be a {@link ImsServiceClass#MMTEL}.
- * @param listener To listen to IMS registration events; It cannot be null
- * @throws NullPointerException if {@code listener} is null
- * @throws ImsException if calling the IMS service results in an error
- * @deprecated Use {@link #addRegistrationListener(int, int, ImsConnectionStateListener)}
- * instead.
- */
public void addRegistrationListener(int serviceClass, ImsConnectionStateListener listener)
throws ImsException {
checkAndThrowExceptionIfServiceUnavailable();
@@ -1052,9 +1021,8 @@ public class ImsManager {
try {
ImsRegistrationListenerProxy p = createRegistrationListenerProxy(serviceClass,
listener);
- // Only add the listener if it doesn't already exist in the set.
mRegistrationListeners.add(p);
- mImsServiceProxy.addRegistrationListener(ImsFeature.MMTEL, p);
+ mImsServiceProxy.addRegistrationListener(p);
} catch (RemoteException e) {
throw new ImsException("addRegistrationListener()", e,
ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
@@ -1064,13 +1032,12 @@ public class ImsManager {
/**
* Removes the registration listener from the IMS service.
*
- * @param sessionId The session ID returned by open.
* @param listener Previously registered listener that will be removed. Can not be null.
* @throws NullPointerException if {@code listener} is null
* @throws ImsException if calling the IMS service results in an error
* instead.
*/
- public void removeRegistrationListener(int sessionId, ImsConnectionStateListener listener)
+ public void removeRegistrationListener(ImsConnectionStateListener listener)
throws ImsException {
checkAndThrowExceptionIfServiceUnavailable();
@@ -1084,7 +1051,7 @@ public class ImsManager {
if(optionalProxy.isPresent()) {
ImsRegistrationListenerProxy p = optionalProxy.get();
mRegistrationListeners.remove(p);
- mImsServiceProxy.removeRegistrationListener(sessionId, p);
+ mImsServiceProxy.removeRegistrationListener(p);
}
} catch (RemoteException e) {
throw new ImsException("removeRegistrationListener()", e,
@@ -1118,18 +1085,17 @@ public class ImsManager {
/**
* Gets the configuration interface to provision / withdraw the supplementary service settings.
*
- * @param sessionId a session id which is obtained from {@link ImsManager#open}
* @return the Ut interface instance
* @throws ImsException if getting the Ut interface results in an error
*/
- public ImsUtInterface getSupplementaryServiceConfiguration(int sessionId)
+ public ImsUtInterface getSupplementaryServiceConfiguration()
throws ImsException {
// FIXME: manage the multiple Ut interfaces based on the session id
if (mUt == null || !mImsServiceProxy.isBinderAlive()) {
checkAndThrowExceptionIfServiceUnavailable();
try {
- IImsUt iUt = mImsServiceProxy.getUtInterface(sessionId);
+ IImsUt iUt = mImsServiceProxy.getUtInterface();
if (iUt == null) {
throw new ImsException("getSupplementaryServiceConfiguration()",
@@ -1150,7 +1116,6 @@ public class ImsManager {
* 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 ImsManager#open}
* @param serviceType a service type that is specified in {@link ImsCallProfile}
* {@link ImsCallProfile#SERVICE_TYPE_NORMAL}
* {@link ImsCallProfile#SERVICE_TYPE_EMERGENCY}
@@ -1163,12 +1128,12 @@ public class ImsManager {
* false otherwise
* @throws ImsException if calling the IMS service results in an error
*/
- public boolean isConnected(int sessionId, int serviceType, int callType)
+ public boolean isConnected(int serviceType, int callType)
throws ImsException {
checkAndThrowExceptionIfServiceUnavailable();
try {
- return mImsServiceProxy.isConnected(sessionId, serviceType, callType);
+ return mImsServiceProxy.isConnected(serviceType, callType);
} catch (RemoteException e) {
throw new ImsException("isServiceConnected()", e,
ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
@@ -1178,15 +1143,14 @@ public class ImsManager {
/**
* Checks if the specified IMS service is opend.
*
- * @param sessionId a session id which is obtained from {@link ImsManager#open}
* @return true if the specified service id is opened; false otherwise
* @throws ImsException if calling the IMS service results in an error
*/
- public boolean isOpened(int sessionId) throws ImsException {
+ public boolean isOpened() throws ImsException {
checkAndThrowExceptionIfServiceUnavailable();
try {
- return mImsServiceProxy.isOpened(sessionId);
+ return mImsServiceProxy.isOpened();
} catch (RemoteException e) {
throw new ImsException("isOpened()", e,
ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
@@ -1213,8 +1177,8 @@ public class ImsManager {
* @return a {@link ImsCallProfile} object
* @throws ImsException if calling the IMS service results in an error
*/
- public ImsCallProfile createCallProfile(int sessionId,
- int serviceType, int callType) throws ImsException {
+ public ImsCallProfile createCallProfile(int sessionId, int serviceType, int callType)
+ throws ImsException {
checkAndThrowExceptionIfServiceUnavailable();
try {
@@ -1327,7 +1291,7 @@ public class ImsManager {
checkAndThrowExceptionIfServiceUnavailable();
try {
- IImsConfig config = mImsServiceProxy.getConfigInterface(mPhoneId);
+ IImsConfig config = mImsServiceProxy.getConfigInterface();
if (config == null) {
throw new ImsException("getConfigInterface()",
ImsReasonInfo.CODE_LOCAL_SERVICE_UNAVAILABLE);
@@ -1342,13 +1306,13 @@ public class ImsManager {
return mConfig;
}
- public void setUiTTYMode(Context context, int sessionId, int uiTtyMode, Message onComplete)
+ public void setUiTTYMode(Context context, int uiTtyMode, Message onComplete)
throws ImsException {
checkAndThrowExceptionIfServiceUnavailable();
try {
- mImsServiceProxy.setUiTTYMode(sessionId, uiTtyMode, onComplete);
+ mImsServiceProxy.setUiTTYMode(uiTtyMode, onComplete);
} catch (RemoteException e) {
throw new ImsException("setTTYMode()", e,
ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
@@ -1582,7 +1546,7 @@ public class ImsManager {
checkAndThrowExceptionIfServiceUnavailable();
try {
- mImsServiceProxy.turnOnIms(mPhoneId);
+ mImsServiceProxy.turnOnIms();
} catch (RemoteException e) {
throw new ImsException("turnOnIms() ", e, ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
}
@@ -1645,7 +1609,7 @@ public class ImsManager {
checkAndThrowExceptionIfServiceUnavailable();
try {
- mImsServiceProxy.turnOffIms(mPhoneId);
+ mImsServiceProxy.turnOffIms();
} catch (RemoteException e) {
throw new ImsException("turnOffIms() ", e, ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
}
@@ -1842,7 +1806,7 @@ public class ImsManager {
checkAndThrowExceptionIfServiceUnavailable();
try {
- IImsEcbm iEcbm = mImsServiceProxy.getEcbmInterface(serviceId);
+ IImsEcbm iEcbm = mImsServiceProxy.getEcbmInterface();
if (iEcbm == null) {
throw new ImsException("getEcbmInterface()",
@@ -1869,8 +1833,7 @@ public class ImsManager {
checkAndThrowExceptionIfServiceUnavailable();
try {
- IImsMultiEndpoint iImsMultiEndpoint = mImsServiceProxy.getMultiEndpointInterface(
- serviceId);
+ IImsMultiEndpoint iImsMultiEndpoint = mImsServiceProxy.getMultiEndpointInterface();
if (iImsMultiEndpoint == null) {
throw new ImsException("getMultiEndpointInterface()",