OSDN Git Service

Add queryFacilityLockForApp and setFacilityLockForApp for v6 ril.h.
authorWink Saville <wink@google.com>
Wed, 23 Feb 2011 00:37:24 +0000 (16:37 -0800)
committerWink Saville <wink@google.com>
Wed, 23 Feb 2011 00:37:24 +0000 (16:37 -0800)
Change-Id: Ib802e77fb03567c619e911e5f975be3077947e05

telephony/java/com/android/internal/telephony/CommandsInterface.java
telephony/java/com/android/internal/telephony/RIL.java
telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java
telephony/java/com/android/internal/telephony/test/SimulatedCommands.java

index 21e9e44..ad21a18 100644 (file)
@@ -1178,6 +1178,21 @@ public interface CommandsInterface {
         Message response);
 
     /**
+     * (AsyncResult)response.obj).result will be an Integer representing
+     * the sum of enabled service classes (sum of SERVICE_CLASS_*) for the
+     * application with appId.
+     *
+     * @param facility one of CB_FACILTY_*
+     * @param password password or "" if not required
+     * @param serviceClass is a sum of SERVICE_CLASS_*
+     * @param appId is application Id or null if none
+     * @param response is callback message
+     */
+
+    void queryFacilityLockForApp(String facility, String password, int serviceClass, String appId,
+        Message response);
+
+    /**
      * @param facility one of CB_FACILTY_*
      * @param lockState true means lock, false means unlock
      * @param password password or "" if not required
@@ -1187,6 +1202,18 @@ public interface CommandsInterface {
     void setFacilityLock (String facility, boolean lockState, String password,
         int serviceClass, Message response);
 
+    /**
+     * Set the facility lock for the app with this AID on the ICC card.
+     *
+     * @param facility one of CB_FACILTY_*
+     * @param lockState true means lock, false means unlock
+     * @param password password or "" if not required
+     * @param serviceClass is a sum of SERVICE_CLASS_*
+     * @param appId is application Id or null if none
+     * @param response is callback message
+     */
+    void setFacilityLockForApp(String facility, boolean lockState, String password,
+        int serviceClass, String appId, Message response);
 
     void sendUSSD (String ussdString, Message response);
 
index 76c6229..bccb219 100644 (file)
@@ -1643,27 +1643,44 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         send(rr);
     }
 
+    @Override
     public void
