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

Commit 0e4d0b10 authored by Bobby Wang's avatar Bobby Wang
Browse files

Correct max len when build ANR data

The numberToCalledPartyBCD function has considered the TON/TPI byte,
So the Max length should add TON/TPI byte, Or else the max additional
number will delete last two numbers. Please refer to 3GPP TS 31.102

CRs-Fixed: 739292

Change-Id: Ic469cff4d6b83cfcda96a77f7a70ca542a198350
parent a82f430b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -863,7 +863,8 @@ public class UsimPhoneBookManager extends Handler implements IccConstants {
            return null;
        }

        int maxlength = ANR_ADDITIONAL_NUMBER_END_ID - ANR_ADDITIONAL_NUMBER_START_ID + 1;
        // numberToCalledPartyBCD has considered TOA byte
        int maxlength = ANR_ADDITIONAL_NUMBER_END_ID - ANR_ADDITIONAL_NUMBER_START_ID + 1 + 1;
        if (byteAnr.length > maxlength) {
            System.arraycopy(byteAnr, 0, data, ANR_TON_NPI_ID, maxlength);
            data[ANR_BCD_NUMBER_LENGTH] = (byte) (maxlength);