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

Commit e4217d02 authored by Hunter Knepshield's avatar Hunter Knepshield Committed by Android (Google) Code Review
Browse files

Merge "Keep redacted port info with READ_BASIC_PHONE_STATE permission" into main

parents 37b2836d 4d7f24f0
Loading
Loading
Loading
Loading
+13 −24
Original line number Diff line number Diff line
@@ -237,30 +237,19 @@ public final class UiccCardInfo implements Parcelable {
     * @hide
     */
    public UiccCardInfo createSensitiveInfoSanitizedCopy(boolean hasCarrierPrivileges) {
        if (hasCarrierPrivileges) {
            List<UiccPortInfo> portInfos = new  ArrayList<>();
            for (UiccPortInfo portInfo : this.getPorts()) {
                portInfos.add(portInfo.createSensitiveInfoSanitizedCopy());
        final List<UiccPortInfo> redactedPortInfos = new  ArrayList<>();
        for (UiccPortInfo portInfo : mPortList) {
            redactedPortInfos.add(portInfo.createSensitiveInfoSanitizedCopy());
        }

        return new UiccCardInfo(
                    this.isEuicc(),
                    this.getCardId(),
                    null,
                    this.getPhysicalSlotIndex(),
                    this.isRemovable(),
                    this.isMultipleEnabledProfilesSupported(),
                    portInfos);
        } else {
            // Without carrier privileges, treat it as READ_BASIC_PHONE_STATE, copy minimum info
            return new UiccCardInfo(
                    this.isEuicc(),
                    TelephonyManager.UNINITIALIZED_CARD_ID,
                mIsEuicc,
                hasCarrierPrivileges ? mCardId : TelephonyManager.UNINITIALIZED_CARD_ID,
                null,
                    this.getPhysicalSlotIndex(),
                    this.isRemovable(),
                    this.isMultipleEnabledProfilesSupported(),
                    List.of());
        }
                mPhysicalSlotIndex,
                mIsRemovable,
                mIsMultipleEnabledProfilesSupported,
                redactedPortInfos);
    }

    @Override