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

Commit 42055629 authored by Chen Xu's avatar Chen Xu Committed by Android (Google) Code Review
Browse files

Merge "address API council feedbacks for Telephony.Carriers"

parents 086ad0ed 5caa18cb
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -4668,18 +4668,18 @@ package android.provider {
  public static final class Telephony.Carriers implements android.provider.BaseColumns {
  public static final class Telephony.Carriers implements android.provider.BaseColumns {
    field public static final java.lang.String APN_SET_ID = "apn_set_id";
    field public static final java.lang.String APN_SET_ID = "apn_set_id";
    field public static final int CARRIER_EDITED = 4; // 0x4
    field public static final int CARRIER_EDITED = 4; // 0x4
    field public static final java.lang.String EDITED = "edited";
    field public static final java.lang.String EDITED_STATUS = "edited";
    field public static final java.lang.String MAX_CONNS = "max_conns";
    field public static final java.lang.String MAX_CONNECTIONS = "max_conns";
    field public static final java.lang.String MAX_CONNS_TIME = "max_conns_time";
    field public static final java.lang.String MODEM_PERSIST = "modem_cognitive";
    field public static final java.lang.String MODEM_COGNITIVE = "modem_cognitive";
    field public static final java.lang.String MTU = "mtu";
    field public static final java.lang.String MTU = "mtu";
    field public static final int NO_SET_SET = 0; // 0x0
    field public static final int NO_APN_SET_ID = 0; // 0x0
    field public static final java.lang.String TIME_LIMIT_FOR_MAX_CONNECTIONS = "max_conns_time";
    field public static final int UNEDITED = 0; // 0x0
    field public static final int UNEDITED = 0; // 0x0
    field public static final int USER_DELETED = 2; // 0x2
    field public static final int USER_DELETED = 2; // 0x2
    field public static final java.lang.String USER_EDITABLE = "user_editable";
    field public static final java.lang.String USER_EDITABLE = "user_editable";
    field public static final int USER_EDITED = 1; // 0x1
    field public static final int USER_EDITED = 1; // 0x1
    field public static final java.lang.String USER_VISIBLE = "user_visible";
    field public static final java.lang.String USER_VISIBLE = "user_visible";
    field public static final java.lang.String WAIT_TIME = "wait_time";
    field public static final java.lang.String WAIT_TIME_RETRY = "wait_time";
  }
  }


  public final class TimeZoneRulesDataContract {
  public final class TimeZoneRulesDataContract {
+58 −32
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.provider;
package android.provider;


import android.annotation.IntDef;
import android.annotation.RequiresPermission;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SdkConstant.SdkConstantType;
@@ -44,6 +45,8 @@ import android.util.Patterns;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.SmsApplication;
import com.android.internal.telephony.SmsApplication;


import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.HashSet;
import java.util.HashSet;
import java.util.Set;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Matcher;
@@ -2962,34 +2965,36 @@ public final class Telephony {
         *@hide
         *@hide
         */
         */
        @SystemApi
        @SystemApi
        public static final String MODEM_COGNITIVE = "modem_cognitive";
        public static final String MODEM_PERSIST = "modem_cognitive";


        /**
        /**
         * The max connections of this APN.
         * The max number of connections of this APN.
         * <p>Type: INTEGER</p>
         * <p>Type: INTEGER</p>
         *@hide
         *@hide
         */
         */
        @SystemApi
        @SystemApi
        public static final String MAX_CONNS = "max_conns";
        public static final String MAX_CONNECTIONS = "max_conns";


        /**
        /**
         * The wait time for retry of the APN.
         * The wait time for retrying the APN, in milliseconds.
         * <p>Type: INTEGER</p>
         * <p>Type: INTEGER</p>
         *@hide
         *@hide
         */
         */
        @SystemApi
        @SystemApi
        public static final String WAIT_TIME = "wait_time";
        public static final String WAIT_TIME_RETRY = "wait_time";


        /**
        /**
         * The time to limit max connection for the APN.
         * The max number of seconds this APN will support its maximum number of connections
         * as defined in {@link #MAX_CONNECTIONS}.
         * <p>Type: INTEGER</p>
         * <p>Type: INTEGER</p>
         *@hide
         *@hide
         */
         */
        @SystemApi
        @SystemApi
        public static final String MAX_CONNS_TIME = "max_conns_time";
        public static final String TIME_LIMIT_FOR_MAX_CONNECTIONS = "max_conns_time";


        /**
        /**
         * The MTU(Maxinum transmit unit) size of the mobile interface to which the APN connected.
         * The MTU (maximum transmit unit) size of the mobile interface to which the APN is
         * connected, in bytes.
         * <p>Type: INTEGER </p>
         * <p>Type: INTEGER </p>
         * @hide
         * @hide
         */
         */
@@ -2998,11 +3003,19 @@ public final class Telephony {


        /**
        /**
         * APN edit status. APN could be added/edited/deleted by a user or carrier.
         * APN edit status. APN could be added/edited/deleted by a user or carrier.
         * see all possible returned APN edit status.
         * <ul>
         *     <li>{@link #UNEDITED}</li>
         *     <li>{@link #USER_EDITED}</li>
         *     <li>{@link #USER_DELETED}</li>
         *     <li>{@link #CARRIER_EDITED}</li>
         *     <li>{@link #CARRIER_DELETED}</li>
         * </ul>
         * <p>Type: INTEGER </p>
         * <p>Type: INTEGER </p>
         * @hide
         * @hide
         */
         */
        @SystemApi
        @SystemApi
        public static final String EDITED = "edited";
        public static final String EDITED_STATUS = "edited";


        /**
        /**
         * {@code true} if this APN visible to the user, {@code false} otherwise.
         * {@code true} if this APN visible to the user, {@code false} otherwise.
@@ -3021,59 +3034,61 @@ public final class Telephony {
        public static final String USER_EDITABLE = "user_editable";
        public static final String USER_EDITABLE = "user_editable";


        /**
        /**
         * {@link #EDITED APN edit status} indicates that this APN has not been edited or fails to
         * {@link #EDITED_STATUS APN edit status} indicates that this APN has not been edited or
         * edit.
         * fails to edit.
         * <p>Type: INTEGER </p>
         * <p>Type: INTEGER </p>
         * @hide
         * @hide
         */
         */
        @SystemApi
        @SystemApi
        public static final int UNEDITED = 0;
        public static final @EditStatus int UNEDITED = 0;


        /**
        /**
         * {@link #EDITED APN edit status} indicates that this APN has been edited by users.
         * {@link #EDITED_STATUS APN edit status} indicates that this APN has been edited by users.
         * <p>Type: INTEGER </p>
         * <p>Type: INTEGER </p>
         * @hide
         * @hide
         */
         */
        @SystemApi
        @SystemApi
        public static final int USER_EDITED = 1;
        public static final @EditStatus int USER_EDITED = 1;


        /**
        /**
         * {@link #EDITED APN edit status} indicates that this APN has been deleted by users.
         * {@link #EDITED_STATUS APN edit status} indicates that this APN has been deleted by users.
         * <p>Type: INTEGER </p>
         * <p>Type: INTEGER </p>
         * @hide
         * @hide
         */
         */
        @SystemApi
        @SystemApi
        public static final int USER_DELETED = 2;
        public static final @EditStatus int USER_DELETED = 2;


        /**
        /**
         * {@link #EDITED APN edit status} is an intermediate value used to indicate that an entry
         * {@link #EDITED_STATUS APN edit status} is an intermediate value used to indicate that an
         * deleted by the user is still present in the new APN database and therefore must remain
         * entry deleted by the user is still present in the new APN database and therefore must
         * tagged as user deleted rather than completely removed from the database.
         * remain tagged as user deleted rather than completely removed from the database.
         * @hide
         * @hide
         */
         */
        public static final int USER_DELETED_BUT_PRESENT_IN_XML = 3;
        public static final int USER_DELETED_BUT_PRESENT_IN_XML = 3;


        /**
        /**
         * {@link #EDITED APN edit status} indicates that this APN has been edited by carriers.
         * {@link #EDITED_STATUS APN edit status} indicates that this APN has been edited by
         * carriers.
         * <p>Type: INTEGER </p>
         * <p>Type: INTEGER </p>
         * @hide
         * @hide
         */
         */
        @SystemApi
        @SystemApi
        public static final int CARRIER_EDITED = 4;
        public static final @EditStatus int CARRIER_EDITED = 4;


        /**
        /**
         * {@link #EDITED APN edit status} indicates that this APN has been deleted by carriers.
         * {@link #EDITED_STATUS APN edit status} indicates that this APN has been deleted by
         * CARRIER_DELETED values are currently not used as there is no use case. If they are used,
         * carriers. CARRIER_DELETED values are currently not used as there is no use case.
         * delete() will have to change accordingly. Currently it is hardcoded to USER_DELETED.
         * If they are used, delete() will have to change accordingly. Currently it is hardcoded to
         * USER_DELETED.
         * <p>Type: INTEGER </p>
         * <p>Type: INTEGER </p>
         * @hide
         * @hide
         */
         */
        public static final int CARRIER_DELETED = 5;
        public static final @EditStatus int CARRIER_DELETED = 5;


        /**
        /**
         * {@link #EDITED APN edit status} is an intermediate value used to indicate that an entry
         * {@link #EDITED_STATUS APN edit status} is an intermediate value used to indicate that an
         * deleted by the carrier is still present in the new APN database and therefore must remain
         * entry deleted by the carrier is still present in the new APN database and therefore must
         * tagged as user deleted rather than completely removed from the database.
         * remain tagged as user deleted rather than completely removed from the database.
         * @hide
         * @hide
         */
         */
        public static final int CARRIER_DELETED_BUT_PRESENT_IN_XML = 6;
        public static final int CARRIER_DELETED_BUT_PRESENT_IN_XML = 6;
@@ -3111,13 +3126,13 @@ public final class Telephony {


        /**
        /**
         * Possible value for the {@link #APN_SET_ID} field. By default APNs will not belong to a
         * Possible value for the {@link #APN_SET_ID} field. By default APNs will not belong to a
         * set. If the user manually selects an APN with no set set, there is no need to prioritize
         * set. If the user manually selects an APN without apn set id, there is no need to
         * any specific APN set ids.
         * prioritize any specific APN set ids.
         * <p>Type: INTEGER</p>
         * <p>Type: INTEGER</p>
         * @hide
         * @hide
         */
         */
        @SystemApi
        @SystemApi
        public static final int NO_SET_SET = 0;
        public static final int NO_APN_SET_ID = 0;


        /**
        /**
         * A unique carrier id associated with this APN
         * A unique carrier id associated with this APN
@@ -3126,6 +3141,17 @@ public final class Telephony {
         */
         */
        public static final String CARRIER_ID = "carrier_id";
        public static final String CARRIER_ID = "carrier_id";


        /** @hide */
        @IntDef({
                UNEDITED,
                USER_EDITED,
                USER_DELETED,
                CARRIER_DELETED,
                CARRIER_EDITED,
        })
        @Retention(RetentionPolicy.SOURCE)
        public @interface EditStatus {}

    }
    }


    /**
    /**
+6 −6
Original line number Original line Diff line number Diff line
@@ -693,7 +693,7 @@ public class ApnSetting implements Parcelable {
            mmsc, mmsProxyAddress, mmsProxyPort, user, password, authType, mApnTypeBitmask,
            mmsc, mmsProxyAddress, mmsProxyPort, user, password, authType, mApnTypeBitmask,
            protocol, roamingProtocol, carrierEnabled, networkTypeBitmask, profileId,
            protocol, roamingProtocol, carrierEnabled, networkTypeBitmask, profileId,
            modemCognitive, maxConns, waitTime, maxConnsTime, mtu, mvnoType, mvnoMatchData,
            modemCognitive, maxConns, waitTime, maxConnsTime, mtu, mvnoType, mvnoMatchData,
            Carriers.NO_SET_SET, TelephonyManager.UNKNOWN_CARRIER_ID);
            Carriers.NO_APN_SET_ID, TelephonyManager.UNKNOWN_CARRIER_ID);
    }
    }


    /**
    /**
@@ -740,11 +740,11 @@ public class ApnSetting implements Parcelable {
            networkTypeBitmask,
            networkTypeBitmask,
            cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.PROFILE_ID)),
            cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.PROFILE_ID)),
            cursor.getInt(cursor.getColumnIndexOrThrow(
            cursor.getInt(cursor.getColumnIndexOrThrow(
                Telephony.Carriers.MODEM_COGNITIVE)) == 1,
                Telephony.Carriers.MODEM_PERSIST)) == 1,
            cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.MAX_CONNS)),
            cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.MAX_CONNECTIONS)),
            cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.WAIT_TIME)),
            cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.WAIT_TIME_RETRY)),
            cursor.getInt(cursor.getColumnIndexOrThrow(
            cursor.getInt(cursor.getColumnIndexOrThrow(
                Telephony.Carriers.MAX_CONNS_TIME)),
                Telephony.Carriers.TIME_LIMIT_FOR_MAX_CONNECTIONS)),
            cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.MTU)),
            cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.MTU)),
            getMvnoTypeIntFromString(
            getMvnoTypeIntFromString(
                cursor.getString(cursor.getColumnIndexOrThrow(
                cursor.getString(cursor.getColumnIndexOrThrow(
@@ -870,7 +870,7 @@ public class ApnSetting implements Parcelable {
        int mtu = UNSET_MTU;
        int mtu = UNSET_MTU;
        String mvnoType = "";
        String mvnoType = "";
        String mvnoMatchData = "";
        String mvnoMatchData = "";
        int apnSetId = Carriers.NO_SET_SET;
        int apnSetId = Carriers.NO_APN_SET_ID;
        int carrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
        int carrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
        if (version == 1) {
        if (version == 1) {
            typeArray = new String[a.length - 13];
            typeArray = new String[a.length - 13];