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

Commit 3ae80c21 authored by Sooraj Sasindran's avatar Sooraj Sasindran
Browse files

Fix array out of bounds in updateNtnRoamingInHomeCountry

Bug: 376502396
Flag: EXEMPT bugfix
Change-Id: Ia66e47784fea4adf23fcbd4df25b08c139dbb61e
Test: run regression for starlink and Pixel Skylo
parent 62cc25a4
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -325,13 +325,18 @@ public class CarrierRoamingSatelliteSessionStats {
            return;
        }
        String simCountry = MccTable.countryCodeForMcc(subscriptionInfoInternal.getMcc());
        mIsNtnRoamingInHomeCountry = true;
        if (satelliteRegisteredPlmn != null
                && satelliteRegisteredPlmn.length() >= 3) {
            String satelliteRegisteredCountry = MccTable.countryCodeForMcc(
                    satelliteRegisteredPlmn.substring(0, 3));
            if (simCountry.equalsIgnoreCase(satelliteRegisteredCountry)) {
            mIsNtnRoamingInHomeCountry = false;
        } else {
            // If device is connected to roaming non-terrestrial network, update to true.
                mIsNtnRoamingInHomeCountry = true;
            } else {
                // If device is connected to roaming non-terrestrial network, then marking as
                // roaming in external country
                mIsNtnRoamingInHomeCountry = false;
            }
        }
        logd("updateNtnRoamingInHomeCountry: mIsNtnRoamingInHomeCountry="
                + mIsNtnRoamingInHomeCountry);