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

Commit 8306c37d authored by Yujing Gu's avatar Yujing Gu Committed by Steve Kondik
Browse files

Exclude the last two bytes for the non-type1 Email file.

From 3GPP TS 31.102 4.4.2.13, if the file is not type 1
(as specified in EFPBR), the last two bytes of the email
should be exclude the E-mail Address.

Change-Id: I2dc595353a8498dc51a286c2a72fc7a82de81b5b
parent e3b45707
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -698,8 +698,14 @@ public class UsimPhoneBookManager extends Handler implements IccConstants {
            return null;
        }

        // The length of the record is X+2 byte, where X bytes is the email address
        String email = IccUtils.adnStringFieldToString(emailRec, 0, emailRec.length - 2);
        String email;
        if (mEmailPresentInIap) {
            //3gpp 31.102 4.4.2.13, in non-type1 EF_EMAIL file,
            //the length of the record is X+2 byte, where X bytes is the email address
            email = IccUtils.adnStringFieldToString(emailRec, 0, emailRec.length - 2);
        } else {
            email = IccUtils.adnStringFieldToString(emailRec, 0, emailRec.length);
        }
        return email;
    }