summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nathan Harold <nharold@google.com> 2021-12-15 16:38:25 -0800
committer Nathan Harold <nharold@google.com> 2021-12-16 13:08:16 -0800
commitdff34b3a6a042e44c0320d3ad6f779b542aa4aaf (patch)
tree355659d9e8caa88288b5b606bab9e2d99f2fadb1
parent95aeb151f6b3ed977ec636a1646c48d431ae4124 (diff)
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
-rw-r--r--core/api/current.txt6
-rw-r--r--telephony/java/android/telephony/CarrierConfigManager.java6
-rw-r--r--telephony/java/android/telephony/SubscriptionInfo.java2
-rw-r--r--telephony/java/android/telephony/SubscriptionManager.java12
4 files changed, 16 insertions, 10 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index 49689e45275b..952c866f89d8 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -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 {
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 13d03f163ffd..53261cb0a599 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -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";
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java
index 3cadcb84d47f..c36eb2f9cf65 100644
--- a/telephony/java/android/telephony/SubscriptionInfo.java
+++ b/telephony/java/android/telephony/SubscriptionInfo.java
@@ -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;
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 2e4bb9d7f85f..4e6a7a36d879 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -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;