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

Commit ee602d6d authored by fionaxu's avatar fionaxu
Browse files

check empty EF_CFIS when validate call forward

Bug: 68679121
Test: Manual test
Change-Id: Ib4088bfd56f6b081177f548f93e9862707551a7f
parent 5f84fc93
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -482,7 +482,7 @@ public class SIMRecords extends IccRecords {
        }
    }

    // Validate data is !null.
    // Validate data is not null and not empty.
    private boolean validEfCfis(byte[] data) {
        if (data != null) {
            if (data[0] < 1 || data[0] > 4) {
@@ -490,8 +490,13 @@ public class SIMRecords extends IccRecords {
                // 1 and 4 according to ETSI TS 131 102 v11.3.0 section 4.2.64.
                logw("MSP byte: " + data[0] + " is not between 1 and 4", null);
            }
            // empty EF_CFIS should be considered as call forward disabled
            for (byte b : data) {
                if (b != (byte) 0xFF) {
                    return true;
                }
            }
        }
        return false;
    }