IMS Framework and AIDL Changes to Support CLIR/P and COLR/P
Etan Cohen [Tue, 1 Jul 2014 16:57:00 +0000 (09:57 -0700)]
Change-Id: I7d15b092feb8fa0eaf6764223d5890ed17c3a143

src/java/com/android/ims/ImsUt.java
src/java/com/android/ims/ImsUtInterface.java

index c2f77d5..ed3c475 100644 (file)
@@ -196,6 +196,107 @@ public class ImsUt implements ImsUtInterface {
     }
 
     /**
+     * Retrieves the default CLIR setting.
+     */
+    @Override
+    public void queryCLIR(Message result) {
+        if (DBG) {
+            log("queryCLIR :: Ut=" + miUt);
+        }
+
+        synchronized(mLockObj) {
+            try {
+                int id = miUt.queryCLIR();
+
+                if (id < 0) {
+                    id *= (-1);
+                    sendFailureReport(result, id);
+                    return;
+                }
+
+                mPendingCmds.put(Integer.valueOf(id), result);
+            } catch (RemoteException e) {
+                sendFailureReport(result, ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE);
+            }
+        }
+    }
+
+    /**
+     * Retrieves the CLIP call setting.
+     */
+    public void queryCLIP(Message result) {
+        if (DBG) {
+            log("queryCLIP :: Ut=" + miUt);
+        }
+
+        synchronized(mLockObj) {
+            try {
+                int id = miUt.queryCLIP();
+
+                if (id < 0) {
+                    id *= (-1);
+                    sendFailureReport(result, id);
+                    return;
+                }
+
+                mPendingCmds.put(Integer.valueOf(id), result);
+            } catch (RemoteException e) {
+                sendFailureReport(result, ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE);
+            }
+        }
+    }
+
+    /**
+     * Retrieves the COLR call setting.
+     */
+    public void queryCOLR(Message result) {
+        if (DBG) {
+            log("queryCOLR :: Ut=" + miUt);
+        }
+
+        synchronized(mLockObj) {
+            try {
+                int id = miUt.queryCOLR();
+
+                if (id < 0) {
+                    id *= (-1);
+                    sendFailureReport(result, id);
+                    return;
+                }
+
+                mPendingCmds.put(Integer.valueOf(id), result);
+            } catch (RemoteException e) {
+                sendFailureReport(result, ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE);
+            }
+        }
+    }
+
+    /**
+     * Retrieves the COLP call setting.
+     */
+    public void queryCOLP(Message result) {
+        if (DBG) {
+            log("queryCOLP :: Ut=" + miUt);
+        }
+
+        synchronized(mLockObj) {
+            try {
+                int id = miUt.queryCOLP();
+
+                if (id < 0) {
+                    id *= (-1);
+                    sendFailureReport(result, id);
+                    return;
+                }
+
+                mPendingCmds.put(Integer.valueOf(id), result);
+            } catch (RemoteException e) {
+                sendFailureReport(result, ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE);
+            }
+        }
+    }
+
+    /**
      * Modifies the configuration of the call barring.
      */
     @Override
@@ -277,6 +378,110 @@ public class ImsUt implements ImsUtInterface {
         }
     }
 
+    /**
+     * Updates the configuration of the CLIR supplementary service.
+     */
+    @Override
+    public void updateCLIR(int clirMode, Message result) {
+        if (DBG) {
+            log("updateCLIR :: Ut=" + miUt + ", clirMode=" + clirMode);
+        }
+
+        synchronized(mLockObj) {
+            try {
+                int id = miUt.updateCLIR(clirMode);
+
+                if (id < 0) {
+                    id *= (-1);
+                    sendFailureReport(result, id);
+                    return;
+                }
+
+                mPendingCmds.put(Integer.valueOf(id), result);
+            } catch (RemoteException e) {
+                sendFailureReport(result, ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE);
+            }
+        }
+    }
+
+    /**
+     * Updates the configuration of the CLIP supplementary service.
+     */
+    @Override
+    public void updateCLIP(boolean enable, Message result) {
+        if (DBG) {
+            log("updateCLIP :: Ut=" + miUt + ", enable=" + enable);
+        }
+
+        synchronized(mLockObj) {
+            try {
+                int id = miUt.updateCLIP(enable);
+
+                if (id < 0) {
+                    id *= (-1);
+                    sendFailureReport(result, id);
+                    return;
+                }
+
+                mPendingCmds.put(Integer.valueOf(id), result);
+            } catch (RemoteException e) {
+                sendFailureReport(result, ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE);
+            }
+        }
+    }
+
+    /**
+     * Updates the configuration of the COLR supplementary service.
+     */
+    @Override
+    public void updateCOLR(int presentation, Message result) {
+        if (DBG) {
+            log("updateCOLR :: Ut=" + miUt + ", presentation=" + presentation);
+        }
+
+        synchronized(mLockObj) {
+            try {
+                int id = miUt.updateCOLR(presentation);
+
+                if (id < 0) {
+                    id *= (-1);
+                    sendFailureReport(result, id);
+                    return;
+                }
+
+                mPendingCmds.put(Integer.valueOf(id), result);
+            } catch (RemoteException e) {
+                sendFailureReport(result, ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE);
+            }
+        }
+    }
+
+    /**
+     * Updates the configuration of the COLP supplementary service.
+     */
+    @Override
+    public void updateCOLP(boolean enable, Message result) {
+        if (DBG) {
+            log("updateCallWaiting :: Ut=" + miUt + ", enable=" + enable);
+        }
+
+        synchronized(mLockObj) {
+            try {
+                int id = miUt.updateCOLP(enable);
+
+                if (id < 0) {
+                    id *= (-1);
+                    sendFailureReport(result, id);
+                    return;
+                }
+
+                mPendingCmds.put(Integer.valueOf(id), result);
+            } catch (RemoteException e) {
+                sendFailureReport(result, ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE);
+            }
+        }
+    }
+
     public void transact(Bundle ssInfo, Message result) {
         if (DBG) {
             log("transact :: Ut=" + miUt + ", ssInfo=" + ssInfo);
index d7695a0..4529da4 100644 (file)
@@ -114,6 +114,26 @@ public interface ImsUtInterface {
     public void queryCallWaiting(Message result);
 
     /**
+     * Retrieves the default CLIR setting.
+     */
+    public void queryCLIR(Message result);
+
+    /**
+     * Retrieves the CLIP call setting.
+     */
+    public void queryCLIP(Message result);
+
+    /**
+     * Retrieves the COLR call setting.
+     */
+    public void queryCOLR(Message result);
+
+    /**
+     * Retrieves the COLP call setting.
+     */
+    public void queryCOLP(Message result);
+
+    /**
      * Modifies the configuration of the call barring.
      */
     public void updateCallBarring(int cbType, boolean enable, Message result);
@@ -128,4 +148,24 @@ public interface ImsUtInterface {
      * Modifies the configuration of the call waiting.
      */
     public void updateCallWaiting(boolean enable, Message result);
+
+    /**
+     * Updates the configuration of the CLIR supplementary service.
+     */
+    public void updateCLIR(int clirMode, Message result);
+
+    /**
+     * Updates the configuration of the CLIP supplementary service.
+     */
+    public void updateCLIP(boolean enable, Message result);
+
+    /**
+     * Updates the configuration of the COLR supplementary service.
+     */
+    public void updateCOLR(int presentation, Message result);
+
+    /**
+     * Updates the configuration of the COLP supplementary service.
+     */
+    public void updateCOLP(boolean enable, Message result);
 }