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

Commit 38bece23 authored by Aishwarya Mallampati's avatar Aishwarya Mallampati
Browse files

Convert hidden SatelliteManager APIs to System APIs.

Convert hidden CarrierRoamingNtnModeListener in TelephonyCallback to
System API as well.

Bug: 373955860
Test: Manually tested SMS/MMS/DATA/CALL
Test: 380124630
FLAG: com.android.internal.telephony.flags.satellite_system_apis

Change-Id: I58ad3a9698b550c4b0609a8a4b2ec4374e0084cd
parent b80a5aec
Loading
Loading
Loading
Loading
+134 −0

File changed.

Preview size limit exceeded, changes collapsed.

+22 −8
Original line number Diff line number Diff line
@@ -658,12 +658,15 @@ public class TelephonyCallback {
     *
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
    @RequiresPermission(Manifest.permission.READ_PHONE_STATE)
    public static final int EVENT_CARRIER_ROAMING_NTN_MODE_CHANGED = 42;

    /**
     * Event for listening to changes in carrier roaming non-terrestrial network eligibility.
     *
     * @see CarrierRoamingNtnModeListener
     * @see CarrierRoamingNtnModeListener#onCarrierRoamingNtnEligibleStateChanged(boolean)
     *
     * Device is eligible for satellite communication if all the following conditions are met:
     * <ul>
@@ -679,11 +682,15 @@ public class TelephonyCallback {
     *
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
    @RequiresPermission(Manifest.permission.READ_PHONE_STATE)
    public static final int EVENT_CARRIER_ROAMING_NTN_ELIGIBLE_STATE_CHANGED = 43;

    /**
     * Event for listening to changes in carrier roaming non-terrestrial network available services
     * via callback onCarrierRoamingNtnAvailableServicesChanged().
     * via callback {@link
     * CarrierRoamingNtnModeListener#onCarrierRoamingNtnAvailableServicesChanged(List)}
     * This callback is triggered when the available services provided by the carrier roaming
     * satellite changes. The carrier roaming satellite is defined by the following conditions.
     * <ul>
@@ -693,15 +700,22 @@ public class TelephonyCallback {
     *
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
    @RequiresPermission(Manifest.permission.READ_PHONE_STATE)
    public static final int EVENT_CARRIER_ROAMING_NTN_AVAILABLE_SERVICES_CHANGED = 44;

    /**
     * Event for listening to carrier roaming non-terrestrial network signal strength changes.
     *
     * @see CarrierRoamingNtnModeListener
     * @see CarrierRoamingNtnModeListener#onCarrierRoamingNtnSignalStrengthChanged(
     * NtnSignalStrength)
     *
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
    @RequiresPermission(Manifest.permission.READ_PHONE_STATE)
    public static final int EVENT_CARRIER_ROAMING_NTN_SIGNAL_STRENGTH_CHANGED = 45;

    /**
@@ -1803,6 +1817,8 @@ public class TelephonyCallback {
     *
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
    public interface CarrierRoamingNtnModeListener {
        /**
         * Callback invoked when carrier roaming non-terrestrial network mode changes.
@@ -1836,10 +1852,10 @@ public class TelephonyCallback {
         * Callback invoked when carrier roaming non-terrestrial network available
         * service changes.
         *
         * @param availableServices The list of the supported services.
         * @param availableServices array of supported services.
         */
        default void onCarrierRoamingNtnAvailableServicesChanged(
                @NetworkRegistrationInfo.ServiceType List<Integer> availableServices) {}
                @NonNull @NetworkRegistrationInfo.ServiceType int[] availableServices) {}

        /**
         * Callback invoked when carrier roaming non-terrestrial network signal strength changes.
@@ -2343,10 +2359,8 @@ public class TelephonyCallback {
                    (CarrierRoamingNtnModeListener) mTelephonyCallbackWeakRef.get();
            if (listener == null) return;

            List<Integer> ServiceList = Arrays.stream(availableServices).boxed()
                    .collect(Collectors.toList());
            Binder.withCleanCallingIdentity(() -> mExecutor.execute(
                    () -> listener.onCarrierRoamingNtnAvailableServicesChanged(ServiceList)));
                    () -> listener.onCarrierRoamingNtnAvailableServicesChanged(availableServices)));
        }

        public void onCarrierRoamingNtnSignalStrengthChanged(
+4 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.telephony.satellite;
import android.annotation.FlaggedApi;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;

@@ -40,7 +41,8 @@ import java.util.Objects;
 *
 * @hide
 */
