Loading src/java/com/android/internal/telephony/CommandsInterface.java +21 −0 Original line number Diff line number Diff line Loading @@ -2140,6 +2140,27 @@ public interface CommandsInterface { public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message response); /** * Exchange APDUs with the SIM on a logical channel. * * Input parameters equivalent to TS 27.007 AT+CGLA command. * * @param channel Channel id of the channel to use for communication. Has to * be greater than zero. * @param cla Class of the APDU command. * @param instruction Instruction of the APDU command. * @param p1 P1 value of the APDU command. * @param p2 P2 value of the APDU command. * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU * is sent to the SIM. * @param data Data to be sent with the APDU. * @param isEs10Command whether APDU command is an ES10 command or a regular APDU * @param response Callback message. response.obj.userObj will be * an IccIoResult on success. */ void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, boolean isEs10Command, Message response); /** * Exchange APDUs with the SIM on a basic channel. * Loading src/java/com/android/internal/telephony/RIL.java +8 −1 Original line number Diff line number Diff line Loading @@ -4112,6 +4112,12 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message result) { iccTransmitApduLogicalChannel(channel, cla, instruction, p1, p2, p3, data, false, result); } @Override public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, boolean isEs10Command, Message result) { if (channel <= 0) { throw new RuntimeException( "Invalid channel in iccTransmitApduLogicalChannel: " + channel); Loading @@ -4128,6 +4134,7 @@ public class RIL extends BaseCommands implements CommandsInterface { + String.format(" channel = %d", channel) + String.format(" cla = 0x%02X ins = 0x%02X", cla, instruction) + String.format(" p1 = 0x%02X p2 = 0x%02X p3 = 0x%02X", p1, p2, p3) + " isEs10Command = " + isEs10Command + " data = " + data); } else { riljLog(rr.serialString() + "> " + RILUtils.requestToString(rr.mRequest)); Loading @@ -4136,7 +4143,7 @@ public class RIL extends BaseCommands implements CommandsInterface { try { simProxy.iccTransmitApduLogicalChannel( rr.mSerial, channel, cla, instruction, p1, p2, p3, data); rr.mSerial, channel, cla, instruction, p1, p2, p3, data, isEs10Command); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(HAL_SERVICE_SIM, "iccTransmitApduLogicalChannel", e); } Loading src/java/com/android/internal/telephony/RILUtils.java +14 −3 Original line number Diff line number Diff line Loading @@ -374,6 +374,7 @@ import com.android.internal.telephony.uicc.IccSimPortInfo; import com.android.internal.telephony.uicc.IccSlotPortMapping; import com.android.internal.telephony.uicc.IccSlotStatus; import com.android.internal.telephony.uicc.IccUtils; import com.android.internal.telephony.uicc.PortUtils; import com.android.internal.telephony.uicc.SimPhonebookRecord; import com.android.telephony.Rlog; Loading Loading @@ -1828,10 +1829,12 @@ public class RILUtils { * @param p2 p2 * @param p3 p3 * @param data data * @param radioHalVersion radio hal version * @return The converted SimApdu */ public static android.hardware.radio.sim.SimApdu convertToHalSimApduAidl(int channel, int cla, int instruction, int p1, int p2, int p3, String data) { int instruction, int p1, int p2, int p3, String data, boolean isEs10Command, HalVersion radioHalVersion) { android.hardware.radio.sim.SimApdu msg = new android.hardware.radio.sim.SimApdu(); msg.sessionId = channel; msg.cla = cla; Loading @@ -1840,6 +1843,9 @@ public class RILUtils { msg.p2 = p2; msg.p3 = p3; msg.data = convertNullToEmptyString(data); if (radioHalVersion.greaterOrEqual(RIL.RADIO_HAL_VERSION_2_1)) { msg.isEs10 = isEs10Command; } return msg; } Loading Loading @@ -4359,6 +4365,7 @@ public class RILUtils { android.hardware.radio.sim.CardStatus cardStatus) { IccCardStatus iccCardStatus = new IccCardStatus(); iccCardStatus.setCardState(cardStatus.cardState); iccCardStatus.setMultipleEnabledProfilesMode(cardStatus.supportedMepMode); iccCardStatus.setUniversalPinState(cardStatus.universalPinState); iccCardStatus.mGsmUmtsSubscriptionAppIndex = cardStatus.gsmUmtsSubscriptionAppIndex; iccCardStatus.mCdmaSubscriptionAppIndex = cardStatus.cdmaSubscriptionAppIndex; Loading Loading @@ -4386,7 +4393,9 @@ public class RILUtils { } IccSlotPortMapping slotPortMapping = new IccSlotPortMapping(); slotPortMapping.mPhysicalSlotIndex = cardStatus.slotMap.physicalSlotId; slotPortMapping.mPortIndex = cardStatus.slotMap.portId; slotPortMapping.mPortIndex = PortUtils.convertFromHalPortIndex( cardStatus.slotMap.physicalSlotId, cardStatus.slotMap.portId, iccCardStatus.mCardState, iccCardStatus.mSupportedMepMode); iccCardStatus.mSlotPortMapping = slotPortMapping; return iccCardStatus; } Loading Loading @@ -4502,6 +4511,7 @@ public class RILUtils { } iccSlotStatus.atr = slotStatus.atr; iccSlotStatus.eid = slotStatus.eid; iccSlotStatus.setMultipleEnabledProfilesMode(slotStatus.supportedMepMode); response.add(iccSlotStatus); } return response; Loading Loading @@ -4569,7 +4579,8 @@ public class RILUtils { int logicalSlotIdx = mapping.getLogicalSlotIndex(); res[logicalSlotIdx] = new android.hardware.radio.config.SlotPortMapping(); res[logicalSlotIdx].physicalSlotId = mapping.getPhysicalSlotIndex(); res[logicalSlotIdx].portId = mapping.getPortIndex(); res[logicalSlotIdx].portId = PortUtils.convertToHalPortIndex( mapping.getPhysicalSlotIndex(), mapping.getPortIndex()); } return res; } Loading src/java/com/android/internal/telephony/RadioSimProxy.java +25 −2 Original line number Diff line number Diff line Loading @@ -53,6 +53,9 @@ public class RadioSimProxy extends RadioServiceProxy { HalVersion newHalVersion; int version = sim.getInterfaceVersion(); switch(version) { case 2: newHalVersion = RIL.RADIO_HAL_VERSION_2_1; break; default: newHalVersion = RIL.RADIO_HAL_VERSION_2_0; break; Loading Loading @@ -373,7 +376,8 @@ public class RadioSimProxy extends RadioServiceProxy { if (isEmpty()) return; if (isAidl()) { mSimProxy.iccTransmitApduBasicChannel(serial, RILUtils.convertToHalSimApduAidl(0, cla, instruction, p1, p2, p3, data)); RILUtils.convertToHalSimApduAidl(0, cla, instruction, p1, p2, p3, data, false, mHalVersion)); } else { mRadioProxy.iccTransmitApduBasicChannel(serial, RILUtils.convertToHalSimApdu(0, cla, instruction, p1, p2, p3, data)); Loading @@ -394,10 +398,29 @@ public class RadioSimProxy extends RadioServiceProxy { */ public void iccTransmitApduLogicalChannel(int serial, int channel, int cla, int instruction, int p1, int p2, int p3, String data) throws RemoteException { iccTransmitApduLogicalChannel(serial, channel, cla, instruction, p1, p2, p3, data, false); } /** * Call IRadioSim#iccTransmitApduLogicalChannel * @param serial Serial number of request * @param channel Channel ID of the channel to use for communication * @param cla Class of the command * @param instruction Instruction of the command * @param p1 P1 value of the command * @param p2 P2 value of the command * @param p3 P3 value of the command * @param data Data to be sent * @param isEs10Command APDU is an isEs10 command or not * @throws RemoteException */ public void iccTransmitApduLogicalChannel(int serial, int channel, int cla, int instruction, int p1, int p2, int p3, String data, boolean isEs10Command) throws RemoteException { if (isEmpty()) return; if (isAidl()) { mSimProxy.iccTransmitApduLogicalChannel(serial, RILUtils.convertToHalSimApduAidl(channel, cla, instruction, p1, p2, p3, data)); RILUtils.convertToHalSimApduAidl(channel, cla, instruction, p1, p2, p3, data, isEs10Command, mHalVersion)); } else { mRadioProxy.iccTransmitApduLogicalChannel(serial, RILUtils.convertToHalSimApdu(channel, cla, instruction, p1, p2, p3, data)); Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCommandInterface.java +6 −0 Original line number Diff line number Diff line Loading @@ -613,6 +613,12 @@ class ImsPhoneCommandInterface extends BaseCommands implements CommandsInterface public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message response) {} @Override public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, boolean isEs10Command, Message response) {} @Override public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, String data, Message response) {} Loading Loading
src/java/com/android/internal/telephony/CommandsInterface.java +21 −0 Original line number Diff line number Diff line Loading @@ -2140,6 +2140,27 @@ public interface CommandsInterface { public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message response); /** * Exchange APDUs with the SIM on a logical channel. * * Input parameters equivalent to TS 27.007 AT+CGLA command. * * @param channel Channel id of the channel to use for communication. Has to * be greater than zero. * @param cla Class of the APDU command. * @param instruction Instruction of the APDU command. * @param p1 P1 value of the APDU command. * @param p2 P2 value of the APDU command. * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU * is sent to the SIM. * @param data Data to be sent with the APDU. * @param isEs10Command whether APDU command is an ES10 command or a regular APDU * @param response Callback message. response.obj.userObj will be * an IccIoResult on success. */ void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, boolean isEs10Command, Message response); /** * Exchange APDUs with the SIM on a basic channel. * Loading
src/java/com/android/internal/telephony/RIL.java +8 −1 Original line number Diff line number Diff line Loading @@ -4112,6 +4112,12 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message result) { iccTransmitApduLogicalChannel(channel, cla, instruction, p1, p2, p3, data, false, result); } @Override public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, boolean isEs10Command, Message result) { if (channel <= 0) { throw new RuntimeException( "Invalid channel in iccTransmitApduLogicalChannel: " + channel); Loading @@ -4128,6 +4134,7 @@ public class RIL extends BaseCommands implements CommandsInterface { + String.format(" channel = %d", channel) + String.format(" cla = 0x%02X ins = 0x%02X", cla, instruction) + String.format(" p1 = 0x%02X p2 = 0x%02X p3 = 0x%02X", p1, p2, p3) + " isEs10Command = " + isEs10Command + " data = " + data); } else { riljLog(rr.serialString() + "> " + RILUtils.requestToString(rr.mRequest)); Loading @@ -4136,7 +4143,7 @@ public class RIL extends BaseCommands implements CommandsInterface { try { simProxy.iccTransmitApduLogicalChannel( rr.mSerial, channel, cla, instruction, p1, p2, p3, data); rr.mSerial, channel, cla, instruction, p1, p2, p3, data, isEs10Command); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(HAL_SERVICE_SIM, "iccTransmitApduLogicalChannel", e); } Loading
src/java/com/android/internal/telephony/RILUtils.java +14 −3 Original line number Diff line number Diff line Loading @@ -374,6 +374,7 @@ import com.android.internal.telephony.uicc.IccSimPortInfo; import com.android.internal.telephony.uicc.IccSlotPortMapping; import com.android.internal.telephony.uicc.IccSlotStatus; import com.android.internal.telephony.uicc.IccUtils; import com.android.internal.telephony.uicc.PortUtils; import com.android.internal.telephony.uicc.SimPhonebookRecord; import com.android.telephony.Rlog; Loading Loading @@ -1828,10 +1829,12 @@ public class RILUtils { * @param p2 p2 * @param p3 p3 * @param data data * @param radioHalVersion radio hal version * @return The converted SimApdu */ public static android.hardware.radio.sim.SimApdu convertToHalSimApduAidl(int channel, int cla, int instruction, int p1, int p2, int p3, String data) { int instruction, int p1, int p2, int p3, String data, boolean isEs10Command, HalVersion radioHalVersion) { android.hardware.radio.sim.SimApdu msg = new android.hardware.radio.sim.SimApdu(); msg.sessionId = channel; msg.cla = cla; Loading @@ -1840,6 +1843,9 @@ public class RILUtils { msg.p2 = p2; msg.p3 = p3; msg.data = convertNullToEmptyString(data); if (radioHalVersion.greaterOrEqual(RIL.RADIO_HAL_VERSION_2_1)) { msg.isEs10 = isEs10Command; } return msg; } Loading Loading @@ -4359,6 +4365,7 @@ public class RILUtils { android.hardware.radio.sim.CardStatus cardStatus) { IccCardStatus iccCardStatus = new IccCardStatus(); iccCardStatus.setCardState(cardStatus.cardState); iccCardStatus.setMultipleEnabledProfilesMode(cardStatus.supportedMepMode); iccCardStatus.setUniversalPinState(cardStatus.universalPinState); iccCardStatus.mGsmUmtsSubscriptionAppIndex = cardStatus.gsmUmtsSubscriptionAppIndex; iccCardStatus.mCdmaSubscriptionAppIndex = cardStatus.cdmaSubscriptionAppIndex; Loading Loading @@ -4386,7 +4393,9 @@ public class RILUtils { } IccSlotPortMapping slotPortMapping = new IccSlotPortMapping(); slotPortMapping.mPhysicalSlotIndex = cardStatus.slotMap.physicalSlotId; slotPortMapping.mPortIndex = cardStatus.slotMap.portId; slotPortMapping.mPortIndex = PortUtils.convertFromHalPortIndex( cardStatus.slotMap.physicalSlotId, cardStatus.slotMap.portId, iccCardStatus.mCardState, iccCardStatus.mSupportedMepMode); iccCardStatus.mSlotPortMapping = slotPortMapping; return iccCardStatus; } Loading Loading @@ -4502,6 +4511,7 @@ public class RILUtils { } iccSlotStatus.atr = slotStatus.atr; iccSlotStatus.eid = slotStatus.eid; iccSlotStatus.setMultipleEnabledProfilesMode(slotStatus.supportedMepMode); response.add(iccSlotStatus); } return response; Loading Loading @@ -4569,7 +4579,8 @@ public class RILUtils { int logicalSlotIdx = mapping.getLogicalSlotIndex(); res[logicalSlotIdx] = new android.hardware.radio.config.SlotPortMapping(); res[logicalSlotIdx].physicalSlotId = mapping.getPhysicalSlotIndex(); res[logicalSlotIdx].portId = mapping.getPortIndex(); res[logicalSlotIdx].portId = PortUtils.convertToHalPortIndex( mapping.getPhysicalSlotIndex(), mapping.getPortIndex()); } return res; } Loading
src/java/com/android/internal/telephony/RadioSimProxy.java +25 −2 Original line number Diff line number Diff line Loading @@ -53,6 +53,9 @@ public class RadioSimProxy extends RadioServiceProxy { HalVersion newHalVersion; int version = sim.getInterfaceVersion(); switch(version) { case 2: newHalVersion = RIL.RADIO_HAL_VERSION_2_1; break; default: newHalVersion = RIL.RADIO_HAL_VERSION_2_0; break; Loading Loading @@ -373,7 +376,8 @@ public class RadioSimProxy extends RadioServiceProxy { if (isEmpty()) return; if (isAidl()) { mSimProxy.iccTransmitApduBasicChannel(serial, RILUtils.convertToHalSimApduAidl(0, cla, instruction, p1, p2, p3, data)); RILUtils.convertToHalSimApduAidl(0, cla, instruction, p1, p2, p3, data, false, mHalVersion)); } else { mRadioProxy.iccTransmitApduBasicChannel(serial, RILUtils.convertToHalSimApdu(0, cla, instruction, p1, p2, p3, data)); Loading @@ -394,10 +398,29 @@ public class RadioSimProxy extends RadioServiceProxy { */ public void iccTransmitApduLogicalChannel(int serial, int channel, int cla, int instruction, int p1, int p2, int p3, String data) throws RemoteException { iccTransmitApduLogicalChannel(serial, channel, cla, instruction, p1, p2, p3, data, false); } /** * Call IRadioSim#iccTransmitApduLogicalChannel * @param serial Serial number of request * @param channel Channel ID of the channel to use for communication * @param cla Class of the command * @param instruction Instruction of the command * @param p1 P1 value of the command * @param p2 P2 value of the command * @param p3 P3 value of the command * @param data Data to be sent * @param isEs10Command APDU is an isEs10 command or not * @throws RemoteException */ public void iccTransmitApduLogicalChannel(int serial, int channel, int cla, int instruction, int p1, int p2, int p3, String data, boolean isEs10Command) throws RemoteException { if (isEmpty()) return; if (isAidl()) { mSimProxy.iccTransmitApduLogicalChannel(serial, RILUtils.convertToHalSimApduAidl(channel, cla, instruction, p1, p2, p3, data)); RILUtils.convertToHalSimApduAidl(channel, cla, instruction, p1, p2, p3, data, isEs10Command, mHalVersion)); } else { mRadioProxy.iccTransmitApduLogicalChannel(serial, RILUtils.convertToHalSimApdu(channel, cla, instruction, p1, p2, p3, data)); Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCommandInterface.java +6 −0 Original line number Diff line number Diff line Loading @@ -613,6 +613,12 @@ class ImsPhoneCommandInterface extends BaseCommands implements CommandsInterface public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message response) {} @Override public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, boolean isEs10Command, Message response) {} @Override public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, String data, Message response) {} Loading