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

Commit 70e69c01 authored by Hakjun Choi's avatar Hakjun Choi
Browse files

Add new apis for satellite service

Added an api to find whether the subscription ID supports NTN network.
Added device overlay configuration for telephony to identify the eSIM profile preloaded on a device supports satellite service.

Bug: 299232193
Test: atest SubscriptionInfoTest, SubscriptionInfoInternalTest
Change-Id: I41ec533df142ee0c4d2bba524acddf90a16509d4
parent 05605b25
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44887,6 +44887,7 @@ package android.telephony {
    method public int getSubscriptionType();
    method public int getUsageSetting();
    method public boolean isEmbedded();
    method @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG) public boolean isNtn();
    method public boolean isOpportunistic();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SubscriptionInfo> CREATOR;
+10 −1
Original line number Diff line number Diff line
@@ -4915,6 +4915,14 @@ public final class Telephony {
        public static final String COLUMN_SATELLITE_ATTACH_ENABLED_FOR_CARRIER =
                "satellite_attach_enabled_for_carrier";

        /**
         * TelephonyProvider column name to identify eSIM profile of a non-terrestrial network.
         * By default, it's disabled.
         *
         * @hide
         */
        public static final String COLUMN_IS_NTN = "is_ntn";

        /** All columns in {@link SimInfo} table. */
        private static final List<String> ALL_COLUMNS = List.of(
                COLUMN_UNIQUE_KEY_SUBSCRIPTION_ID,
@@ -4985,7 +4993,8 @@ public final class Telephony {
                COLUMN_TP_MESSAGE_REF,
                COLUMN_USER_HANDLE,
                COLUMN_SATELLITE_ENABLED,
                COLUMN_SATELLITE_ATTACH_ENABLED_FOR_CARRIER
                COLUMN_SATELLITE_ATTACH_ENABLED_FOR_CARRIER,
                COLUMN_IS_NTN
        );

        /**
+5 −0
Original line number Diff line number Diff line
@@ -190,6 +190,11 @@
    </string-array>
    <java-symbol type="array" name="config_satellite_services_supported_by_providers" />

    <!-- The identifier of the satellite's eSIM profile preloaded on the device. The identifier is
    composed of MCC and MNC of the satellite PLMN with the format "mccmnc". -->
    <string name="config_satellite_esim_identifier" translatable="false"></string>
    <java-symbol type="string" name="config_satellite_esim_identifier" />

    <!-- Whether enhanced IWLAN handover check is enabled. If enabled, telephony frameworks
         will not perform handover if the target transport is out of service, or VoPS not
         supported. The network will be torn down on the source transport, and will be
+44 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.telephony;

import static android.text.TextUtils.formatSimple;

import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
@@ -44,6 +45,7 @@ import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;

import com.android.internal.telephony.flags.Flags;
import com.android.internal.telephony.util.TelephonyUtils;
import com.android.telephony.Rlog;

@@ -254,6 +256,11 @@ public class SubscriptionInfo implements Parcelable {
     */
    private final boolean mIsGroupDisabled;

    /**
     * Whether this subscription is used for communicating with non-terrestrial networks.
     */
    private final boolean mIsNtn;

    /**
     * @hide
     *
@@ -378,6 +385,7 @@ public class SubscriptionInfo implements Parcelable {
        this.mAreUiccApplicationsEnabled = areUiccApplicationsEnabled;
        this.mPortIndex = portIndex;
        this.mUsageSetting = usageSetting;
        this.mIsNtn = false;
    }

    /**
@@ -416,6 +424,7 @@ public class SubscriptionInfo implements Parcelable {
        this.mAreUiccApplicationsEnabled = builder.mAreUiccApplicationsEnabled;
        this.mPortIndex = builder.mPortIndex;
        this.mUsageSetting = builder.mUsageSetting;
        this.mIsNtn = builder.mIsNtn;
    }

    /**
@@ -862,6 +871,17 @@ public class SubscriptionInfo implements Parcelable {
        return mUsageSetting;
    }

    /**
     * Check if the subscription is exclusively for non-terrestrial networks.
     *
     * @return {@code true} if it is a non-terrestrial network subscription, {@code false}
     * otherwise.
     */
    @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
    public boolean isNtn() {
        return mIsNtn;
    }

    @NonNull
    public static final Parcelable.Creator<SubscriptionInfo> CREATOR =
            new Parcelable.Creator<SubscriptionInfo>() {
@@ -898,6 +918,7 @@ public class SubscriptionInfo implements Parcelable {
                            UiccAccessRule.CREATOR))
                    .setUiccApplicationsEnabled(source.readBoolean())
                    .setUsageSetting(source.readInt())
                    .setNtn(source.readBoolean())
                    .build();
        }

@@ -939,6 +960,7 @@ public class SubscriptionInfo implements Parcelable {
        dest.writeTypedArray(mCarrierConfigAccessRules, flags);
        dest.writeBoolean(mAreUiccApplicationsEnabled);
        dest.writeInt(mUsageSetting);
        dest.writeBoolean(mIsNtn);
    }

    @Override
@@ -1001,6 +1023,7 @@ public class SubscriptionInfo implements Parcelable {
                + " mType=" + SubscriptionManager.subscriptionTypeToString(mType)
                + " areUiccApplicationsEnabled=" + mAreUiccApplicationsEnabled
                + " usageSetting=" + SubscriptionManager.usageSettingToString(mUsageSetting)
                + " ntn=" + mIsNtn
                + "]";
    }

@@ -1025,7 +1048,8 @@ public class SubscriptionInfo implements Parcelable {
                that.mCardString) && Arrays.equals(mNativeAccessRules,
                that.mNativeAccessRules) && Arrays.equals(mCarrierConfigAccessRules,
                that.mCarrierConfigAccessRules) && Objects.equals(mGroupUuid, that.mGroupUuid)
                && mCountryIso.equals(that.mCountryIso) && mGroupOwner.equals(that.mGroupOwner);
                && mCountryIso.equals(that.mCountryIso) && mGroupOwner.equals(that.mGroupOwner)
                && mIsNtn == that.mIsNtn;
    }

    @Override
