Loading src/java/com/android/internal/telephony/BaseCommands.java +12 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mVoiceRadioTechChangedRegistrants = new RegistrantList(); protected RegistrantList mImsNetworkStateChangedRegistrants = new RegistrantList(); protected RegistrantList mIccStatusChangedRegistrants = new RegistrantList(); protected RegistrantList mIccSlotStatusChangedRegistrants = new RegistrantList(); protected RegistrantList mVoicePrivacyOnRegistrants = new RegistrantList(); protected RegistrantList mVoicePrivacyOffRegistrants = new RegistrantList(); protected RegistrantList mOtaProvisionRegistrants = new RegistrantList(); Loading Loading @@ -281,6 +282,17 @@ public abstract class BaseCommands implements CommandsInterface { mIccStatusChangedRegistrants.remove(h); } @Override public void registerForIccSlotStatusChanged(Handler h, int what, Object obj) { Registrant r = new Registrant(h, what, obj); mIccSlotStatusChangedRegistrants.add(r); } @Override public void unregisterForIccSlotStatusChanged(Handler h) { mIccSlotStatusChangedRegistrants.remove(h); } @Override public void setOnNewGsmSms(Handler h, int what, Object obj) { mGsmSmsRegistrant = new Registrant (h, what, obj); Loading src/java/com/android/internal/telephony/CommandsInterface.java +20 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,10 @@ public interface CommandsInterface { */ void registerForIccStatusChanged(Handler h, int what, Object obj); void unregisterForIccStatusChanged(Handler h); /** Register for ICC slot status changed event */ void registerForIccSlotStatusChanged(Handler h, int what, Object obj); /** Unregister for ICC slot status changed event */ void unregisterForIccSlotStatusChanged(Handler h); void registerForCallStateChanged(Handler h, int what, Object obj); void unregisterForCallStateChanged(Handler h); Loading Loading @@ -1691,6 +1695,22 @@ public interface CommandsInterface { */ public void getIccCardStatus(Message result); /** * Request the status of all the physical UICC slots. * * @param result Callback message containing a {@link java.util.ArrayList} of * {@link com.android.internal.telephony.uicc.IccSlotStatus} instances for all the slots. */ void getIccSlotsStatus(Message result); /** * Set the mapping from logical slots to physical slots. * * @param physicalSlots Mapping from logical slots to physical slots. * @param result Callback message is empty on completion. */ void setLogicalToPhysicalSlotMapping(int[] physicalSlots, Message result); /** * Return if the current radio is LTE on CDMA. This * is a tri-state return value as for a period of time Loading src/java/com/android/internal/telephony/RIL.java +92 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo; import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; import com.android.internal.telephony.metrics.TelephonyMetrics; import com.android.internal.telephony.nano.TelephonyProto.SmsSession; import com.android.internal.telephony.uicc.IccSlotStatus; import com.android.internal.telephony.uicc.IccUtils; import java.io.ByteArrayInputStream; Loading Loading @@ -502,6 +503,69 @@ public class RIL extends BaseCommands implements CommandsInterface { } } @Override public void getIccSlotsStatus(Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { android.hardware.radio.V1_2.IRadio radioProxy12 = android.hardware.radio.V1_2.IRadio.castFrom(radioProxy); if (radioProxy12 == null) { if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } else { RILRequest rr = obtainRequest(RIL_REQUEST_GET_SLOT_STATUS, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } try { radioProxy12.getSimSlotsStatus(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getIccSlotStatus", e); } } } } @Override public void setLogicalToPhysicalSlotMapping(int[] physicalSlots, Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { android.hardware.radio.V1_2.IRadio radioProxy12 = android.hardware.radio.V1_2.IRadio.castFrom(radioProxy); if (radioProxy12 == null) { if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } else { ArrayList<Integer> mapping = new ArrayList<>(); for (int slot : physicalSlots) { mapping.add(new Integer(slot)); } RILRequest rr = obtainRequest(RIL_REQUEST_SET_LOGICAL_TO_PHYSICAL_SLOT_MAPPING, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } try { radioProxy12.setSimSlotsMapping(rr.mSerial, mapping); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "setLogicalToPhysicalSlotMapping", e); } } } } @Override public void supplyIccPin(String pin, Message result) { supplyIccPinForApp(pin, null, result); Loading Loading @@ -4661,6 +4725,10 @@ public class RIL extends BaseCommands implements CommandsInterface { return "RIL_REQUEST_START_NETWORK_SCAN"; case RIL_REQUEST_STOP_NETWORK_SCAN: return "RIL_REQUEST_STOP_NETWORK_SCAN"; case RIL_REQUEST_GET_SLOT_STATUS: return "RIL_REQUEST_GET_SLOT_STATUS"; case RIL_REQUEST_SET_LOGICAL_TO_PHYSICAL_SLOT_MAPPING: return "RIL_REQUEST_SET_LOGICAL_TO_PHYSICAL_SLOT_MAPPING"; default: return "<unknown request>"; } } Loading Loading @@ -4763,6 +4831,8 @@ public class RIL extends BaseCommands implements CommandsInterface { return "RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION"; case RIL_UNSOL_NETWORK_SCAN_RESULT: return "RIL_UNSOL_NETWORK_SCAN_RESULT"; case RIL_UNSOL_ICC_SLOT_STATUS: return "RIL_UNSOL_ICC_SLOT_STATUS"; default: return "<unknown response>"; } Loading Loading @@ -5001,6 +5071,28 @@ public class RIL extends BaseCommands implements CommandsInterface { p.writeInt(ber); } /** * Convert SlotsStatus defined in 1.2/types.hal to IccSlotStatus type. * @param slotsStatus SlotsStatus defined in 1.2/types.hal * @return Converted IccSlotStatus object */ @VisibleForTesting public static ArrayList<IccSlotStatus> convertHalSlotsStatus( ArrayList<android.hardware.radio.V1_2.SimSlotStatus> slotsStatus) { ArrayList<IccSlotStatus> iccSlotStatus = new ArrayList<IccSlotStatus>(slotsStatus.size()); for (android.hardware.radio.V1_2.SimSlotStatus slotStatus : slotsStatus) { IccSlotStatus iss = new IccSlotStatus(); iss.setCardState(slotStatus.cardState); iss.setSlotState(slotStatus.slotState); iss.logicalSlotIndex = slotStatus.logicalSlotId; iss.atr = slotStatus.atr; iss.iccid = slotStatus.iccid; iccSlotStatus.add(iss); } return iccSlotStatus; } /** * Convert CellInfo defined in 1.0/types.hal to CellInfo type. * @param records List of CellInfo defined in 1.0/types.hal Loading src/java/com/android/internal/telephony/RadioIndication.java +21 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static com.android.internal.telephony.RILConstants.RIL_UNSOL_DATA_CALL_LI import static com.android.internal.telephony.RILConstants.RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_HARDWARE_CONFIG_CHANGED; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_ICC_SLOT_STATUS; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_LCEDATA_RECV; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_MODEM_RESTART; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_NETWORK_SCAN_RESULT; Loading Loading @@ -80,8 +81,8 @@ import android.hardware.radio.V1_0.SimRefreshResult; import android.hardware.radio.V1_0.SsInfoData; import android.hardware.radio.V1_0.StkCcUnsolSsResult; import android.hardware.radio.V1_0.SuppSvcNotification; import android.hardware.radio.V1_1.IRadioIndication; import android.hardware.radio.V1_1.KeepaliveStatus; import android.hardware.radio.V1_2.IRadioIndication; import android.os.AsyncResult; import android.os.SystemProperties; import android.telephony.CellInfo; Loading @@ -97,6 +98,7 @@ import com.android.internal.telephony.gsm.SsData; import com.android.internal.telephony.gsm.SuppServiceNotification; import com.android.internal.telephony.nano.TelephonyProto.SmsSession; import com.android.internal.telephony.uicc.IccRefreshResponse; import com.android.internal.telephony.uicc.IccSlotStatus; import com.android.internal.telephony.uicc.IccUtils; import java.util.ArrayList; Loading Loading @@ -634,6 +636,23 @@ public class RadioIndication extends IRadioIndication.Stub { mRil.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, response, null)); } /** * Indicates a change of the ICC slot status * @param indicationType RadioIndicationType * @param slotsStatus ICC slot status */ public void simSlotsStatusChanged(int indicationType, ArrayList<android.hardware.radio.V1_2.SimSlotStatus> slotsStatus) { mRil.processIndication(indicationType); ArrayList<IccSlotStatus> iccSlotStatus = RIL.convertHalSlotsStatus(slotsStatus); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_ICC_SLOT_STATUS, iccSlotStatus); mRil.mIccStatusChangedRegistrants.notifyRegistrants( new AsyncResult(null, iccSlotStatus, null)); } /** Incremental network scan results */ public void networkScanResult(int indicationType, android.hardware.radio.V1_1.NetworkScanResult result) { Loading src/java/com/android/internal/telephony/RadioResponse.java +92 −29 Original line number Diff line number Diff line Loading @@ -33,8 +33,9 @@ import android.hardware.radio.V1_0.RadioResponseInfo; import android.hardware.radio.V1_0.SendSmsResult; import android.hardware.radio.V1_0.SetupDataCallResult; import android.hardware.radio.V1_0.VoiceRegStateResult; import android.hardware.radio.V1_1.IRadioResponse; import android.hardware.radio.V1_1.KeepaliveStatus; import android.hardware.radio.V1_2.IRadioResponse; import android.hardware.radio.V1_2.SimSlotStatus; import android.os.AsyncResult; import android.os.Message; import android.os.SystemClock; Loading @@ -53,6 +54,7 @@ import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; import com.android.internal.telephony.uicc.IccCardApplicationStatus; import com.android.internal.telephony.uicc.IccCardStatus; import com.android.internal.telephony.uicc.IccIoResult; import com.android.internal.telephony.uicc.IccSlotStatus; import com.android.internal.telephony.uicc.IccUtils; import java.util.ArrayList; Loading Loading @@ -103,6 +105,31 @@ public class RadioResponse extends IRadioResponse.Stub { responseIccCardStatus(responseInfo, cardStatus); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param cardStatus ICC card status as defined by CardStatus in 1.2/types.hal */ public void getIccCardStatusResponse_1_2(RadioResponseInfo responseInfo, android.hardware.radio.V1_2.CardStatus cardStatus) { responseIccCardStatus_1_2(responseInfo, cardStatus); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param slotsStatus ICC slot status as defined by SlotsStatus in 1.2/types.hal */ public void getSimSlotsStatusResponse(RadioResponseInfo responseInfo, ArrayList<SimSlotStatus> slotsStatus) { responseIccSlotStatus(responseInfo, slotsStatus); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setSimSlotsMappingResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param remainingAttempts Number of retries remaining, must be equal to -1 if unknown. Loading Loading @@ -1241,10 +1268,7 @@ public class RadioResponse extends IRadioResponse.Stub { throw new UnsupportedOperationException("stopKeepaliveResponse not implemented"); } private void responseIccCardStatus(RadioResponseInfo responseInfo, CardStatus cardStatus) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { private IccCardStatus convertHalCardStatus(CardStatus cardStatus) { IccCardStatus iccCardStatus = new IccCardStatus(); iccCardStatus.setCardState(cardStatus.cardState); iccCardStatus.setUniversalPinState(cardStatus.universalPinState); Loading Loading @@ -1274,6 +1298,31 @@ public class RadioResponse extends IRadioResponse.Stub { appStatus.pin2 = appStatus.PinStateFromRILInt(rilAppStatus.pin2); iccCardStatus.mApplications[i] = appStatus; } return iccCardStatus; } private void responseIccCardStatus(RadioResponseInfo responseInfo, CardStatus cardStatus) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { IccCardStatus iccCardStatus = convertHalCardStatus(cardStatus); mRil.riljLog("responseIccCardStatus: from HIDL: " + iccCardStatus); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, iccCardStatus); } mRil.processResponseDone(rr, responseInfo, iccCardStatus); } } private void responseIccCardStatus_1_2(RadioResponseInfo responseInfo, android.hardware.radio.V1_2.CardStatus cardStatus) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { IccCardStatus iccCardStatus = convertHalCardStatus(cardStatus.base); iccCardStatus.physicalSlotIndex = cardStatus.physicalSlotId; iccCardStatus.atr = cardStatus.atr; iccCardStatus.iccid = cardStatus.iccid; mRil.riljLog("responseIccCardStatus: from HIDL: " + iccCardStatus); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, iccCardStatus); Loading @@ -1282,6 +1331,20 @@ public class RadioResponse extends IRadioResponse.Stub { } } private void responseIccSlotStatus(RadioResponseInfo responseInfo, ArrayList<SimSlotStatus> slotsStatus) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { ArrayList<IccSlotStatus> iccSlotStatus = RIL.convertHalSlotsStatus(slotsStatus); mRil.riljLog("responseIccSlotStatus: from HIDL: " + iccSlotStatus); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, iccSlotStatus); } mRil.processResponseDone(rr, responseInfo, iccSlotStatus); } } private void responseInts(RadioResponseInfo responseInfo, int ...var) { final ArrayList<Integer> ints = new ArrayList<>(); for (int i = 0; i < var.length; i++) { Loading Loading
src/java/com/android/internal/telephony/BaseCommands.java +12 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mVoiceRadioTechChangedRegistrants = new RegistrantList(); protected RegistrantList mImsNetworkStateChangedRegistrants = new RegistrantList(); protected RegistrantList mIccStatusChangedRegistrants = new RegistrantList(); protected RegistrantList mIccSlotStatusChangedRegistrants = new RegistrantList(); protected RegistrantList mVoicePrivacyOnRegistrants = new RegistrantList(); protected RegistrantList mVoicePrivacyOffRegistrants = new RegistrantList(); protected RegistrantList mOtaProvisionRegistrants = new RegistrantList(); Loading Loading @@ -281,6 +282,17 @@ public abstract class BaseCommands implements CommandsInterface { mIccStatusChangedRegistrants.remove(h); } @Override public void registerForIccSlotStatusChanged(Handler h, int what, Object obj) { Registrant r = new Registrant(h, what, obj); mIccSlotStatusChangedRegistrants.add(r); } @Override public void unregisterForIccSlotStatusChanged(Handler h) { mIccSlotStatusChangedRegistrants.remove(h); } @Override public void setOnNewGsmSms(Handler h, int what, Object obj) { mGsmSmsRegistrant = new Registrant (h, what, obj); Loading
src/java/com/android/internal/telephony/CommandsInterface.java +20 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,10 @@ public interface CommandsInterface { */ void registerForIccStatusChanged(Handler h, int what, Object obj); void unregisterForIccStatusChanged(Handler h); /** Register for ICC slot status changed event */ void registerForIccSlotStatusChanged(Handler h, int what, Object obj); /** Unregister for ICC slot status changed event */ void unregisterForIccSlotStatusChanged(Handler h); void registerForCallStateChanged(Handler h, int what, Object obj); void unregisterForCallStateChanged(Handler h); Loading Loading @@ -1691,6 +1695,22 @@ public interface CommandsInterface { */ public void getIccCardStatus(Message result); /** * Request the status of all the physical UICC slots. * * @param result Callback message containing a {@link java.util.ArrayList} of * {@link com.android.internal.telephony.uicc.IccSlotStatus} instances for all the slots. */ void getIccSlotsStatus(Message result); /** * Set the mapping from logical slots to physical slots. * * @param physicalSlots Mapping from logical slots to physical slots. * @param result Callback message is empty on completion. */ void setLogicalToPhysicalSlotMapping(int[] physicalSlots, Message result); /** * Return if the current radio is LTE on CDMA. This * is a tri-state return value as for a period of time Loading
src/java/com/android/internal/telephony/RIL.java +92 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo; import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; import com.android.internal.telephony.metrics.TelephonyMetrics; import com.android.internal.telephony.nano.TelephonyProto.SmsSession; import com.android.internal.telephony.uicc.IccSlotStatus; import com.android.internal.telephony.uicc.IccUtils; import java.io.ByteArrayInputStream; Loading Loading @@ -502,6 +503,69 @@ public class RIL extends BaseCommands implements CommandsInterface { } } @Override public void getIccSlotsStatus(Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { android.hardware.radio.V1_2.IRadio radioProxy12 = android.hardware.radio.V1_2.IRadio.castFrom(radioProxy); if (radioProxy12 == null) { if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } else { RILRequest rr = obtainRequest(RIL_REQUEST_GET_SLOT_STATUS, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } try { radioProxy12.getSimSlotsStatus(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getIccSlotStatus", e); } } } } @Override public void setLogicalToPhysicalSlotMapping(int[] physicalSlots, Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { android.hardware.radio.V1_2.IRadio radioProxy12 = android.hardware.radio.V1_2.IRadio.castFrom(radioProxy); if (radioProxy12 == null) { if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } else { ArrayList<Integer> mapping = new ArrayList<>(); for (int slot : physicalSlots) { mapping.add(new Integer(slot)); } RILRequest rr = obtainRequest(RIL_REQUEST_SET_LOGICAL_TO_PHYSICAL_SLOT_MAPPING, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } try { radioProxy12.setSimSlotsMapping(rr.mSerial, mapping); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "setLogicalToPhysicalSlotMapping", e); } } } } @Override public void supplyIccPin(String pin, Message result) { supplyIccPinForApp(pin, null, result); Loading Loading @@ -4661,6 +4725,10 @@ public class RIL extends BaseCommands implements CommandsInterface { return "RIL_REQUEST_START_NETWORK_SCAN"; case RIL_REQUEST_STOP_NETWORK_SCAN: return "RIL_REQUEST_STOP_NETWORK_SCAN"; case RIL_REQUEST_GET_SLOT_STATUS: return "RIL_REQUEST_GET_SLOT_STATUS"; case RIL_REQUEST_SET_LOGICAL_TO_PHYSICAL_SLOT_MAPPING: return "RIL_REQUEST_SET_LOGICAL_TO_PHYSICAL_SLOT_MAPPING"; default: return "<unknown request>"; } } Loading Loading @@ -4763,6 +4831,8 @@ public class RIL extends BaseCommands implements CommandsInterface { return "RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION"; case RIL_UNSOL_NETWORK_SCAN_RESULT: return "RIL_UNSOL_NETWORK_SCAN_RESULT"; case RIL_UNSOL_ICC_SLOT_STATUS: return "RIL_UNSOL_ICC_SLOT_STATUS"; default: return "<unknown response>"; } Loading Loading @@ -5001,6 +5071,28 @@ public class RIL extends BaseCommands implements CommandsInterface { p.writeInt(ber); } /** * Convert SlotsStatus defined in 1.2/types.hal to IccSlotStatus type. * @param slotsStatus SlotsStatus defined in 1.2/types.hal * @return Converted IccSlotStatus object */ @VisibleForTesting public static ArrayList<IccSlotStatus> convertHalSlotsStatus( ArrayList<android.hardware.radio.V1_2.SimSlotStatus> slotsStatus) { ArrayList<IccSlotStatus> iccSlotStatus = new ArrayList<IccSlotStatus>(slotsStatus.size()); for (android.hardware.radio.V1_2.SimSlotStatus slotStatus : slotsStatus) { IccSlotStatus iss = new IccSlotStatus(); iss.setCardState(slotStatus.cardState); iss.setSlotState(slotStatus.slotState); iss.logicalSlotIndex = slotStatus.logicalSlotId; iss.atr = slotStatus.atr; iss.iccid = slotStatus.iccid; iccSlotStatus.add(iss); } return iccSlotStatus; } /** * Convert CellInfo defined in 1.0/types.hal to CellInfo type. * @param records List of CellInfo defined in 1.0/types.hal Loading
src/java/com/android/internal/telephony/RadioIndication.java +21 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static com.android.internal.telephony.RILConstants.RIL_UNSOL_DATA_CALL_LI import static com.android.internal.telephony.RILConstants.RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_HARDWARE_CONFIG_CHANGED; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_ICC_SLOT_STATUS; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_LCEDATA_RECV; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_MODEM_RESTART; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_NETWORK_SCAN_RESULT; Loading Loading @@ -80,8 +81,8 @@ import android.hardware.radio.V1_0.SimRefreshResult; import android.hardware.radio.V1_0.SsInfoData; import android.hardware.radio.V1_0.StkCcUnsolSsResult; import android.hardware.radio.V1_0.SuppSvcNotification; import android.hardware.radio.V1_1.IRadioIndication; import android.hardware.radio.V1_1.KeepaliveStatus; import android.hardware.radio.V1_2.IRadioIndication; import android.os.AsyncResult; import android.os.SystemProperties; import android.telephony.CellInfo; Loading @@ -97,6 +98,7 @@ import com.android.internal.telephony.gsm.SsData; import com.android.internal.telephony.gsm.SuppServiceNotification; import com.android.internal.telephony.nano.TelephonyProto.SmsSession; import com.android.internal.telephony.uicc.IccRefreshResponse; import com.android.internal.telephony.uicc.IccSlotStatus; import com.android.internal.telephony.uicc.IccUtils; import java.util.ArrayList; Loading Loading @@ -634,6 +636,23 @@ public class RadioIndication extends IRadioIndication.Stub { mRil.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, response, null)); } /** * Indicates a change of the ICC slot status * @param indicationType RadioIndicationType * @param slotsStatus ICC slot status */ public void simSlotsStatusChanged(int indicationType, ArrayList<android.hardware.radio.V1_2.SimSlotStatus> slotsStatus) { mRil.processIndication(indicationType); ArrayList<IccSlotStatus> iccSlotStatus = RIL.convertHalSlotsStatus(slotsStatus); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_ICC_SLOT_STATUS, iccSlotStatus); mRil.mIccStatusChangedRegistrants.notifyRegistrants( new AsyncResult(null, iccSlotStatus, null)); } /** Incremental network scan results */ public void networkScanResult(int indicationType, android.hardware.radio.V1_1.NetworkScanResult result) { Loading
src/java/com/android/internal/telephony/RadioResponse.java +92 −29 Original line number Diff line number Diff line Loading @@ -33,8 +33,9 @@ import android.hardware.radio.V1_0.RadioResponseInfo; import android.hardware.radio.V1_0.SendSmsResult; import android.hardware.radio.V1_0.SetupDataCallResult; import android.hardware.radio.V1_0.VoiceRegStateResult; import android.hardware.radio.V1_1.IRadioResponse; import android.hardware.radio.V1_1.KeepaliveStatus; import android.hardware.radio.V1_2.IRadioResponse; import android.hardware.radio.V1_2.SimSlotStatus; import android.os.AsyncResult; import android.os.Message; import android.os.SystemClock; Loading @@ -53,6 +54,7 @@ import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; import com.android.internal.telephony.uicc.IccCardApplicationStatus; import com.android.internal.telephony.uicc.IccCardStatus; import com.android.internal.telephony.uicc.IccIoResult; import com.android.internal.telephony.uicc.IccSlotStatus; import com.android.internal.telephony.uicc.IccUtils; import java.util.ArrayList; Loading Loading @@ -103,6 +105,31 @@ public class RadioResponse extends IRadioResponse.Stub { responseIccCardStatus(responseInfo, cardStatus); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param cardStatus ICC card status as defined by CardStatus in 1.2/types.hal */ public void getIccCardStatusResponse_1_2(RadioResponseInfo responseInfo, android.hardware.radio.V1_2.CardStatus cardStatus) { responseIccCardStatus_1_2(responseInfo, cardStatus); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param slotsStatus ICC slot status as defined by SlotsStatus in 1.2/types.hal */ public void getSimSlotsStatusResponse(RadioResponseInfo responseInfo, ArrayList<SimSlotStatus> slotsStatus) { responseIccSlotStatus(responseInfo, slotsStatus); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setSimSlotsMappingResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param remainingAttempts Number of retries remaining, must be equal to -1 if unknown. Loading Loading @@ -1241,10 +1268,7 @@ public class RadioResponse extends IRadioResponse.Stub { throw new UnsupportedOperationException("stopKeepaliveResponse not implemented"); } private void responseIccCardStatus(RadioResponseInfo responseInfo, CardStatus cardStatus) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { private IccCardStatus convertHalCardStatus(CardStatus cardStatus) { IccCardStatus iccCardStatus = new IccCardStatus(); iccCardStatus.setCardState(cardStatus.cardState); iccCardStatus.setUniversalPinState(cardStatus.universalPinState); Loading Loading @@ -1274,6 +1298,31 @@ public class RadioResponse extends IRadioResponse.Stub { appStatus.pin2 = appStatus.PinStateFromRILInt(rilAppStatus.pin2); iccCardStatus.mApplications[i] = appStatus; } return iccCardStatus; } private void responseIccCardStatus(RadioResponseInfo responseInfo, CardStatus cardStatus) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { IccCardStatus iccCardStatus = convertHalCardStatus(cardStatus); mRil.riljLog("responseIccCardStatus: from HIDL: " + iccCardStatus); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, iccCardStatus); } mRil.processResponseDone(rr, responseInfo, iccCardStatus); } } private void responseIccCardStatus_1_2(RadioResponseInfo responseInfo, android.hardware.radio.V1_2.CardStatus cardStatus) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { IccCardStatus iccCardStatus = convertHalCardStatus(cardStatus.base); iccCardStatus.physicalSlotIndex = cardStatus.physicalSlotId; iccCardStatus.atr = cardStatus.atr; iccCardStatus.iccid = cardStatus.iccid; mRil.riljLog("responseIccCardStatus: from HIDL: " + iccCardStatus); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, iccCardStatus); Loading @@ -1282,6 +1331,20 @@ public class RadioResponse extends IRadioResponse.Stub { } } private void responseIccSlotStatus(RadioResponseInfo responseInfo, ArrayList<SimSlotStatus> slotsStatus) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { ArrayList<IccSlotStatus> iccSlotStatus = RIL.convertHalSlotsStatus(slotsStatus); mRil.riljLog("responseIccSlotStatus: from HIDL: " + iccSlotStatus); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, iccSlotStatus); } mRil.processResponseDone(rr, responseInfo, iccSlotStatus); } } private void responseInts(RadioResponseInfo responseInfo, int ...var) { final ArrayList<Integer> ints = new ArrayList<>(); for (int i = 0; i < var.length; i++) { Loading