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

Commit b12eabfd authored by Hakjun Choi's avatar Hakjun Choi
Browse files

Use the new HAL API updateSystemSelectionChannels to pass the bands/frequency to vendor service.

Bug: 371438496
Flag: com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn
Test: atest SatelliteAccessControllerTest SatelliteControllerTest
Test: manually run e2e system test for checking functionality and
regression

Change-Id: Ifb0d5fb44ee205f66564c36c9808ad99d11c355b
parent fc5a4bd1
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.telephony.satellite;

import android.annotation.FlaggedApi;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.ParcelUuid;
import android.os.Parcelable;
@@ -47,10 +46,12 @@ public class SatelliteInfo implements Parcelable {
    private UUID mId;

    /**
     * Position information of a satellite.
     * Position information of a geostationary satellite.
     * This includes the longitude and altitude of the satellite.
     * If the SatellitePosition is invalid,
     * longitudeDegree and altitudeKm will be represented as DOUBLE.NaN.
     */
    @Nullable
    @NonNull
    private SatellitePosition mPosition;

    /**
@@ -89,7 +90,7 @@ public class SatelliteInfo implements Parcelable {
     * @param earfcnRanges      The list of {@link EarfcnRange} objects representing the EARFCN
     *                          ranges supported by the satellite.
     */
    public SatelliteInfo(@NonNull UUID satelliteId, @Nullable SatellitePosition satellitePosition,
    public SatelliteInfo(@NonNull UUID satelliteId, @NonNull SatellitePosition satellitePosition,
            @NonNull List<Integer> bandList, @NonNull List<EarfcnRange> earfcnRanges) {
        mId = satelliteId;
        mPosition = satellitePosition;
@@ -135,10 +136,9 @@ public class SatelliteInfo implements Parcelable {
    /**
     * Returns the position of the satellite.
     *
     * @return The {@link SatellitePosition} of the satellite, or {@code null} if the position is
     * not available.
     * @return The {@link SatellitePosition} of the satellite.
     */
    @Nullable
    @NonNull
    public SatellitePosition getSatellitePosition() {
        return mPosition;
    }
+85 −19
Original line number Diff line number Diff line
@@ -17,11 +17,13 @@
package android.telephony.satellite;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.IntArray;

import java.util.Arrays;
import java.util.Objects;

/**
@@ -39,16 +41,26 @@ public final class SystemSelectionSpecifier implements Parcelable {
     * The radio channels to scan as defined in 3GPP TS 25.101 and 36.101.
     * Maximum length of the vector is 32.
     */
    @NonNull private IntArray mEarfcs;
    @NonNull private IntArray mEarfcns;

    /* The list of satellites configured for the current location */
    @Nullable
    private SatelliteInfo[] mSatelliteInfos;

    /* The list of tag IDs associated with the current location */
    @Nullable private IntArray mTagIds;

    /**
     * @hide
     */
    public SystemSelectionSpecifier(@NonNull String mccmnc, @NonNull IntArray bands,
            @NonNull IntArray earfcs) {
            @NonNull IntArray earfcns, @Nullable SatelliteInfo[] satelliteInfos,
            @Nullable IntArray tagIds) {
        mMccMnc = mccmnc;
        mBands = bands;
        mEarfcs = earfcs;
        mEarfcns = earfcns;
        mSatelliteInfos = satelliteInfos;
        mTagIds = tagIds;
    }

    private SystemSelectionSpecifier(Parcel in) {
@@ -74,10 +86,21 @@ public final class SystemSelectionSpecifier implements Parcelable {
            out.writeInt(0);
        }

        if (mEarfcs != null && mEarfcs.size() > 0) {
            out.writeInt(mEarfcs.size());
            for (int i = 0; i < mEarfcs.size(); i++) {
                out.writeInt(mEarfcs.get(i));
        if (mEarfcns != null && mEarfcns.size() > 0) {
            out.writeInt(mEarfcns.size());
            for (int i = 0; i < mEarfcns.size(); i++) {
                out.writeInt(mEarfcns.get(i));
            }
        } else {
            out.writeInt(0);
        }

        out.writeTypedArray(mSatelliteInfos, flags);

        if (mTagIds != null) {
            out.writeInt(mTagIds.size());
            for (int i = 0; i < mTagIds.size(); i++) {
                out.writeInt(mTagIds.get(i));
            }
        } else {
            out.writeInt(0);
@@ -115,14 +138,35 @@ public final class SystemSelectionSpecifier implements Parcelable {
        }

        sb.append("earfcs:");
        if (mEarfcs != null && mEarfcs.size() > 0) {
            for (int i = 0; i < mEarfcs.size(); i++) {
                sb.append(mEarfcs.get(i));
        if (mEarfcns != null && mEarfcns.size() > 0) {
            for (int i = 0; i < mEarfcns.size(); i++) {
                sb.append(mEarfcns.get(i));
                sb.append(",");
            }
        } else {
            sb.append("none");
        }

        sb.append("mSatelliteInfos:");
        if (mSatelliteInfos != null && mSatelliteInfos.length > 0) {
            for (SatelliteInfo satelliteInfo : mSatelliteInfos) {
                sb.append(satelliteInfo);
                sb.append(",");
            }
        } else {
            sb.append("none");
        }

        sb.append("mTagIds:");
        if (mTagIds != null && mTagIds.size() > 0) {
            for (int i = 0; i < mTagIds.size(); i++) {
                sb.append(mTagIds.get(i));
                sb.append(",");
            }
        } else {
            sb.append("none");
        }

        return sb.toString();
    }

@@ -133,12 +177,15 @@ public final class SystemSelectionSpecifier implements Parcelable {
        SystemSelectionSpecifier that = (SystemSelectionSpecifier) o;
        return Objects.equals(mMccMnc, that.mMccMnc)
                && Objects.equals(mBands, that.mBands)
                && Objects.equals(mEarfcs, that.mEarfcs);
                && Objects.equals(mEarfcns, that.mEarfcns)
                && (mSatelliteInfos == null ? that.mSatelliteInfos == null : Arrays.equals(
                mSatelliteInfos, that.mSatelliteInfos))
                && Objects.equals(mTagIds, that.mTagIds);
    }

    @Override
    public int hashCode() {
        return Objects.hash(mMccMnc, mBands, mEarfcs);
        return Objects.hash(mMccMnc, mBands, mEarfcns);
    }

    @NonNull public String getMccMnc() {
@@ -149,8 +196,18 @@ public final class SystemSelectionSpecifier implements Parcelable {
        return mBands;
    }

    @NonNull public IntArray getEarfcs() {
        return mEarfcs;
    @NonNull public IntArray getEarfcns() {
        return mEarfcns;
    }

    @NonNull
    public SatelliteInfo[] getSatelliteInfos() {
        return mSatelliteInfos;
    }

    @NonNull
    public IntArray getTagIds() {
        return mTagIds;
    }

    private void readFromParcel(Parcel in) {
@@ -164,11 +221,20 @@ public final class SystemSelectionSpecifier implements Parcelable {
            }
        }

        mEarfcs = new IntArray();
        int numEarfcs = in.readInt();
        if (numEarfcs > 0) {
            for (int i = 0; i < numEarfcs; i++) {
                mEarfcs.add(in.readInt());
        mEarfcns = new IntArray();
        int numEarfcns = in.readInt();
        if (numEarfcns > 0) {
            for (int i = 0; i < numEarfcns; i++) {
                mEarfcns.add(in.readInt());
            }
        }

        mSatelliteInfos = in.createTypedArray(SatelliteInfo.CREATOR);

        int numTagIds = in.readInt();
        if (numTagIds > 0) {
            for (int i = 0; i < numTagIds; i++) {
                mTagIds.add(in.readInt());
            }
        }
    }
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.telephony.satellite.stub;

/**
 * @hide
 */
parcelable EarfcnRange {
    /**
     * The start frequency of the earfcn range and is inclusive in the range
     */
    int startEarfcn;

    /**
     * The end frequency of the earfcn range and is inclusive in the range.
     */
    int endEarfcn;
}
+52 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.telephony.satellite.stub;

import android.telephony.satellite.stub.UUID;
import android.telephony.satellite.stub.SatellitePosition;
import android.telephony.satellite.stub.EarfcnRange;

/**
 * @hide
 */
parcelable SatelliteInfo {
    /**
     * Unique identification number for the satellite.
     * This ID is used to distinguish between different satellites in the network.
     */
    UUID id;

    /**
     * Position information of a geostationary satellite.
     * This includes the longitude and altitude of the satellite.
     * If the SatellitePosition is invalid,
     * longitudeDegree and altitudeKm will be represented as DOUBLE.NaN.
     */
    SatellitePosition position;

    /**
     * The frequency bands to scan.
     * Bands will be filled only if the whole band is needed.
     * Maximum length of the vector is 8.
     */
    int[] bands;

    /**
     * The supported frequency ranges. Earfcn ranges and earfcns won't overlap.
     */
    EarfcnRange[] earfcnRanges;
}
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.telephony.satellite.stub;

/**
 * @hide
 */
parcelable SatellitePosition {
    /**
     * The longitude of the satellite in degrees, ranging from -180 to 180 degrees
     */
    double longitudeDegree;

    /**
     * The distance from the center of the earth to the satellite, measured in kilometers
     */
    double altitudeKm;
}
Loading