From 851004813ad7128220d6d53789bef9628ba1dcb5 Mon Sep 17 00:00:00 2001 From: chen xu Date: Fri, 12 Oct 2018 15:30:34 -0700 Subject: expose some Telephony.Carriers cols system APIs Bug: 117473154 Test: Telephony unit test Change-Id: I8e6b873842f42b8cb3244a14b6e6c5d9c1ae5318 --- api/system-current.txt | 17 ++++++ telephony/java/android/provider/Telephony.java | 84 ++++++++++++++++++-------- 2 files changed, 77 insertions(+), 24 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 57f9efab3f5b..66485fee5b79 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4283,6 +4283,23 @@ package android.provider { field public static final java.lang.String INSTANT_APPS_ENABLED = "instant_apps_enabled"; } + 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 int CARRIER_EDITED = 4; // 0x4 + field public static final java.lang.String EDITED = "edited"; + field public static final java.lang.String MAX_CONNS = "max_conns"; + field public static final java.lang.String MAX_CONNS_TIME = "max_conns_time"; + field public static final java.lang.String MODEM_COGNITIVE = "modem_cognitive"; + field public static final java.lang.String MTU = "mtu"; + field public static final int NO_SET_SET = 0; // 0x0 + field public static final int UNEDITED = 0; // 0x0 + field public static final int USER_DELETED = 2; // 0x2 + field public static final java.lang.String USER_EDITABLE = "user_editable"; + 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 WAIT_TIME = "wait_time"; + } + public final class TimeZoneRulesDataContract { field public static final java.lang.String AUTHORITY = "com.android.timezone"; } diff --git a/telephony/java/android/provider/Telephony.java b/telephony/java/android/provider/Telephony.java index d48f21b6dfcd..954bb44e8532 100644 --- a/telephony/java/android/provider/Telephony.java +++ b/telephony/java/android/provider/Telephony.java @@ -18,6 +18,7 @@ package android.provider; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; +import android.annotation.SystemApi; import android.annotation.TestApi; import android.annotation.UnsupportedAppUsage; import android.app.job.JobService; @@ -2813,100 +2814,131 @@ public final class Telephony { public static final String SUBSCRIPTION_ID = "sub_id"; /** - * The profile_id to which the APN saved in modem + * The profile_id to which the APN saved in modem. *

Type: INTEGER

*@hide */ public static final String PROFILE_ID = "profile_id"; /** - * Is the apn setting to be set in modem - *

Type: INTEGER (boolean)

+ * If set to {@code true}, then the APN setting will persist to the modem. + *

Type: INTEGER (boolean)

*@hide */ + @SystemApi public static final String MODEM_COGNITIVE = "modem_cognitive"; /** - * The max connections of this apn + * The max connections of this APN. *

Type: INTEGER

*@hide */ + @SystemApi public static final String MAX_CONNS = "max_conns"; /** - * The wait time for retry of the apn + * The wait time for retry of the APN. *

Type: INTEGER

*@hide */ + @SystemApi public static final String WAIT_TIME = "wait_time"; /** - * The time to limit max connection for the apn + * The time to limit max connection for the APN. *

Type: INTEGER

*@hide */ + @SystemApi public static final String MAX_CONNS_TIME = "max_conns_time"; /** - * The MTU size of the mobile interface to which the APN connected + * The MTU(Maxinum transmit unit) size of the mobile interface to which the APN connected. *

Type: INTEGER

* @hide */ + @SystemApi public static final String MTU = "mtu"; /** - * Is this APN added/edited/deleted by a user or carrier? + * APN edit status. APN could be added/edited/deleted by a user or carrier. *

Type: INTEGER

* @hide */ + @SystemApi public static final String EDITED = "edited"; /** - * Is this APN visible to the user? - *

Type: INTEGER (boolean)

+ * {@code true} if this APN visible to the user, {@code false} otherwise. + *

Type: INTEGER (boolean)

* @hide */ + @SystemApi public static final String USER_VISIBLE = "user_visible"; /** - * Is the user allowed to edit this APN? - *

Type: INTEGER (boolean)

+ * {@code true} if the user allowed to edit this APN, {@code false} otherwise. + *

Type: INTEGER (boolean)

* @hide */ + @SystemApi public static final String USER_EDITABLE = "user_editable"; /** - * Following are possible values for the EDITED field + * {@link #EDITED APN edit status} indicates that this APN has not been edited or fails to + * edit. + *

Type: INTEGER

* @hide */ + @SystemApi public static final int UNEDITED = 0; + /** - * @hide + * {@link #EDITED APN edit status} indicates that this APN has been edited by users. + *

Type: INTEGER

+ * @hide */ + @SystemApi public static final int USER_EDITED = 1; + /** - * @hide + * {@link #EDITED APN edit status} indicates that this APN has been deleted by users. + *

Type: INTEGER

+ * @hide */ + @SystemApi public static final int USER_DELETED = 2; + /** - * DELETED_BUT_PRESENT 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 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; + /** - * @hide + * {@link #EDITED APN edit status} indicates that this APN has been edited by carriers. + *

Type: INTEGER

+ * @hide */ + @SystemApi public static final int CARRIER_EDITED = 4; + /** - * CARRIER_DELETED values are currently not used as there is no usecase. If they are used, + * {@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. + *

Type: INTEGER

* @hide */ public static final int CARRIER_DELETED = 5; + /** - * @hide + * {@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. + * @hide */ public static final int CARRIER_DELETED_BUT_PRESENT_IN_XML = 6; @@ -2935,16 +2967,20 @@ public final class Telephony { * The APN set id. When the user manually selects an APN or the framework sets an APN as * preferred, all APNs with the same set id as the selected APN should be prioritized over * APNs in other sets. + *

Type: INTEGER

* @hide */ + @SystemApi public static final String APN_SET_ID = "apn_set_id"; /** - * Possible value for the 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 with no set set, there is no need to prioritize + * any specific APN set ids. + *

Type: INTEGER

* @hide */ + @SystemApi public static final int NO_SET_SET = 0; } -- cgit v1.2.3