From 7da537a641d6d8ed3081373e3dad565133a89370 Mon Sep 17 00:00:00 2001 From: Hongbo Zeng Date: Fri, 5 Mar 2021 11:37:22 +0800 Subject: add capability for TelephonyManager.getNetworkSlicingConfiguration() - create CAPABILITY_SLICING_CONFIG_SUPPORTED in TelephonyManager - mark up getNetworkSlicingConfiguration() with CAPABILITY_SLICING_CONFIG_SUPPORTED Bug: 181713905 Test: atest RadioConfigResponseTest Change-Id: I68399eee66e43a719598961cb1a0d00db6b4e25a --- core/api/current.txt | 1 + telephony/java/android/telephony/TelephonyManager.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/core/api/current.txt b/core/api/current.txt index 93cc85accf96..18a990de9995 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -42447,6 +42447,7 @@ package android.telephony { field public static final int CALL_STATE_IDLE = 0; // 0x0 field public static final int CALL_STATE_OFFHOOK = 2; // 0x2 field public static final int CALL_STATE_RINGING = 1; // 0x1 + field public static final String CAPABILITY_SLICING_CONFIG_SUPPORTED = "CAPABILITY_SLICING_CONFIG_SUPPORTED"; field public static final int CDMA_ROAMING_MODE_AFFILIATED = 1; // 0x1 field public static final int CDMA_ROAMING_MODE_ANY = 2; // 0x2 field public static final int CDMA_ROAMING_MODE_HOME = 0; // 0x0 diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index a7f62042b60c..944b19ac246c 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -14932,6 +14932,13 @@ public class TelephonyManager { public static final String CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING = "CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING"; + /** + * Indicates whether {@link #getNetworkSlicingConfiguration} is supported. See comments on + * respective methods for more information. + */ + public static final String CAPABILITY_SLICING_CONFIG_SUPPORTED = + "CAPABILITY_SLICING_CONFIG_SUPPORTED"; + /** @hide */ @Retention(RetentionPolicy.SOURCE) @StringDef(prefix = "CAPABILITY_", value = { @@ -14939,6 +14946,7 @@ public class TelephonyManager { CAPABILITY_ALLOWED_NETWORK_TYPES_USED, CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE, CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING, + CAPABILITY_SLICING_CONFIG_SUPPORTED, }) public @interface RadioInterfaceCapability {} @@ -15584,9 +15592,15 @@ public class TelephonyManager { *
  • If the calling app has carrier privileges (see {@link #hasCarrierPrivileges}). * * + * This will be invalid if the device does not support + * android.telephony.TelephonyManager#CAPABILITY_SLICING_CONFIG_SUPPORTED. + * * @param executor the executor on which callback will be invoked. * @param callback a callback to receive the current slicing configuration. */ + @RequiresFeature( + enforcement = "android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported", + value = TelephonyManager.CAPABILITY_SLICING_CONFIG_SUPPORTED) @SuppressAutoDoc // No support for carrier privileges (b/72967236). @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getNetworkSlicingConfiguration( -- cgit v1.2.3-59-g8ed1b