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

Commit 6c83d0f2 authored by Hakjun Choi's avatar Hakjun Choi
Browse files

Fix system selection specifier converter

Bug: 379944543
Flag: com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn
Test: atest SatelliteManagerTetOnMockService to verify whether dta
conversion is WAI

Change-Id: Ie15e74dd6f65dda396fbe1f07a8ca361d2068f2d
parent 394ffd62
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -555,31 +555,43 @@ public class SatelliteServiceUtils {
        convertedSpecifier.mMccMnc = systemSelectionSpecifier.getMccMnc();
        convertedSpecifier.mBands = systemSelectionSpecifier.getBands().toArray();
        convertedSpecifier.mEarfcs = systemSelectionSpecifier.getEarfcns().toArray();

        SatelliteInfo[] satelliteInfos = systemSelectionSpecifier.getSatelliteInfos();
        android.telephony.satellite.stub.SatelliteInfo[] halSatelliteInfos =
                new android.telephony.satellite.stub.SatelliteInfo[satelliteInfos.length];
        for (int i = 0; i < satelliteInfos.length; i++) {
            halSatelliteInfos[i] = new android.telephony.satellite.stub.SatelliteInfo();

            halSatelliteInfos[i].id = new android.telephony.satellite.stub.UUID();
            halSatelliteInfos[i].id.mostSigBits =
                    satelliteInfos[i].getSatelliteId().getMostSignificantBits();
            halSatelliteInfos[i].id.leastSigBits =
                    satelliteInfos[i].getSatelliteId().getLeastSignificantBits();

            halSatelliteInfos[i].position =
                    new android.telephony.satellite.stub.SatellitePosition();
            halSatelliteInfos[i].position.longitudeDegree =
                    satelliteInfos[i].getSatellitePosition().getLongitudeDegrees();
            halSatelliteInfos[i].position.altitudeKm =
                    satelliteInfos[i].getSatellitePosition().getAltitudeKm();

            halSatelliteInfos[i].bands = satelliteInfos[i].getBands().stream().mapToInt(
                    Integer::intValue).toArray();

            List<EarfcnRange> earfcnRangeList = satelliteInfos[i].getEarfcnRanges();
            halSatelliteInfos[i].earfcnRanges =
                    new android.telephony.satellite.stub.EarfcnRange[earfcnRangeList.size()];
            for (int j = 0; j < earfcnRangeList.size(); j++) {
                halSatelliteInfos[i].earfcnRanges[j] =
                        new android.telephony.satellite.stub.EarfcnRange();
                halSatelliteInfos[i].earfcnRanges[j].startEarfcn = earfcnRangeList.get(
                        j).getStartEarfcn();
                halSatelliteInfos[i].earfcnRanges[j].endEarfcn = earfcnRangeList.get(
                        j).getStartEarfcn();
                        j).getEndEarfcn();
            }
        }
        convertedSpecifier.satelliteInfos = halSatelliteInfos;

        convertedSpecifier.tagIds = systemSelectionSpecifier.getTagIds().toArray();
        return convertedSpecifier;
    }