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

Commit 808b8d14 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

Validate phone ID before using

Bug: 353979854
Test: atest CtsTelephonyTestCases
Flag: EXEMPT bugfix
Change-Id: I52cc46aab6eb8f13ba1ad6204cf117b7e0b608ea
parent 373cca20
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3535,6 +3535,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {

        synchronized (mRecords) {
            int phoneId = getPhoneIdFromSubId(subId);
            if (!validatePhoneId(phoneId)) {
                loge("Invalid phone ID " + phoneId + " for " + subId);
                return;
            }
            mCarrierRoamingNtnMode[phoneId] = active;
            for (Record r : mRecords) {
                if (r.matchTelephonyCallbackEvent(
@@ -3582,6 +3586,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {

        synchronized (mRecords) {
            int phoneId = getPhoneIdFromSubId(subId);
            if (!validatePhoneId(phoneId)) {
                loge("Invalid phone ID " + phoneId + " for " + subId);
                return;
            }
            mCarrierRoamingNtnEligible[phoneId] = eligible;
            for (Record r : mRecords) {
                if (r.matchTelephonyCallbackEvent(