ProxyController.setRadioCability - do not throw exception on simultaneous requests.

Simultaneous requests are a possibility becuase multiple SIM_STATE_CHANGED can
fire with READY or LOADED status.

Bug: 18703118
Change-Id: Ifcbc27626feb5f5bc28f74811cbdc0c91ab3f281
diff --git a/src/java/com/android/internal/telephony/ProxyController.java b/src/java/com/android/internal/telephony/ProxyController.java
index 603bf8c..ebc6ebf 100644
--- a/src/java/com/android/internal/telephony/ProxyController.java
+++ b/src/java/com/android/internal/telephony/ProxyController.java
@@ -224,8 +224,9 @@
      * @param rafs an RadioAccessFamily array to indicate all phone's
      *        new radio access family. The length of RadioAccessFamily
      *        must equal to phone count.
+     * @return false if another session is already active and the request is rejected.
      */
-    public void setRadioCapability(RadioAccessFamily[] rafs) {
+    public boolean setRadioCapability(RadioAccessFamily[] rafs) {
         if (rafs.length != mProxyPhones.length) {
             throw new RuntimeException("Length of input rafs must equal to total phone count");
         }
@@ -237,7 +238,9 @@
                 logd("setRadioCapability: mSetRadioAccessFamilyStatus[" + i + "]="
                         + mSetRadioAccessFamilyStatus[i]);
                 if (mSetRadioAccessFamilyStatus[i] != SET_RC_STATUS_IDLE) {
-                    throw new RuntimeException("setRadioCapability: Phone" + i + " is not idle");
+                    // TODO: The right behaviour is to cancel previous request and send this.
+                    loge("setRadioCapability: Phone[" + i + "] is not idle. Rejecting request.");
+                    return false;
                 }
             }
         }
@@ -279,6 +282,8 @@
                         EVENT_START_RC_RESPONSE);
             }
         }
+
+        return true;
     }
 
     private Handler mHandler = new Handler() {
@@ -593,6 +598,10 @@
         Rlog.d(LOG_TAG, string);
     }
 
+    private void loge(String string) {
+        Rlog.e(LOG_TAG, string);
+    }
+
     public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
         try {
             mDctController.dump(fd, pw, args);