-    queryFacilityLock (String facility, String password, int serviceClass,
+    queryFacilityLock(String facility, String password, int serviceClass,
+                            Message response) {
+        queryFacilityLockForApp(facility, password, serviceClass, null, response);
+    }
+
+    @Override
+    public void
+    queryFacilityLockForApp(String facility, String password, int serviceClass, String appId,
                             Message response) {
         RILRequest rr = RILRequest.obtain(RIL_REQUEST_QUERY_FACILITY_LOCK, response);
 
         if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
 
         // count strings
-        rr.mp.writeInt(3);
+        rr.mp.writeInt(4);
 
         rr.mp.writeString(facility);
         rr.mp.writeString(password);
 
         rr.mp.writeString(Integer.toString(serviceClass));
+        rr.mp.writeString(appId);
 
         send(rr);
     }
 
+    @Override
     public void
     setFacilityLock (String facility, boolean lockState, String password,
                         int serviceClass, Message response) {
+        setFacilityLockForApp(facility, lockState, password, serviceClass, null, response);
+    }
+
+    @Override
+    public void
+    setFacilityLockForApp(String facility, boolean lockState, String password,
+                        int serviceClass, String appId, Message response) {
         String lockString;
          RILRequest rr
                 = RILRequest.obtain(RIL_REQUEST_SET_FACILITY_LOCK, response);
@@ -1671,13 +1688,14 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
 
         // count strings
-        rr.mp.writeInt(4);
+        rr.mp.writeInt(5);
 
         rr.mp.writeString(facility);
         lockString = (lockState)?"1":"0";
         rr.mp.writeString(lockString);
         rr.mp.writeString(password);
         rr.mp.writeString(Integer.toString(serviceClass));
+        rr.mp.writeString(appId);
 
         send(rr);
 
index b6c3b67..f2ece7f 100644 (file)
@@ -251,14 +251,26 @@ class SipCommandInterface extends BaseCommands implements CommandsInterface {
     public void getBasebandVersion (Message response) {
     }
 
-    public void queryFacilityLock (String facility, String password,
+    @Override
+    public void queryFacilityLock(String facility, String password,
             int serviceClass, Message response) {
     }
 
-    public void setFacilityLock (String facility, boolean lockState,
+    @Override
+    public void queryFacilityLockForApp(String facility, String password,
+            int serviceClass, String appId, Message response) {
+    }
+
+    @Override
+    public void setFacilityLock(String facility, boolean lockState,
             String password, int serviceClass, Message response) {
     }
 
+    @Override
+    public void setFacilityLockForApp(String facility, boolean lockState,
+            String password, int serviceClass, String appId, Message response) {
+    }
+
     public void sendUSSD (String ussdString, Message response) {
     }
 
index 242d44f..d9bd7e8 100644 (file)
@@ -331,35 +331,31 @@ public final class SimulatedCommands extends BaseCommands
         mSsnNotifyOn = enable;
     }
 
-    /**
-     * (AsyncResult)response.obj).result will be an Integer representing
-     * the sum of enabled service classes (sum of SERVICE_CLASS_*)
-     *
-     * @param facility one of CB_FACILTY_*
-     * @param pin password or "" if not required
-     * @param serviceClass is a sum of SERVICE_CLASS_*
-     */
-
-    public void queryFacilityLock (String facility, String pin,
+    @Override
+    public void queryFacilityLock(String facility, String pin,
                                    int serviceClass, Message result) {
-        if (facility != null &&
-                facility.equals(CommandsInterface.CB_FACILITY_BA_SIM)) {
+        queryFacilityLockForApp(facility, pin, serviceClass, null, result);
+    }
+
+    @Override
+    public void queryFacilityLockForApp(String facility, String pin, int serviceClass,
+            String appId, Message result) {
+        if (facility != null && facility.equals(CommandsInterface.CB_FACILITY_BA_SIM)) {
             if (result != null) {
                 int[] r = new int[1];
                 r[0] = (mSimLockEnabled ? 1 : 0);
-                Log.i(LOG_TAG, "[SimCmd] queryFacilityLock: SIM is " +
-                        (r[0] == 0 ? "unlocked" : "locked"));
+                Log.i(LOG_TAG, "[SimCmd] queryFacilityLock: SIM is "
+                        (r[0] == 0 ? "unlocked" : "locked"));
                 AsyncResult.forMessage(result, r, null);
                 result.sendToTarget();
             }
             return;
-        } else if (facility != null &&
-                facility.equals(CommandsInterface.CB_FACILITY_BA_FD)) {
+        } else if (facility != null && facility.equals(CommandsInterface.CB_FACILITY_BA_FD)) {
             if (result != null) {
                 int[] r = new int[1];
                 r[0] = (mSimFdnEnabled ? 1 : 0);
-                Log.i(LOG_TAG, "[SimCmd] queryFacilityLock: FDN is " +
-                        (r[0] == 0 ? "disabled" : "enabled"));
+                Log.i(LOG_TAG, "[SimCmd] queryFacilityLock: FDN is "
+                        (r[0] == 0 ? "disabled" : "enabled"));
                 AsyncResult.forMessage(result, r, null);
                 result.sendToTarget();
             }
@@ -369,14 +365,15 @@ public final class SimulatedCommands extends BaseCommands
         unimplemented(result);
     }
 
-    /**
-     * @param facility one of CB_FACILTY_*
-     * @param lockEnabled true if SIM lock is enabled
-     * @param pin the SIM pin or "" if not required
-     * @param serviceClass is a sum of SERVICE_CLASS_*
-     */
-    public void setFacilityLock (String facility, boolean lockEnabled,
-                                 String pin, int serviceClass,
+    @Override
+    public void setFacilityLock(String facility, boolean lockEnabled, String pin, int serviceClass,
+            Message result) {
+        setFacilityLockForApp(facility, lockEnabled, pin, serviceClass, null, result);
+    }
+
+    @Override
+    public void setFacilityLockForApp(String facility, boolean lockEnabled,
+                                 String pin, int serviceClass, String appId,
                                  Message result) {
         if (facility != null &&
                 facility.equals(CommandsInterface.CB_FACILITY_BA_SIM)) {