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

Commit 72aacaa6 authored by youngtaecha's avatar youngtaecha
Browse files

Add requestRegionalSatelliteConfigurationForCurrentLocation and...

Add requestRegionalSatelliteConfigurationForCurrentLocation and onRegionalSatelliteConfigurationChanged

Bug: 371438277
Test: Build
Flag: com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn
Change-Id: I97efc32018e2a5f6895b0b9ace01123d6e76cf04
parent ca7ba1eb
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright 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;

parcelable EarfcnRange;
+124 −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;

import android.annotation.FlaggedApi;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;

import com.android.internal.telephony.flags.Flags;

/**
 * EARFCN (E-UTRA Absolute Radio Frequency Channel Number):  A number that identifies a
 * specific frequency channel in LTE/5G NR, used to define the carrier frequency.
 * The range can be [0 ~ 65535] according to the 3GPP TS 36.101
 *
 * In satellite communication:
 * - Efficient frequency allocation across a wide coverage area.
 * - Handles Doppler shift due to satellite movement.
 * - Manages interference with terrestrial networks.
 *
 * See 3GPP TS 36.101 and 38.101-1 for details.
 *
 * @hide
 */
@FlaggedApi(Flags.FLAG_CARRIER_ROAMING_NB_IOT_NTN)
public final class EarfcnRange implements Parcelable {

    /**
     * The start frequency of the earfcn range and is inclusive in the range
     */
    private int mStartEarfcn;

    /**
     * The end frequency of the earfcn range and is inclusive in the range.
     */
    private int mEndEarfcn;

    private EarfcnRange(@NonNull Parcel in) {
        readFromParcel(in);
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeInt(mStartEarfcn);
        dest.writeInt(mEndEarfcn);
    }

    private void readFromParcel(Parcel in) {
        mStartEarfcn = in.readInt();
        mEndEarfcn = in.readInt();
    }

    /**
     * Constructor for the EarfcnRange class.
     * The range can be [0 ~ 65535] according to the 3GPP TS 36.101
     *
     * @param startEarfcn The starting earfcn value.
     * @param endEarfcn   The ending earfcn value.
     */
    public EarfcnRange(@IntRange(from = 0, to = 65535) int endEarfcn,
            @IntRange(from = 0, to = 65535) int startEarfcn) {
        mEndEarfcn = endEarfcn;
        mStartEarfcn = startEarfcn;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public String toString() {
        return "startEarfcn: " + mStartEarfcn + ", " + "endEarfcn: " + mEndEarfcn;
    }

    @NonNull
    public static final Creator<EarfcnRange> CREATOR = new Creator<EarfcnRange>() {
        @Override
        public EarfcnRange createFromParcel(Parcel in) {
            return new EarfcnRange(in);
        }

        @Override
        public EarfcnRange[] newArray(int size) {
            return new EarfcnRange[size];
        }
    };

    /**
     * Returns the starting earfcn value for this range.
     * It can be [0 ~ 65535] according to the 3GPP TS 36.101
     *
     * @return The starting earfcn.
     */
    public @IntRange(from = 0, to = 65535) int getStartEarfcn() {
        return mStartEarfcn;
    }

    /**
     * Returns the ending earfcn value for this range.
     * It can be [0 ~ 65535] according to the 3GPP TS 36.101
     *
     * @return The ending earfcn.
     */
    public @IntRange(from = 0, to = 65535) int getEndEarfcn() {
        return mEndEarfcn;
    }
}
+12 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.telephony.satellite;

import android.telephony.satellite.SatelliteAccessConfiguration;

/**
 * Interface for satellite communication allowed state callback.
 * @hide
@@ -29,4 +31,14 @@ oneway interface ISatelliteCommunicationAllowedStateCallback {
     * @param allowed whether satellite communication state or not
     */
    void onSatelliteCommunicationAllowedStateChanged(in boolean isAllowed);

    /**
     * Callback method invoked when the satellite access configuration changes
     *
     * @param The satellite access configuration associated with the current location.
     * When satellite is not allowed at the current location,
     * {@code satelliteRegionalConfiguration} will be null.
     */
    void onSatelliteAccessConfigurationChanged(in SatelliteAccessConfiguration
        satelliteAccessConfiguration);
}
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright 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;

 parcelable SatelliteAccessConfiguration;
 No newline at end of file
+122 −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;

import android.annotation.FlaggedApi;
import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

import com.android.internal.telephony.flags.Flags;

import java.util.List;

/**
 * SatelliteAccessConfiguration is used to store satellite access configuration
 * that will be applied to the satellite communication at the corresponding region.
 *
 * @hide
 */
@FlaggedApi(Flags.FLAG_CARRIER_ROAMING_NB_IOT_NTN)
public final class SatelliteAccessConfiguration implements Parcelable {
    /**
     * The list of satellites available at the current location.
     */
    @NonNull
    private List<SatelliteInfo> mSatelliteInfoList;

    /**
     * The list of tag IDs associated with the current location
     */
    @NonNull
    private int[] mTagIds;

    /**
     * Constructor for {@link SatelliteAccessConfiguration}.
     *
     * @param satelliteInfos The list of {@link SatelliteInfo} objects representing the satellites
     *                       accessible with this configuration.
     * @param tagIds         The list of tag IDs associated with this configuration.
     */
    public SatelliteAccessConfiguration(@NonNull List<SatelliteInfo> satelliteInfos,
            @NonNull int[] tagIds) {
        mSatelliteInfoList = satelliteInfos;
        mTagIds = tagIds;
    }

    public SatelliteAccessConfiguration(Parcel in) {
        mSatelliteInfoList = in.createTypedArrayList(SatelliteInfo.CREATOR);
        mTagIds = new int[in.readInt()];
        in.readIntArray(mTagIds);
    }

    public static final Creator<SatelliteAccessConfiguration> CREATOR =
            new Creator<SatelliteAccessConfiguration>() {
                @Override
                public SatelliteAccessConfiguration createFromParcel(Parcel in) {
                    return new SatelliteAccessConfiguration(in);
                }

                @Override
                public SatelliteAccessConfiguration[] newArray(int size) {
                    return new SatelliteAccessConfiguration[size];
                }
            };

    @Override
    public int describeContents() {
        return 0;
    }

    /**
     * @param dest  The Parcel in which the object should be written.
     * @param flags Additional flags about how the object should be written.
     *              May be 0 or {@link #PARCELABLE_WRITE_RETURN_VALUE}.
     */
    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeTypedList(mSatelliteInfoList);
        if (mTagIds != null && mTagIds.length > 0) {
            dest.writeInt(mTagIds.length);
            dest.writeIntArray(mTagIds);
        } else {
            dest.writeInt(0);
        }
    }

    /**
     * Returns a list of {@link SatelliteInfo} objects representing the satellites
     * associated with this object.
     *
     * @return The list of {@link SatelliteInfo} objects.
     */
    @NonNull
    public List<SatelliteInfo> getSatelliteInfos() {
        return mSatelliteInfoList;
    }

    /**
     * Returns a list of tag IDs associated with this object.
     *
     * @return The list of tag IDs.
     */
    @NonNull
    public int[] getTagIds() {
        return mTagIds;
    }
}
Loading