Peer capabilities
Shriram Ganesh [Tue, 14 Oct 2014 01:28:34 +0000 (18:28 -0700)]
Add support for peer capabilities

Change-Id: I3af365caaacb4c3c48f73a54da6e5de6bab321aa

src/java/com/android/ims/ImsCall.java
src/java/com/android/ims/internal/ImsCallSession.java

index 82adfc3..520f298 100644 (file)
@@ -524,6 +524,27 @@ public class ImsCall implements ICall {
     }
 
     /**
+     * Gets the remote call profile (remote capabilities).
+     *
+     * @return a {@link ImsCallProfile} object that has the remote call profile
+     */
+    public ImsCallProfile getRemoteCallProfile() throws ImsException {
+        synchronized(mLockObj) {
+            if (mSession == null) {
+                throw new ImsException("No call session",
+                        ImsReasonInfo.CODE_LOCAL_CALL_TERMINATED);
+            }
+
+            try {
+                return mSession.getRemoteCallProfile();
+            } catch (Throwable t) {
+                loge("getRemoteCallProfile :: ", t);
+                throw new ImsException("getRemoteCallProfile()", t, 0);
+            }
+        }
+    }
+
+    /**
      * Gets the call profile proposed by the local/remote user.
      *
      * @return a {@link ImsCallProfile} object that has the proposed call profile
index 32cc377..aa2c0c6 100644 (file)
@@ -456,6 +456,23 @@ public class ImsCallSession {
     }
 
     /**
+     * Gets the remote call profile that this session is associated with
+     *
+     * @return the remote call profile that this session is associated with
+     */
+    public ImsCallProfile getRemoteCallProfile() {
+        if (mClosed) {
+            return null;
+        }
+
+        try {
+            return miSession.getRemoteCallProfile();
+        } catch (RemoteException e) {
+            return null;
+        }
+    }
+
+    /**
      * Gets the video call provider for the session.
      *
      * @return The video call provider.