From 8ab07284a92e1c15242b5e8ea4cf24ef532abbdb Mon Sep 17 00:00:00 2001
From: Nathan Harold
Requires {@link android.Manifest.permission#MODIFY_PHONE_STATE}
+ * or that the calling app has CarrierPrivileges for the given subscription.
+ *
+ * Note: This method will not allow the setting of USAGE_SETTING_UNKNOWN.
+ *
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
+ void setUsageSetting(int subscriptionId, @UsageSetting int usageSetting) {
+ if (VDBG) logd("[setUsageSetting]+ setting:" + usageSetting + " subId:" + subscriptionId);
+ setSubscriptionPropertyHelper(subscriptionId, "setUsageSetting",
+ (iSub)-> iSub.setUsageSetting(
+ usageSetting, subscriptionId, mContext.getOpPackageName()));
+ }
}
+
diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl
index a900c84c1819c..1e38b9215d76d 100755
--- a/telephony/java/com/android/internal/telephony/ISub.aidl
+++ b/telephony/java/com/android/internal/telephony/ISub.aidl
@@ -313,4 +313,15 @@ interface ISub {
void setPhoneNumber(int subId, int source, String number,
String callingPackage, String callingFeatureId);
+
+ /**
+ * Set the Usage Setting for this subscription.
+ *
+ * @param usageSetting the usage setting for this subscription
+ * @param subId the unique SubscriptionInfo index in database
+ * @param callingPackage The package making the IPC.
+ *
+ * @throws SecurityException if doesn't have MODIFY_PHONE_STATE or Carrier Privileges
+ */
+ int setUsageSetting(int usageSetting, int subId, String callingPackage);
}
From 95aeb151f6b3ed977ec636a1646c48d431ae4124 Mon Sep 17 00:00:00 2001
From: Nathan Harold 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 3cadcb84d47ff..c36eb2f9cf657 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 2e4bb9d7f85f8..4e6a7a36d879e 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
+ * 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
+ * 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;