address API council feedbacks for Telephony.Carriers

Bug: 118296421
Test: telephony unit test
Change-Id: Ib26db49e5fa6891c2176124681172c271e6cc423
diff --git a/telephony/java/android/provider/Telephony.java b/telephony/java/android/provider/Telephony.java
index b3e1ffa..6a396ce 100644
--- a/telephony/java/android/provider/Telephony.java
+++ b/telephony/java/android/provider/Telephony.java
@@ -16,6 +16,7 @@
 
 package android.provider;
 
+import android.annotation.IntDef;
 import android.annotation.RequiresPermission;
 import android.annotation.SdkConstant;
 import android.annotation.SdkConstant.SdkConstantType;
@@ -44,6 +45,8 @@
 import com.android.internal.telephony.PhoneConstants;
 import com.android.internal.telephony.SmsApplication;
 
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.regex.Matcher;
@@ -2962,34 +2965,36 @@
          *@hide
          */
         @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>
          *@hide
          */
         @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>
          *@hide
          */
         @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>
          *@hide
          */
         @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>
          * @hide
          */
@@ -2998,11 +3003,19 @@
 
         /**
          * 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>
          * @hide
          */
         @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.
@@ -3021,59 +3034,61 @@
         public static final String USER_EDITABLE = "user_editable";
 
         /**
-         * {@link #EDITED APN edit status} indicates that this APN has not been edited or fails to
-         * edit.
+         * {@link #EDITED_STATUS APN edit status} indicates that this APN has not been edited or
+         * fails to edit.
          * <p>Type: INTEGER </p>
          * @hide
          */
         @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>
          * @hide
          */
         @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>
          * @hide
          */
         @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
-         * deleted by the user is still present in the new APN database and therefore must remain
-         * tagged as user deleted rather than completely removed from the database.
+         * {@link #EDITED_STATUS APN edit status} is an intermediate value used to indicate that an
+         * entry deleted by the user is still present in the new APN database and therefore must
+         * remain tagged as user deleted rather than completely removed from the database.
          * @hide
          */
         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>
          * @hide
          */
         @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.
-         * CARRIER_DELETED values are currently not used as there is no use case. If they are used,
-         * delete() will have to change accordingly. Currently it is hardcoded to USER_DELETED.
+         * {@link #EDITED_STATUS APN edit status} indicates that this APN has been deleted by
+         * carriers. CARRIER_DELETED values are currently not used as there is no use case.
+         * If they are used, delete() will have to change accordingly. Currently it is hardcoded to
+         * USER_DELETED.
          * <p>Type: INTEGER </p>
          * @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
-         * deleted by the carrier is still present in the new APN database and therefore must remain
-         * tagged as user deleted rather than completely removed from the database.
+         * {@link #EDITED_STATUS APN edit status} is an intermediate value used to indicate that an
+         * entry deleted by the carrier is still present in the new APN database and therefore must
+         * remain tagged as user deleted rather than completely removed from the database.
          * @hide
          */
         public static final int CARRIER_DELETED_BUT_PRESENT_IN_XML = 6;
@@ -3110,14 +3125,14 @@
         public static final String APN_SET_ID = "apn_set_id";
 
         /**
-         * 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
-         * any specific APN set ids.
+         * 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 without apn set id, there is no need to
+         * prioritize any specific APN set ids.
          * <p>Type: INTEGER</p>
          * @hide
          */
         @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
@@ -3126,6 +3141,17 @@
          */
         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 {}
+
     }
 
     /**