Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12fe7c9d authored by Shishir Agrawal's avatar Shishir Agrawal
Browse files

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
parent c109ae65
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -224,8 +224,9 @@ public class ProxyController {
     * @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 @@ public class ProxyController {
                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;
                }
            }
        }
@@ -282,6 +285,8 @@ public class ProxyController {
                        EVENT_START_RC_RESPONSE);
            }
        }

        return true;
    }

    private Handler mHandler = new Handler() {
@@ -596,6 +601,10 @@ public class ProxyController {
        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);