Merge "Implement isRemovable"

am: eee18bd546

Change-Id: I86f43209be67cf3b93ac3fc1c3059d1967ff5972
This commit is contained in:
Jordan Liu
2019-02-27 12:55:16 -08:00
committed by android-build-merger
6 changed files with 88 additions and 10 deletions

View File

@@ -43238,13 +43238,13 @@ package android.telephony {
}
public final class UiccCardInfo implements android.os.Parcelable {
ctor public UiccCardInfo(boolean, int, String, String, int);
method public int describeContents();
method public int getCardId();
method public String getEid();
method public String getIccId();
method public int getSlotIndex();
method public boolean isEuicc();
method public boolean isRemovable();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.telephony.UiccCardInfo> CREATOR;
}

View File

@@ -6476,7 +6476,7 @@ package android.telephony {
}
public class UiccSlotInfo implements android.os.Parcelable {
ctor public UiccSlotInfo(boolean, boolean, String, int, int, boolean);
ctor @Deprecated public UiccSlotInfo(boolean, boolean, String, int, int, boolean);
method public int describeContents();
method public String getCardId();
method public int getCardStateInfo();
@@ -6484,6 +6484,7 @@ package android.telephony {
method public boolean getIsEuicc();
method public boolean getIsExtendedApduSupported();
method public int getLogicalSlotIdx();
method public boolean isRemovable();
method public void writeToParcel(android.os.Parcel, int);
field public static final int CARD_STATE_INFO_ABSENT = 1; // 0x1
field public static final int CARD_STATE_INFO_ERROR = 3; // 0x3

View File

@@ -185,4 +185,20 @@
<item>@string/app_info</item>
</string-array>
<!-- Device-specific array of SIM slot indexes which are are embedded eUICCs.
e.g. If a device has two physical slots with indexes 0, 1, and slot 1 is an
eUICC, then the value of this array should be:
<integer-array name="non_removable_euicc_slots">
<item>1</item>
</integer-array>
If a device has three physical slots and slot 1 and 2 are eUICCs, then the value of
this array should be:
<integer-array name="non_removable_euicc_slots">
<item>1</item>
<item>2</item>
</integer-array>
This is used to differentiate between removable eUICCs and built in eUICCs, and should
be set by OEMs for devices which use eUICCs. -->
<integer-array name="non_removable_euicc_slots"></integer-array>
</resources>

View File

@@ -2844,6 +2844,8 @@
<java-symbol type="array" name="resolver_target_actions_pin" />
<java-symbol type="array" name="resolver_target_actions_unpin" />
<java-symbol type="array" name="non_removable_euicc_slots" />
<java-symbol type="string" name="install_carrier_app_notification_title" />
<java-symbol type="string" name="install_carrier_app_notification_text" />
<java-symbol type="string" name="install_carrier_app_notification_text_app_name" />

View File

@@ -30,6 +30,7 @@ public final class UiccCardInfo implements Parcelable {
private final String mEid;
private final String mIccId;
private final int mSlotIndex;
private final boolean mIsRemovable;
public static final Creator<UiccCardInfo> CREATOR = new Creator<UiccCardInfo>() {
@Override
@@ -49,6 +50,7 @@ public final class UiccCardInfo implements Parcelable {
mEid = in.readString();
mIccId = in.readString();
mSlotIndex = in.readInt();
mIsRemovable = in.readByte() != 0;
}
@Override
@@ -58,6 +60,7 @@ public final class UiccCardInfo implements Parcelable {
dest.writeString(mEid);
dest.writeString(mIccId);
dest.writeInt(mSlotIndex);
dest.writeByte((byte) (mIsRemovable ? 1 : 0));
}
@Override
@@ -65,16 +68,21 @@ public final class UiccCardInfo implements Parcelable {
return 0;
}
public UiccCardInfo(boolean isEuicc, int cardId, String eid, String iccId, int slotIndex) {
/**
* @hide
*/
public UiccCardInfo(boolean isEuicc, int cardId, String eid, String iccId, int slotIndex,
boolean isRemovable) {
this.mIsEuicc = isEuicc;
this.mCardId = cardId;
this.mEid = eid;
this.mIccId = iccId;
this.mSlotIndex = slotIndex;
this.mIsRemovable = isRemovable;
}
/**
* Return whether the UiccCardInfo is an eUICC.
* Return whether the UICC is an eUICC.
* @return true if the UICC is an eUICC.
*/
public boolean isEuicc() {
@@ -127,7 +135,17 @@ public final class UiccCardInfo implements Parcelable {
* @hide
*/
public UiccCardInfo getUnprivileged() {
return new UiccCardInfo(mIsEuicc, mCardId, null, null, mSlotIndex);
return new UiccCardInfo(mIsEuicc, mCardId, null, null, mSlotIndex, mIsRemovable);
}
/**
* Return whether the UICC or eUICC is removable.
* <p>
* UICCs are generally removable, but eUICCs may be removable or built in to the device.
* @return true if the UICC or eUICC is removable
*/
public boolean isRemovable() {
return mIsRemovable;
}
@Override
@@ -144,12 +162,13 @@ public final class UiccCardInfo implements Parcelable {
&& (mCardId == that.mCardId)
&& (Objects.equals(mEid, that.mEid))
&& (Objects.equals(mIccId, that.mIccId))
&& (mSlotIndex == that.mSlotIndex));
&& (mSlotIndex == that.mSlotIndex)
&& (mIsRemovable == that.mIsRemovable));
}
@Override
public int hashCode() {
return Objects.hash(mIsEuicc, mCardId, mEid, mIccId, mSlotIndex);
return Objects.hash(mIsEuicc, mCardId, mEid, mIccId, mSlotIndex, mIsRemovable);
}
@Override
@@ -164,6 +183,8 @@ public final class UiccCardInfo implements Parcelable {
+ mIccId
+ ", mSlotIndex="
+ mSlotIndex
+ ", mIsRemovable="
+ mIsRemovable
+ ")";
}
}

View File

@@ -15,15 +15,15 @@
*/
package android.telephony;
import android.annotation.IntDef;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Objects;
import android.annotation.IntDef;
/**
* Class for the information of a UICC slot.
* @hide
@@ -61,6 +61,7 @@ public class UiccSlotInfo implements Parcelable {
private final @CardStateInfo int mCardStateInfo;
private final int mLogicalSlotIdx;
private final boolean mIsExtendedApduSupported;
private final boolean mIsRemovable;
public static final Creator<UiccSlotInfo> CREATOR = new Creator<UiccSlotInfo>() {
@Override
@@ -81,6 +82,7 @@ public class UiccSlotInfo implements Parcelable {
mCardStateInfo = in.readInt();
mLogicalSlotIdx = in.readInt();
mIsExtendedApduSupported = in.readByte() != 0;
mIsRemovable = in.readByte() != 0;
}
@Override
@@ -91,6 +93,7 @@ public class UiccSlotInfo implements Parcelable {
dest.writeInt(mCardStateInfo);
dest.writeInt(mLogicalSlotIdx);
dest.writeByte((byte) (mIsExtendedApduSupported ? 1 : 0));
dest.writeByte((byte) (mIsRemovable ? 1 : 0));
}
@Override
@@ -98,6 +101,11 @@ public class UiccSlotInfo implements Parcelable {
return 0;
}
/**
* Construct a UiccSlotInfo.
* @deprecated apps should not be constructing UiccSlotInfo objects
*/
@Deprecated
public UiccSlotInfo(boolean isActive, boolean isEuicc, String cardId,
@CardStateInfo int cardStateInfo, int logicalSlotIdx, boolean isExtendedApduSupported) {
this.mIsActive = isActive;
@@ -106,6 +114,22 @@ public class UiccSlotInfo implements Parcelable {
this.mCardStateInfo = cardStateInfo;
this.mLogicalSlotIdx = logicalSlotIdx;
this.mIsExtendedApduSupported = isExtendedApduSupported;
this.mIsRemovable = false;
}
/**
* @hide
*/
public UiccSlotInfo(boolean isActive, boolean isEuicc, String cardId,
@CardStateInfo int cardStateInfo, int logicalSlotIdx, boolean isExtendedApduSupported,
boolean isRemovable) {
this.mIsActive = isActive;
this.mIsEuicc = isEuicc;
this.mCardId = cardId;
this.mCardStateInfo = cardStateInfo;
this.mLogicalSlotIdx = logicalSlotIdx;
this.mIsExtendedApduSupported = isExtendedApduSupported;
this.mIsRemovable = isRemovable;
}
public boolean getIsActive() {
@@ -136,6 +160,16 @@ public class UiccSlotInfo implements Parcelable {
return mIsExtendedApduSupported;
}
/**
* Return whether the UICC slot is for a removable UICC.
* <p>
* UICCs are generally removable, but eUICCs may be removable or built in to the device.
* @return true if the slot is for removable UICCs
*/
public boolean isRemovable() {
return mIsRemovable;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
@@ -151,7 +185,8 @@ public class UiccSlotInfo implements Parcelable {
&& (Objects.equals(mCardId, that.mCardId))
&& (mCardStateInfo == that.mCardStateInfo)
&& (mLogicalSlotIdx == that.mLogicalSlotIdx)
&& (mIsExtendedApduSupported == that.mIsExtendedApduSupported);
&& (mIsExtendedApduSupported == that.mIsExtendedApduSupported)
&& (mIsRemovable == that.mIsRemovable);
}
@Override
@@ -163,6 +198,7 @@ public class UiccSlotInfo implements Parcelable {
result = 31 * result + mCardStateInfo;
result = 31 * result + mLogicalSlotIdx;
result = 31 * result + (mIsExtendedApduSupported ? 1 : 0);
result = 31 * result + (mIsRemovable ? 1 : 0);
return result;
}
@@ -180,6 +216,8 @@ public class UiccSlotInfo implements Parcelable {
+ mLogicalSlotIdx
+ ", mIsExtendedApduSupported="
+ mIsExtendedApduSupported
+ ", mIsRemovable="
+ mIsRemovable
+ ")";
}
}