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

Commit dff34b3a authored by Nathan Harold's avatar Nathan Harold
Browse files

Expose Usage Setting API

Expose APIs as follows:
-A CarrierConfig key that allows carriers to override the
 device's usage setting.
-An API that allows callers to query the current usage setting
 for a given subscription.
-A set of constants to describe the usage setting.

Bug: 210023167
Test: atest SubscriptionManagerTest#testCellularUsageSetting;
Test: atest CarrierConfigManager#testGetConfig
Change-Id: I62534d6f304a297f646d1dd4b008a9a4d4a30560
parent 95aeb151
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -41469,6 +41469,7 @@ package android.telephony {
    field public static final String KEY_CDMA_NONROAMING_NETWORKS_STRING_ARRAY = "cdma_nonroaming_networks_string_array";
    field public static final String KEY_CDMA_ROAMING_MODE_INT = "cdma_roaming_mode_int";
    field public static final String KEY_CDMA_ROAMING_NETWORKS_STRING_ARRAY = "cdma_roaming_networks_string_array";
    field public static final String KEY_CELLULAR_USAGE_SETTING_INT = "cellular_usage_setting_int";
    field public static final String KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL = "check_pricing_with_carrier_data_roaming_bool";
    field public static final String KEY_CI_ACTION_ON_SYS_UPDATE_BOOL = "ci_action_on_sys_update_bool";
    field public static final String KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING = "ci_action_on_sys_update_extra_string";
@@ -43085,6 +43086,7 @@ package android.telephony {
    method public int getSimSlotIndex();
    method public int getSubscriptionId();
    method public int getSubscriptionType();
    method public int getUsageSetting();
    method public boolean isEmbedded();
    method public boolean isOpportunistic();
    method public void writeToParcel(android.os.Parcel, int);
@@ -43159,6 +43161,10 @@ package android.telephony {
    field public static final int PHONE_NUMBER_SOURCE_UICC = 1; // 0x1
    field public static final int SUBSCRIPTION_TYPE_LOCAL_SIM = 0; // 0x0
    field public static final int SUBSCRIPTION_TYPE_REMOTE_SIM = 1; // 0x1
    field public static final int USAGE_SETTING_DATA_CENTRIC = 2; // 0x2
    field public static final int USAGE_SETTING_DEFAULT = 0; // 0x0
    field public static final int USAGE_SETTING_UNKNOWN = -1; // 0xffffffff
    field public static final int USAGE_SETTING_VOICE_CENTRIC = 1; // 0x1
  }
  public static class SubscriptionManager.OnOpportunisticSubscriptionsChangedListener {
+4 −2
Original line number Diff line number Diff line
@@ -4473,6 +4473,10 @@ public class CarrierConfigManager {
     * network if the primary use case (voice or data) is not satisfied. Depending on the type
     * of device, it may operate in a voice or data-centric mode by default.
     *
     * <p>Sets the usage setting in accordance with 3gpp 24.301 sec 4.3 and 3gpp 24.501 sec 4.3.
     * Also refer to "UE's usage setting" as defined in 3gpp 24.301 section 3.1 and 3gpp 23.221
     * Annex A.
     *
     * Either omit this key or pass a value of
     * {@link SubscriptionManager#USAGE_SETTING_UNKNOWN unknown} to preserve the current setting.
     *
@@ -4480,8 +4484,6 @@ public class CarrierConfigManager {
     * {@link SubscriptionManager#USAGE_SETTING_VOICE_CENTRIC voice-centric},
     * or {@link SubscriptionManager#USAGE_SETTING_DATA_CENTRIC data-centric}.
     * {@see SubscriptionInfo#getUsageSetting}
     *
     * @hide
     */
    public static final String KEY_CELLULAR_USAGE_SETTING_INT =
            "cellular_usage_setting_int";
+0 −2
Original line number Diff line number Diff line
@@ -826,8 +826,6 @@ public class SubscriptionInfo implements Parcelable {
     * Get the usage setting for this subscription.
     *
     * @return the usage setting used for this subscription.
     *
     * @hide
     */
    public @UsageSetting int getUsageSetting() {
        return mUsageSetting;
+6 −6
Original line number Diff line number Diff line
@@ -1061,8 +1061,6 @@ public class SubscriptionManager {
     *
     * It may also be provided by a carrier that wishes to provide a value to avoid making any
     * settings changes.
     *
     * @hide
     */
    public static final int USAGE_SETTING_UNKNOWN = -1;

@@ -1076,22 +1074,24 @@ public class SubscriptionManager {
     * An opportunistic subscription will default to data-centric.
     *
     * {@see SubscriptionInfo#isOpportunistic}
     *
     * @hide
     */
    public static final int USAGE_SETTING_DEFAULT = 0;

    /**
     * This subscription is forced to voice-centric mode
     *
     * @hide
     * <p>Refer to voice-centric mode in 3gpp 24.301 sec 4.3 and 3gpp 24.501 sec 4.3.
     * Also refer to "UE's usage setting" as defined in 3gpp 24.301 section 3.1 and 3gpp 23.221
     * Annex A.
     */
    public static final int USAGE_SETTING_VOICE_CENTRIC = 1;

    /**
     * This subscription is forced to data-centric mode
     *
     * @hide
     * <p>Refer to data-centric mode in 3gpp 24.301 sec 4.3 and 3gpp 24.501 sec 4.3.
     * Also refer to "UE's usage setting" as defined in 3gpp 24.301 section 3.1 and 3gpp 23.221
     * Annex A.
     */
    public static final int USAGE_SETTING_DATA_CENTRIC = 2;