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

Commit 5e7f4f89 authored by Jordan Liu's avatar Jordan Liu Committed by Gerrit Code Review
Browse files

Merge "Add EID to IccSlotStatus"

parents 143de2fe 13ed879b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ java_library {
        "android.hardware.radio-V1.2-java",
        "android.hardware.radio-V1.3-java",
        "android.hardware.radio.config-V1.0-java",
        "android.hardware.radio.config-V1.1-java",
        "android.hardware.radio.deprecated-V1.0-java",
        "android.hidl.base-V1.0-java",
    ],
+18 −3
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import android.content.Context;
import android.hardware.radio.V1_0.RadioResponseInfo;
import android.hardware.radio.V1_0.RadioResponseType;
import android.hardware.radio.config.V1_0.IRadioConfig;
import android.hardware.radio.config.V1_0.SimSlotStatus;
import android.net.ConnectivityManager;
import android.os.AsyncResult;
import android.os.Handler;
@@ -344,9 +343,9 @@ public class RadioConfig extends Handler {
    }

    static ArrayList<IccSlotStatus> convertHalSlotStatus(
            ArrayList<SimSlotStatus> halSlotStatusList) {
            ArrayList<android.hardware.radio.config.V1_0.SimSlotStatus> halSlotStatusList) {
        ArrayList<IccSlotStatus> response = new ArrayList<IccSlotStatus>(halSlotStatusList.size());
        for (SimSlotStatus slotStatus : halSlotStatusList) {
        for (android.hardware.radio.config.V1_0.SimSlotStatus slotStatus : halSlotStatusList) {
            IccSlotStatus iccSlotStatus = new IccSlotStatus();
            iccSlotStatus.setCardState(slotStatus.cardState);
            iccSlotStatus.setSlotState(slotStatus.slotState);
@@ -358,6 +357,22 @@ public class RadioConfig extends Handler {
        return response;
    }

    static ArrayList<IccSlotStatus> convertHalSlotStatus_1_1(
            ArrayList<android.hardware.radio.config.V1_1.SimSlotStatus> halSlotStatusList) {
        ArrayList<IccSlotStatus> response = new ArrayList<IccSlotStatus>(halSlotStatusList.size());
        for (android.hardware.radio.config.V1_1.SimSlotStatus slotStatus : halSlotStatusList) {
            IccSlotStatus iccSlotStatus = new IccSlotStatus();
            iccSlotStatus.setCardState(slotStatus.base.cardState);
            iccSlotStatus.setSlotState(slotStatus.base.slotState);
            iccSlotStatus.logicalSlotIndex = slotStatus.base.logicalSlotId;
            iccSlotStatus.atr = slotStatus.base.atr;
            iccSlotStatus.iccid = slotStatus.base.iccid;
            iccSlotStatus.eid = slotStatus.eid;
            response.add(iccSlotStatus);
        }
        return response;
    }

    private static void logd(String log) {
        Rlog.d(TAG, log);
    }
+15 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.internal.telephony;

import android.hardware.radio.config.V1_0.IRadioConfigIndication;
import android.hardware.radio.config.V1_0.SimSlotStatus;
import android.os.AsyncResult;
import android.telephony.Rlog;

@@ -39,7 +38,8 @@ public class RadioConfigIndication extends IRadioConfigIndication.Stub {
    /**
     * Unsolicited indication for slot status changed
     */
    public void simSlotsStatusChanged(int indicationType, ArrayList<SimSlotStatus> slotStatus) {
    public void simSlotsStatusChanged(int indicationType,
            ArrayList<android.hardware.radio.config.V1_0.SimSlotStatus> slotStatus) {
        ArrayList<IccSlotStatus> ret = RadioConfig.convertHalSlotStatus(slotStatus);
        Rlog.d(TAG, "[UNSL]< " + " UNSOL_SIM_SLOT_STATUS_CHANGED " + ret.toString());
        if (mRadioConfig.mSimSlotStatusRegistrant != null) {
@@ -47,4 +47,17 @@ public class RadioConfigIndication extends IRadioConfigIndication.Stub {
                    new AsyncResult(null, ret, null));
        }
    }

    /**
     * Unsolicited indication for slot status changed
     */
    public void simSlotsStatusChanged_1_1(int indicationType,
            ArrayList<android.hardware.radio.config.V1_1.SimSlotStatus> slotStatus) {
        ArrayList<IccSlotStatus> ret = RadioConfig.convertHalSlotStatus_1_1(slotStatus);
        Rlog.d(TAG, "[UNSL]< " + " UNSOL_SIM_SLOT_STATUS_CHANGED " + ret.toString());
        if (mRadioConfig.mSimSlotStatusRegistrant != null) {
            mRadioConfig.mSimSlotStatusRegistrant.notifyRegistrant(
                    new AsyncResult(null, ret, null));
        }
    }
}
+27 −3
Original line number Diff line number Diff line
@@ -18,8 +18,7 @@ package com.android.internal.telephony;

import android.hardware.radio.V1_0.RadioError;
import android.hardware.radio.V1_0.RadioResponseInfo;
import android.hardware.radio.config.V1_0.IRadioConfigResponse;
import android.hardware.radio.config.V1_0.SimSlotStatus;
import android.hardware.radio.config.V1_1.IRadioConfigResponse;
import android.telephony.Rlog;

import com.android.internal.telephony.uicc.IccSlotStatus;
@@ -41,7 +40,7 @@ public class RadioConfigResponse extends IRadioConfigResponse.Stub {
     * Response function for IRadioConfig.getSimSlotsStatus().
     */
    public void getSimSlotsStatusResponse(RadioResponseInfo responseInfo,
                                          ArrayList<SimSlotStatus> slotStatus) {
            ArrayList<android.hardware.radio.config.V1_0.SimSlotStatus> slotStatus) {
        RILRequest rr = mRadioConfig.processResponse(responseInfo);

        if (rr != null) {
@@ -63,6 +62,31 @@ public class RadioConfigResponse extends IRadioConfigResponse.Stub {
        }
    }

    /**
     * Response function for IRadioConfig.getSimSlotsStatus().
     */
    public void getSimSlotsStatusResponse_1_1(RadioResponseInfo responseInfo,
            ArrayList<android.hardware.radio.config.V1_1.SimSlotStatus> slotStatus) {
        RILRequest rr = mRadioConfig.processResponse(responseInfo);

        if (rr != null) {
            ArrayList<IccSlotStatus> ret = RadioConfig.convertHalSlotStatus_1_1(slotStatus);
            if (responseInfo.error == RadioError.NONE) {
                // send response
                RadioResponse.sendMessageResponse(rr.mResult, ret);
                Rlog.d(TAG, rr.serialString() + "< "
                        + mRadioConfig.requestToString(rr.mRequest) + " " + ret.toString());
            } else {
                rr.onError(responseInfo.error, ret);
                Rlog.e(TAG, rr.serialString() + "< "
                        + mRadioConfig.requestToString(rr.mRequest) + " error "
                        + responseInfo.error);
            }
        } else {
            Rlog.e(TAG, "getSimSlotsStatusResponse_1_1: Error " + responseInfo.toString());
        }
    }

    /**
     * Response function for IRadioConfig.setSimSlotsMapping().
     */
+5 −2
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ public class IccSlotStatus {
    public int        logicalSlotIndex;
    public String     atr;
    public String     iccid;
    public String     eid;

    /**
     * Set the cardState according to the input state.
@@ -80,7 +81,8 @@ public class IccSlotStatus {
                .append(slotState).append(",")
                .append("logicalSlotIndex=").append(logicalSlotIndex).append(",")
                .append("atr=").append(atr).append(",iccid=")
                .append(SubscriptionInfo.givePrintableIccid(iccid));
                .append(SubscriptionInfo.givePrintableIccid(iccid)).append(",")
                .append("eid=").append(eid);

        sb.append("}");
        return sb.toString();
@@ -100,7 +102,8 @@ public class IccSlotStatus {
                && (slotState == that.slotState)
                && (logicalSlotIndex == that.logicalSlotIndex)
                && (TextUtils.equals(atr, that.atr))
                && (TextUtils.equals(iccid, that.iccid));
                && (TextUtils.equals(iccid, that.iccid))
                && (TextUtils.equals(eid, that.eid));
    }

}