@FlaggedApi(Flags.FLAG_CARRIER_ROAMING_NB_IOT_NTN)
@SystemApi
@FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
public final class EarfcnRange implements Parcelable {

    /**
@@ -74,6 +76,7 @@ public final class EarfcnRange implements Parcelable {
     *
     * @param startEarfcn The starting earfcn value.
     * @param endEarfcn   The ending earfcn value.
     * @hide
     */
    public EarfcnRange(@IntRange(from = 0, to = 65535) int startEarfcn,
            @IntRange(from = 0, to = 65535) int endEarfcn) {
+10 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.telephony.satellite;

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

@@ -34,7 +35,8 @@ import java.util.Objects;
 *
 * @hide
 */
@FlaggedApi(Flags.FLAG_CARRIER_ROAMING_NB_IOT_NTN)
@SystemApi
@FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
public final class SatelliteAccessConfiguration implements Parcelable {
    /**
     * The list of satellites available at the current location.
@@ -54,6 +56,7 @@ public final class SatelliteAccessConfiguration implements Parcelable {
     * @param satelliteInfos The list of {@link SatelliteInfo} objects representing the satellites
     *                       accessible with this configuration.
     * @param tagIdList      The list of tag IDs associated with this configuration.
     * @hide
     */
    public SatelliteAccessConfiguration(@NonNull List<SatelliteInfo> satelliteInfos,
            @NonNull List<Integer> tagIdList) {
@@ -61,12 +64,18 @@ public final class SatelliteAccessConfiguration implements Parcelable {
        mTagIdList = tagIdList;
    }

    /**
     * Constructor for {@link SatelliteAccessConfiguration}.
     * @param in parcel used to create {@link SatelliteAccessConfiguration} object
     * @hide
     */
    public SatelliteAccessConfiguration(Parcel in) {
        mSatelliteInfoList = in.createTypedArrayList(SatelliteInfo.CREATOR);
        mTagIdList = new ArrayList<>();
        in.readList(mTagIdList, Integer.class.getClassLoader(), Integer.class);
    }

    @NonNull
    public static final Creator<SatelliteAccessConfiguration> CREATOR =
            new Creator<SatelliteAccessConfiguration>() {
                @Override
+8 −8
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package android.telephony.satellite;

import android.annotation.FlaggedApi;
import android.annotation.Nullable;
import android.annotation.SystemApi;


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

@@ -27,19 +29,19 @@ import com.android.internal.telephony.flags.Flags;
 *
 * @hide
 */
@FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
@SystemApi
@FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
public interface SatelliteCommunicationAllowedStateCallback {

    /**
     * Telephony does not guarantee that whenever there is a change in communication allowed state,
     * this API will be called. Telephony does its best to detect the changes and notify its
     * listeners accordingly.
     * listeners accordingly. Satellite communication is allowed at a location when it is legally
     * allowed by the local authority and satellite signal coverage is available.
     *
     * @param isAllowed {@code true} means satellite allow state is changed,
     *                  {@code false} satellite allow state is not changed
     * @hide
     * @param isAllowed {@code true} means satellite is allowed,
     *                  {@code false} satellite is not allowed.
     */
    @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
    void onSatelliteCommunicationAllowedStateChanged(boolean isAllowed);

    /**
@@ -49,9 +51,7 @@ public interface SatelliteCommunicationAllowedStateCallback {
     *                                       the current location. When satellite is not allowed at
     *                                       the current location,
     *                                       {@code satelliteRegionalConfiguration} will be null.
     * @hide
     */
    @FlaggedApi(Flags.FLAG_CARRIER_ROAMING_NB_IOT_NTN)
    default void onSatelliteAccessConfigurationChanged(
            @Nullable SatelliteAccessConfiguration satelliteAccessConfiguration) {};
}
Loading