Merge "Add getQtiRadioCapability() API support"
diff --git a/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java b/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java
index 3b6e4cb..138d3b7 100644
--- a/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java
+++ b/extphone/src/com/qti/extphone/ExtPhoneCallbackBase.java
@@ -84,4 +84,11 @@
         Log.d(TAG, "sendCdmaSmsResponse: slotId = " + slotId + " token = " + token + " status" +
                 status + " SmsResult = " + sms);
     }
+
+    @Override
+    public void getQtiRadioCapabilityResponse(int slotId, Token token, Status status, int raf)
+            throws RemoteException {
+        Log.d(TAG, "getQtiRadioCapabilityResponse: slotId = " + slotId + " token = " + token +
+                " status" + status + " raf = " + raf);
+    }
 }
diff --git a/extphone/src/com/qti/extphone/ExtTelephonyManager.java b/extphone/src/com/qti/extphone/ExtTelephonyManager.java
index 4517560..2d83837 100644
--- a/extphone/src/com/qti/extphone/ExtTelephonyManager.java
+++ b/extphone/src/com/qti/extphone/ExtTelephonyManager.java
@@ -65,7 +65,7 @@
     * @param context context in which the bindService will be
     *                initiated.
     */
-    public ExtTelephonyManager(Context context){
+    public ExtTelephonyManager(Context context) {
         this.mContext = context;
         mServiceConnected = false;
         log("ExtTelephonyManager() ...");
@@ -103,7 +103,7 @@
     *                 connection. The client needs to use handler
     *                 to listen to the Result.
     */
-    public boolean connectService(ServiceCallback cb){
+    public boolean connectService(ServiceCallback cb) {
         mServiceCb = cb;
         mClientCount += 1;
         log("Creating ExtTelephonyService. If not started yet, start ...");
@@ -414,13 +414,13 @@
 
     public Token enableEndc(int slot, boolean enable, Client client) {
         Token token = null;
-        if(!mServiceConnected){
+        if (!mServiceConnected) {
             Log.e(LOG_TAG, "service not connected!");
             return token;
         }
         try {
             token = mExtTelephonyService.enableEndc(slot, enable, client);
-        } catch(RemoteException e){
+        } catch(RemoteException e) {
             Log.e(LOG_TAG, "enableEndc, remote exception");
             e.printStackTrace();
         }
@@ -429,13 +429,13 @@
 
     public Token queryNrIconType(int slot, Client client) {
         Token token = null;
-        if(!mServiceConnected){
+        if (!mServiceConnected) {
             Log.e(LOG_TAG, "service not connected!");
             return token;
         }
         try {
             token = mExtTelephonyService.queryNrIconType(slot, client);
-        } catch(RemoteException e){
+        } catch(RemoteException e) {
             Log.e(LOG_TAG, "queryNrIconType, remote exception");
             e.printStackTrace();
         }
@@ -444,13 +444,13 @@
 
     public Token queryEndcStatus(int slot, Client client) {
         Token token = null;
-        if(!mServiceConnected){
+        if (!mServiceConnected) {
             Log.e(LOG_TAG, "service not connected!");
             return token;
         }
         try {
             token = mExtTelephonyService.queryEndcStatus(slot, client);
-        } catch(RemoteException e){
+        } catch(RemoteException e) {
             Log.e(LOG_TAG, "queryEndcStatus, remote exception");
             e.printStackTrace();
         }
@@ -459,13 +459,13 @@
 
     public Token setNrConfig(int slot, NrConfig config, Client client) {
         Token token = null;
-        if(!mServiceConnected){
+        if (!mServiceConnected) {
             Log.e(LOG_TAG, "service not connected!");
             return token;
         }
         try {
             token = mExtTelephonyService.setNrConfig(slot, config, client);
-        } catch(RemoteException e){
+        } catch(RemoteException e) {
             Log.e(LOG_TAG, "setNrConfig, remote exception");
             e.printStackTrace();
         }
@@ -474,13 +474,13 @@
 
     public Token queryNrConfig(int slot, Client client) {
         Token token = null;
-        if(!mServiceConnected){
+        if (!mServiceConnected) {
             Log.e(LOG_TAG, "service not connected!");
             return token;
         }
         try {
             token = mExtTelephonyService.queryNrConfig(slot, client);
-        } catch(RemoteException e){
+        } catch(RemoteException e) {
             Log.e(LOG_TAG, "queryNrConfig, remote exception");
             e.printStackTrace();
         }
@@ -489,29 +489,38 @@
 
     public Token sendCdmaSms(int slot, byte[] pdu, boolean expectMore, Client client) {
         Token token = null;
-        if(!mServiceConnected){
+        if (!mServiceConnected) {
             Log.e(LOG_TAG, "service not connected!");
             return token;
         }
         try {
             token = mExtTelephonyService.sendCdmaSms(slot, pdu, expectMore, client);
-        } catch(RemoteException e){
+        } catch(RemoteException e) {
             Log.e(LOG_TAG, "sendCdmaSms, remote exception");
             e.printStackTrace();
         }
         return token;
     }
 
+    public Token getQtiRadioCapability(int slotId, Client client) throws RemoteException {
+        Token token = null;
+        if (!mServiceConnected) {
+            Log.e(LOG_TAG, "service not connected!");
+            return token;
+        }
+        token = mExtTelephonyService.getQtiRadioCapability(slotId, client);
+        return token;
+    }
+
     public Client registerCallback(String packageName, IExtPhoneCallback callback) {
         Client client = null;
-        if(!mServiceConnected){
+        if (!mServiceConnected) {
             Log.e(LOG_TAG, "service not connected!");
             return client;
         }
         try {
-            client = mExtTelephonyService.registerCallback(packageName,
-                    callback);
-        } catch(RemoteException e){
+            client = mExtTelephonyService.registerCallback(packageName, callback);
+        } catch(RemoteException e) {
             Log.e(LOG_TAG, "registerCallback, remote exception");
             e.printStackTrace();
         }
@@ -519,13 +528,13 @@
     }
 
     public void unRegisterCallback(IExtPhoneCallback callback) {
-        if(!mServiceConnected){
+        if (!mServiceConnected) {
             Log.e(LOG_TAG, "service not connected!");
             return;
         }
         try {
             mExtTelephonyService.unRegisterCallback(callback);
-        } catch(RemoteException e){
+        } catch(RemoteException e) {
             Log.e(LOG_TAG, "unRegisterCallback, remote exception");
             e.printStackTrace();
         }
diff --git a/extphone/src/com/qti/extphone/IExtPhone.aidl b/extphone/src/com/qti/extphone/IExtPhone.aidl
index 3f67824..3aa9998 100644
--- a/extphone/src/com/qti/extphone/IExtPhone.aidl
+++ b/extphone/src/com/qti/extphone/IExtPhone.aidl
@@ -204,4 +204,12 @@
     * @return Integer Token to be used to compare with the response.
     */
     Token sendCdmaSms(int slotId, in byte[] pdu, boolean expectMore, in Client client);
+
+    /**
+    * Get phone radio capability.
+    * @param - slotId
+    * @param - client registered with packagename to receive callbacks.
+    * @return Integer Token to be used to compare with the response.
+    */
+    Token getQtiRadioCapability(int slotId, in Client client);
 }
diff --git a/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl b/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl
index 4aba479..143c0c0 100644
--- a/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl
+++ b/extphone/src/com/qti/extphone/IExtPhoneCallback.aidl
@@ -83,4 +83,14 @@
     *
     */
     void sendCdmaSmsResponse(int slotId, in Token token, in Status status, in SmsResult sms);
+
+    /**
+    * Response to getQtiRadioCapability
+    * @param - slotId
+    * @param - token is the same token which is recived in getQtiRadioCapability
+    * @param - status SUCCESS/FAILURE based on the modem Result code
+    * @param - raf Radio Access Family 32-bit bitmap of
+    *          vendor.qti.hardware.radio.qtiradio.V2_6.RadioAccessFamily
+    */
+    void getQtiRadioCapabilityResponse(int slotId, in Token token, in Status status, int raf);
 }