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

Commit 10bd717c authored by Hyosun Kim's avatar Hyosun Kim
Browse files

Support NTN-Capable Subscription API

1. Add new carrier configuration value satellite_esos_supported_bool.
2. Add a new column the COLUMN_SATELLITE_ESOS_SUPPORTED to TelephonyProvider's SimInfo.
3. Change the column name from the COLUMN_IS_NTN to COLUMN_IS_ONLY_NTN in TelephonyProvider's SimInfo.

Bug: 348076778
Test: atest CarrierConfigManagerTest
Test: manual test b/348076778#comment2
Flag: com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn

Change-Id: I6793d768ef225648ac75fdf2767421134031e055
parent 65cb6056
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -43901,6 +43901,7 @@ package android.telephony {
    field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT = "satellite_connection_hysteresis_sec_int";
    field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_ENTITLEMENT_STATUS_REFRESH_DAYS_INT = "satellite_entitlement_status_refresh_days_int";
    field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL = "satellite_entitlement_supported_bool";
    field @FlaggedApi("com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn") public static final String KEY_SATELLITE_ESOS_SUPPORTED_BOOL = "satellite_esos_supported_bool";
    field public static final String KEY_SHOW_4G_FOR_3G_DATA_ICON_BOOL = "show_4g_for_3g_data_icon_bool";
    field public static final String KEY_SHOW_4G_FOR_LTE_DATA_ICON_BOOL = "show_4g_for_lte_data_icon_bool";
    field public static final String KEY_SHOW_APN_SETTING_CDMA_BOOL = "show_apn_setting_cdma_bool";
+13 −3
Original line number Diff line number Diff line
@@ -4940,7 +4940,7 @@ public final class Telephony {
         *
         * @hide
         */
        public static final String COLUMN_IS_NTN = "is_ntn";
        public static final String COLUMN_IS_ONLY_NTN = "is_only_ntn";

        /**
         * TelephonyProvider column name for transferred status
@@ -4976,6 +4976,15 @@ public final class Telephony {
        public static final String COLUMN_SATELLITE_ENTITLEMENT_PLMNS =
                "satellite_entitlement_plmns";

        /**
         * TelephonyProvider column name to indicate the satellite ESOS supported. The value of this
         * column is set based on {@link CarrierConfigManager#KEY_SATELLITE_ESOS_SUPPORTED_BOOL}.
         * By default, it's disabled.
         *
         * @hide
         */
        public static final String COLUMN_SATELLITE_ESOS_SUPPORTED = "satellite_esos_supported";

        /** All columns in {@link SimInfo} table. */
        private static final List<String> ALL_COLUMNS = List.of(
                COLUMN_UNIQUE_KEY_SUBSCRIPTION_ID,
@@ -5047,11 +5056,12 @@ public final class Telephony {
                COLUMN_USER_HANDLE,
                COLUMN_SATELLITE_ENABLED,
                COLUMN_SATELLITE_ATTACH_ENABLED_FOR_CARRIER,
                COLUMN_IS_NTN,
                COLUMN_IS_ONLY_NTN,
                COLUMN_SERVICE_CAPABILITIES,
                COLUMN_TRANSFER_STATUS,
                COLUMN_SATELLITE_ENTITLEMENT_STATUS,
                COLUMN_SATELLITE_ENTITLEMENT_PLMNS
                COLUMN_SATELLITE_ENTITLEMENT_PLMNS,
                COLUMN_SATELLITE_ESOS_SUPPORTED
        );

        /**
+13 −0
Original line number Diff line number Diff line
@@ -9980,6 +9980,18 @@ public class CarrierConfigManager {
    public static final String KEY_CARRIER_ROAMING_SATELLITE_DEFAULT_SERVICES_INT_ARRAY =
            "carrier_roaming_satellite_default_services_int_array";
    /**
     * Indicate whether carrier roaming to satellite is using ESOS (Emergency SOS) which connects
     * to an emergency provider instead of PSAP (Public Safety Answering Point) for emergency
     * messaging.
     *
     * This will need agreement with carriers before enabling this flag.
     *
     * The default value is false.
     */
    @FlaggedApi(Flags.FLAG_CARRIER_ROAMING_NB_IOT_NTN)
    public static final String KEY_SATELLITE_ESOS_SUPPORTED_BOOL = "satellite_esos_supported_bool";
    /**
     * Indicating whether DUN APN should be disabled when the device is roaming. In that case,
     * the default APN (i.e. internet) will be used for tethering.
@@ -11137,6 +11149,7 @@ public class CarrierConfigManager {
        sDefaults.putBoolean(KEY_EMERGENCY_MESSAGING_SUPPORTED_BOOL, false);
        sDefaults.putInt(KEY_EMERGENCY_CALL_TO_SATELLITE_T911_HANDOVER_TIMEOUT_MILLIS_INT,
                (int) TimeUnit.SECONDS.toMillis(30));
        sDefaults.putBoolean(KEY_SATELLITE_ESOS_SUPPORTED_BOOL, false);
        sDefaults.putString(KEY_DEFAULT_PREFERRED_APN_NAME_STRING, "");
        sDefaults.putBoolean(KEY_SUPPORTS_CALL_COMPOSER_BOOL, false);
        sDefaults.putBoolean(KEY_SUPPORTS_BUSINESS_CALL_COMPOSER_BOOL, false);
+47 −2
Original line number Diff line number Diff line
@@ -273,6 +273,11 @@ public class SubscriptionInfo implements Parcelable {
     */
    private final int mServiceCapabilities;

    /**
     * Whether the carrier roaming to satellite is using ESOS for emergency messaging.
     */
    private final boolean mIsSatelliteESOSSupported;

    /**
     * @hide
     *
@@ -400,6 +405,7 @@ public class SubscriptionInfo implements Parcelable {
        this.mIsOnlyNonTerrestrialNetwork = false;
        this.mServiceCapabilities = 0;
        this.mTransferStatus = 0;
        this.mIsSatelliteESOSSupported = false;
    }

    /**
@@ -441,6 +447,7 @@ public class SubscriptionInfo implements Parcelable {
        this.mIsOnlyNonTerrestrialNetwork = builder.mIsOnlyNonTerrestrialNetwork;
        this.mServiceCapabilities = builder.mServiceCapabilities;
        this.mTransferStatus = builder.mTransferStatus;
        this.mIsSatelliteESOSSupported = builder.mIsSatelliteESOSSupported;
    }

    /**
@@ -898,6 +905,19 @@ public class SubscriptionInfo implements Parcelable {
        return mIsOnlyNonTerrestrialNetwork;
    }


    /**
     * Checks if the subscription is supported ESOS over Carrier Roaming NB-IOT Satellite.
     *
     * @return {@code true} if the subscription supports ESOS over Carrier Roaming NB-IOT Satellite,
     * {@code false} otherwise.
     * @hide
     */
    @FlaggedApi(Flags.FLAG_CARRIER_ROAMING_NB_IOT_NTN)
    public boolean isSatelliteESOSSupported() {
        return mIsSatelliteESOSSupported;
    }

    // TODO(b/316183370): replace @code with @link in javadoc after feature is released
    /**
     * Retrieves the service capabilities for the current subscription.
@@ -989,6 +1009,7 @@ public class SubscriptionInfo implements Parcelable {
                    .setServiceCapabilities(
                            SubscriptionManager.getServiceCapabilitiesSet(source.readInt()))
                    .setTransferStatus(source.readInt())
                    .setSatelliteESOSSupported(source.readBoolean())
                    .build();
        }

@@ -1033,6 +1054,7 @@ public class SubscriptionInfo implements Parcelable {
        dest.writeBoolean(mIsOnlyNonTerrestrialNetwork);
        dest.writeInt(mServiceCapabilities);
        dest.writeInt(mTransferStatus);
        dest.writeBoolean(mIsSatelliteESOSSupported);
    }

    @Override
@@ -1099,6 +1121,7 @@ public class SubscriptionInfo implements Parcelable {
                + " serviceCapabilities=" + SubscriptionManager.getServiceCapabilitiesSet(
                mServiceCapabilities).toString()
                + " transferStatus=" + mTransferStatus
                + " isSatelliteESOSSupported=" + mIsSatelliteESOSSupported
                + "]";
    }

@@ -1126,7 +1149,8 @@ public class SubscriptionInfo implements Parcelable {
                && mCountryIso.equals(that.mCountryIso) && mGroupOwner.equals(that.mGroupOwner)
                && mIsOnlyNonTerrestrialNetwork == that.mIsOnlyNonTerrestrialNetwork
                && mServiceCapabilities == that.mServiceCapabilities
                && mTransferStatus == that.mTransferStatus;
                && mTransferStatus == that.mTransferStatus
                && mIsSatelliteESOSSupported == that.mIsSatelliteESOSSupported;
    }

    @Override
@@ -1136,7 +1160,7 @@ public class SubscriptionInfo implements Parcelable {
                mCardString, mIsOpportunistic, mGroupUuid, mCountryIso, mCarrierId, mProfileClass,
                mType, mGroupOwner, mAreUiccApplicationsEnabled, mPortIndex, mUsageSetting, mCardId,
                mIsGroupDisabled, mIsOnlyNonTerrestrialNetwork, mServiceCapabilities,
                mTransferStatus);
                mTransferStatus, mIsSatelliteESOSSupported);
        result = 31 * result + Arrays.hashCode(mEhplmns);
        result = 31 * result + Arrays.hashCode(mHplmns);
        result = 31 * result + Arrays.hashCode(mNativeAccessRules);
@@ -1346,6 +1370,11 @@ public class SubscriptionInfo implements Parcelable {
         * Service capabilities bitmasks the subscription supports.
         */
        private int mServiceCapabilities = 0;
        /**
         * {@code true} if the subscription supports ESOS over Carrier Roaming NB-IOT Satellite.
         * {@code false} otherwise.
         */
        private boolean mIsSatelliteESOSSupported = false;

        /**
         * Default constructor.
@@ -1392,6 +1421,7 @@ public class SubscriptionInfo implements Parcelable {
            mIsOnlyNonTerrestrialNetwork = info.mIsOnlyNonTerrestrialNetwork;
            mServiceCapabilities = info.mServiceCapabilities;
            mTransferStatus = info.mTransferStatus;
            mIsSatelliteESOSSupported = info.mIsSatelliteESOSSupported;
        }

        /**
@@ -1827,6 +1857,21 @@ public class SubscriptionInfo implements Parcelable {
            return this;
        }

        /**
         * Set whether the subscription is supported ESOS over Carrier Roaming NB-IOT Satellite or
         * not.
         *
         * @param isSatelliteESOSSupported {@code true} if the subscription supports ESOS over
         * Carrier Roaming NB-IOT Satellite, {@code false} otherwise.
         * @return The builder.
         */
        @FlaggedApi(Flags.FLAG_CARRIER_ROAMING_NB_IOT_NTN)
        @NonNull
        public Builder setSatelliteESOSSupported(boolean isSatelliteESOSSupported) {
            mIsSatelliteESOSSupported = isSatelliteESOSSupported;
            return this;
        }

        /**
         * Build the {@link SubscriptionInfo}.
         *
+11 −1
Original line number Diff line number Diff line
@@ -1127,7 +1127,7 @@ public class SubscriptionManager {
     * <P>Type: INTEGER (int)</P>
     * @hide
     */
    public static final String IS_NTN = SimInfo.COLUMN_IS_NTN;
    public static final String IS_ONLY_NTN = SimInfo.COLUMN_IS_ONLY_NTN;

    /**
     * TelephonyProvider column name to identify service capabilities.
@@ -1167,6 +1167,16 @@ public class SubscriptionManager {
    public static final String SATELLITE_ENTITLEMENT_PLMNS =
            SimInfo.COLUMN_SATELLITE_ENTITLEMENT_PLMNS;

    /**
     * TelephonyProvider column name to indicate the satellite ESOS supported. The value of this
     * column is set based on {@link CarrierConfigManager#KEY_SATELLITE_ESOS_SUPPORTED_BOOL}.
     * By default, it's disabled.
     * <P>Type: INTEGER (int)</P>
     *
     * @hide
     */
    public static final String SATELLITE_ESOS_SUPPORTED = SimInfo.COLUMN_SATELLITE_ESOS_SUPPORTED;

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