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

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

Merge "Implement isRemovable"

parents 3d8cef1f 0fe6845f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -43238,13 +43238,13 @@ package android.telephony {
  }
  }
  public final class UiccCardInfo implements android.os.Parcelable {
  public final class UiccCardInfo implements android.os.Parcelable {
    ctor public UiccCardInfo(boolean, int, String, String, int);
    method public int describeContents();
    method public int describeContents();
    method public int getCardId();
    method public int getCardId();
    method public String getEid();
    method public String getEid();
    method public String getIccId();
    method public String getIccId();
    method public int getSlotIndex();
    method public int getSlotIndex();
    method public boolean isEuicc();
    method public boolean isEuicc();
    method public boolean isRemovable();
    method public void writeToParcel(android.os.Parcel, int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.UiccCardInfo> CREATOR;
    field public static final android.os.Parcelable.Creator<android.telephony.UiccCardInfo> CREATOR;
  }
  }
+2 −1
Original line number Original line Diff line number Diff line
@@ -6476,7 +6476,7 @@ package android.telephony {
  }
  }
  public class UiccSlotInfo implements android.os.Parcelable {
  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 int describeContents();
    method public String getCardId();
    method public String getCardId();
    method public int getCardStateInfo();
    method public int getCardStateInfo();
@@ -6484,6 +6484,7 @@ package android.telephony {
    method public boolean getIsEuicc();
    method public boolean getIsEuicc();
    method public boolean getIsExtendedApduSupported();
    method public boolean getIsExtendedApduSupported();
    method public int getLogicalSlotIdx();
    method public int getLogicalSlotIdx();
    method public boolean isRemovable();
    method public void writeToParcel(android.os.Parcel, int);
    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_ABSENT = 1; // 0x1
    field public static final int CARD_STATE_INFO_ERROR = 3; // 0x3
    field public static final int CARD_STATE_INFO_ERROR = 3; // 0x3
+16 −0
Original line number Original line Diff line number Diff line
@@ -185,4 +185,20 @@
        <item>@string/app_info</item>
        <item>@string/app_info</item>
    </string-array>
    </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>
</resources>
+2 −0
Original line number Original line Diff line number Diff line
@@ -2844,6 +2844,8 @@
  <java-symbol type="array" name="resolver_target_actions_pin" />
  <java-symbol type="array" name="resolver_target_actions_pin" />
  <java-symbol type="array" name="resolver_target_actions_unpin" />
  <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_title" />
  <java-symbol type="string" name="install_carrier_app_notification_text" />
  <java-symbol type="string" name="install_carrier_app_notification_text" />
  <java-symbol type="string" name="install_carrier_app_notification_text_app_name" />
  <java-symbol type="string" name="install_carrier_app_notification_text_app_name" />
+26 −5
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ public final class UiccCardInfo implements Parcelable {
    private final String mEid;
    private final String mEid;
    private final String mIccId;
    private final String mIccId;
    private final int mSlotIndex;
    private final int mSlotIndex;
    private final boolean mIsRemovable;


    public static final Creator<UiccCardInfo> CREATOR = new Creator<UiccCardInfo>() {
    public static final Creator<UiccCardInfo> CREATOR = new Creator<UiccCardInfo>() {
        @Override
        @Override
@@ -49,6 +50,7 @@ public final class UiccCardInfo implements Parcelable {
        mEid = in.readString();
        mEid = in.readString();
        mIccId = in.readString();
        mIccId = in.readString();
        mSlotIndex = in.readInt();
        mSlotIndex = in.readInt();
        mIsRemovable = in.readByte() != 0;
    }
    }


    @Override
    @Override
@@ -58,6 +60,7 @@ public final class UiccCardInfo implements Parcelable {
        dest.writeString(mEid);
        dest.writeString(mEid);
        dest.writeString(mIccId);
        dest.writeString(mIccId);
        dest.writeInt(mSlotIndex);
        dest.writeInt(mSlotIndex);
        dest.writeByte((byte) (mIsRemovable ? 1 : 0));
    }
    }


    @Override
    @Override
@@ -65,16 +68,21 @@ public final class UiccCardInfo implements Parcelable {
        return 0;
        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.mIsEuicc = isEuicc;
        this.mCardId = cardId;
        this.mCardId = cardId;
        this.mEid = eid;
        this.mEid = eid;
        this.mIccId = iccId;
        this.mIccId = iccId;
        this.mSlotIndex = slotIndex;
        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.
     * @return true if the UICC is an eUICC.
     */
     */
    public boolean isEuicc() {
    public boolean isEuicc() {
@@ -127,7 +135,17 @@ public final class UiccCardInfo implements Parcelable {
     * @hide
     * @hide
     */
     */
    public UiccCardInfo getUnprivileged() {
    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
    @Override
@@ -144,12 +162,13 @@ public final class UiccCardInfo implements Parcelable {
                && (mCardId == that.mCardId)
                && (mCardId == that.mCardId)
                && (Objects.equals(mEid, that.mEid))
                && (Objects.equals(mEid, that.mEid))
                && (Objects.equals(mIccId, that.mIccId))
                && (Objects.equals(mIccId, that.mIccId))
                && (mSlotIndex == that.mSlotIndex));
                && (mSlotIndex == that.mSlotIndex)
                && (mIsRemovable == that.mIsRemovable));
    }
    }


    @Override
    @Override
    public int hashCode() {
    public int hashCode() {
        return Objects.hash(mIsEuicc, mCardId, mEid, mIccId, mSlotIndex);
        return Objects.hash(mIsEuicc, mCardId, mEid, mIccId, mSlotIndex, mIsRemovable);
    }
    }


    @Override
    @Override
@@ -164,6 +183,8 @@ public final class UiccCardInfo implements Parcelable {
                + mIccId
                + mIccId
                + ", mSlotIndex="
                + ", mSlotIndex="
                + mSlotIndex
                + mSlotIndex
                + ", mIsRemovable="
                + mIsRemovable
                + ")";
                + ")";
    }
    }
}
}
Loading