@@ -1034,7 +1058,7 @@ public class SubscriptionInfo implements Parcelable {
                mDisplayNameSource, mIconTint, mNumber, mDataRoaming, mMcc, mMnc, mIsEmbedded,
                mCardString, mIsOpportunistic, mGroupUuid, mCountryIso, mCarrierId, mProfileClass,
                mType, mGroupOwner, mAreUiccApplicationsEnabled, mPortIndex, mUsageSetting, mCardId,
                mIsGroupDisabled);
                mIsGroupDisabled, mIsNtn);
        result = 31 * result + Arrays.hashCode(mEhplmns);
        result = 31 * result + Arrays.hashCode(mHplmns);
        result = 31 * result + Arrays.hashCode(mNativeAccessRules);
@@ -1233,6 +1257,11 @@ public class SubscriptionInfo implements Parcelable {
        @UsageSetting
        private int mUsageSetting = SubscriptionManager.USAGE_SETTING_UNKNOWN;

        /**
         * {@code true} if it is a non-terrestrial network subscription, {@code false} otherwise.
         */
        private boolean mIsNtn = false;

        /**
         * Default constructor.
         */
@@ -1275,6 +1304,7 @@ public class SubscriptionInfo implements Parcelable {
            mAreUiccApplicationsEnabled = info.mAreUiccApplicationsEnabled;
            mPortIndex = info.mPortIndex;
            mUsageSetting = info.mUsageSetting;
            mIsNtn = info.mIsNtn;
        }

        /**
@@ -1659,6 +1689,18 @@ public class SubscriptionInfo implements Parcelable {
            return this;
        }

        /**
         * Set whether the subscription is exclusively used for non-terrestrial networks or not.
         *
         * @param isNtn {@code true} if the subscription is for NTN, {@code false} otherwise.
         * @return The builder.
         */
        @NonNull
        public Builder setNtn(boolean isNtn) {
            mIsNtn = isNtn;
            return this;
        }

        /**
         * Build the {@link SubscriptionInfo}.
         *
+8 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,14 @@ public class SubscriptionManager {
    public static final String SATELLITE_ATTACH_ENABLED_FOR_CARRIER =
            SimInfo.COLUMN_SATELLITE_ATTACH_ENABLED_FOR_CARRIER;

    /**
     * TelephonyProvider column name to identify eSIM profile of a non-terrestrial network.
     * By default, it's disabled.
     * <P>Type: INTEGER (int)</P>
     * @hide
     */
    public static final String IS_NTN = SimInfo.COLUMN_IS_NTN;

    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(prefix = {"USAGE_SETTING_"},
+45 −45

File changed.

Contains only whitespace changes.

Loading