From: Qingxi Li Date: Wed, 7 Mar 2018 18:50:02 +0000 (-0800) Subject: Add API to check extended APDU Supported X-Git-Tag: android-x86-9.0-r1~178^2~10^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=346bddee19e15192890c2df41474ea19b2a3a3c3;p=android-x86%2Fframeworks-base.git Add API to check extended APDU Supported Add API UiccSlotInfo#getIsExtendedApduSupported Bug: 68999147 Test: TreeHugger & E2E Change-Id: Ia400a23c35332356deaa214861f6f5ffe47c8092 --- diff --git a/api/system-current.txt b/api/system-current.txt index 055526309093..716daa5eb9e2 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5242,12 +5242,13 @@ package android.telephony { } public class UiccSlotInfo implements android.os.Parcelable { - ctor public UiccSlotInfo(boolean, boolean, java.lang.String, int, int); + ctor public UiccSlotInfo(boolean, boolean, java.lang.String, int, int, boolean); method public int describeContents(); method public java.lang.String getCardId(); method public int getCardStateInfo(); method public boolean getIsActive(); method public boolean getIsEuicc(); + method public boolean getIsExtendedApduSupported(); method public int getLogicalSlotIdx(); method public void writeToParcel(android.os.Parcel, int); field public static final int CARD_STATE_INFO_ABSENT = 1; // 0x1 diff --git a/telephony/java/android/telephony/UiccSlotInfo.java b/telephony/java/android/telephony/UiccSlotInfo.java index 0c17147ca3fa..125161d62373 100644 --- a/telephony/java/android/telephony/UiccSlotInfo.java +++ b/telephony/java/android/telephony/UiccSlotInfo.java @@ -60,6 +60,7 @@ public class UiccSlotInfo implements Parcelable { private final String mCardId; private final @CardStateInfo int mCardStateInfo; private final int mLogicalSlotIdx; + private final boolean mIsExtendedApduSupported; public static final Creator CREATOR = new Creator() { @Override @@ -79,6 +80,7 @@ public class UiccSlotInfo implements Parcelable { mCardId = in.readString(); mCardStateInfo = in.readInt(); mLogicalSlotIdx = in.readInt(); + mIsExtendedApduSupported = in.readByte() != 0; } @Override @@ -88,6 +90,7 @@ public class UiccSlotInfo implements Parcelable { dest.writeString(mCardId); dest.writeInt(mCardStateInfo); dest.writeInt(mLogicalSlotIdx); + dest.writeByte((byte) (mIsExtendedApduSupported ? 1 : 0)); } @Override @@ -96,12 +99,13 @@ public class UiccSlotInfo implements Parcelable { } public UiccSlotInfo(boolean isActive, boolean isEuicc, String cardId, - @CardStateInfo int cardStateInfo, int logicalSlotIdx) { + @CardStateInfo int cardStateInfo, int logicalSlotIdx, boolean isExtendedApduSupported) { this.mIsActive = isActive; this.mIsEuicc = isEuicc; this.mCardId = cardId; this.mCardStateInfo = cardStateInfo; this.mLogicalSlotIdx = logicalSlotIdx; + this.mIsExtendedApduSupported = isExtendedApduSupported; } public boolean getIsActive() { @@ -125,6 +129,13 @@ public class UiccSlotInfo implements Parcelable { return mLogicalSlotIdx; } + /** + * @return {@code true} if this slot supports extended APDU from ATR, {@code false} otherwise. + */ + public boolean getIsExtendedApduSupported() { + return mIsExtendedApduSupported; + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -139,7 +150,8 @@ public class UiccSlotInfo implements Parcelable { && (mIsEuicc == that.mIsEuicc) && (mCardId == that.mCardId) && (mCardStateInfo == that.mCardStateInfo) - && (mLogicalSlotIdx == that.mLogicalSlotIdx); + && (mLogicalSlotIdx == that.mLogicalSlotIdx) + && (mIsExtendedApduSupported == that.mIsExtendedApduSupported); } @Override @@ -150,6 +162,7 @@ public class UiccSlotInfo implements Parcelable { result = 31 * result + Objects.hashCode(mCardId); result = 31 * result + mCardStateInfo; result = 31 * result + mLogicalSlotIdx; + result = 31 * result + (mIsExtendedApduSupported ? 1 : 0); return result; } @@ -165,6 +178,8 @@ public class UiccSlotInfo implements Parcelable { + mCardStateInfo + ", phoneId=" + mLogicalSlotIdx + + ", mIsExtendedApduSupported=" + + mIsExtendedApduSupported + ")"; } }