Skip to content
Snippets Groups Projects
Commit 5cd37e81 authored by joonhunshin's avatar joonhunshin Committed by Joonhun Shin
Browse files

Enforce map the telephony features with APIs in

CarrierConfigManager

If the required telephony feature is not defined, throw
UnsupportedOperationException

Bug: 297989574
Test: atest CarrierConfigManagerTest
Change-Id: Ibf3db4d054be4389981f6bda0b07a657cd2bd662
parent f1cb2e98
No related branches found
No related tags found
No related merge requests found
......@@ -10898,6 +10898,9 @@ public class CarrierConfigManager {
* @return A {@link PersistableBundle} containing the config for the given subId, or default
* values for an invalid subId.
*
* @throws UnsupportedOperationException If the device does not have
* {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}.
*
* @deprecated Use {@link #getConfigForSubId(int, String...)} instead.
*/
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
......@@ -10945,6 +10948,9 @@ public class CarrierConfigManager {
* @return A {@link PersistableBundle} with key/value mapping for the specified configuration
* on success, or an empty (but never null) bundle on failure (for example, when the calling app
* has no permission).
*
* @throws UnsupportedOperationException If the device does not have
* {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}.
*/
@RequiresPermission(anyOf = {
Manifest.permission.READ_PHONE_STATE,
......@@ -10990,6 +10996,9 @@ public class CarrierConfigManager {
* @param overrideValues Key-value pairs of the values that are to be overridden. If set to
* {@code null}, this will remove all previous overrides and set the
* carrier configuration back to production values.
*
* @throws UnsupportedOperationException If the device does not have
* {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}.
* @hide
*/
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
......@@ -11047,6 +11056,10 @@ public class CarrierConfigManager {
*
* @see #getConfigForSubId
* @see #getConfig(String...)
*
* @throws UnsupportedOperationException If the device does not have
* {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}.
*
* @deprecated use {@link #getConfig(String...)} instead.
*/
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
......@@ -11081,6 +11094,9 @@ public class CarrierConfigManager {
* configs on success, or an empty (but never null) bundle on failure.
* @see #getConfigForSubId(int, String...)
* @see SubscriptionManager#getDefaultSubscriptionId()
*
* @throws UnsupportedOperationException If the device does not have
* {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}.
*/
@RequiresPermission(anyOf = {
Manifest.permission.READ_PHONE_STATE,
......@@ -11132,6 +11148,9 @@ public class CarrierConfigManager {
*
* <p>This method returns before the reload has completed, and {@link
* android.service.carrier.CarrierService#onLoadConfig} will be called from an arbitrary thread.
*
* @throws UnsupportedOperationException If the device does not have
* {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}.
*/
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
......@@ -11155,6 +11174,8 @@ public class CarrierConfigManager {
* <p>Depending on simState, the config may be cleared or loaded from config app. This is only
* used by SubscriptionInfoUpdater.
*
* @throws UnsupportedOperationException If the device does not have
* {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}.
* @hide
*/
@SystemApi
......@@ -11177,6 +11198,8 @@ public class CarrierConfigManager {
* Gets the package name for a default carrier service.
* @return the package name for a default carrier service; empty string if not available.
*
* @throws UnsupportedOperationException If the device does not have
* {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}.
* @hide
*/
@NonNull
......@@ -11230,6 +11253,9 @@ public class CarrierConfigManager {
* @param subId the subscription ID, normally obtained from {@link SubscriptionManager}.
*
* @see #getConfigForSubId
*
* @throws UnsupportedOperationException If the device does not have
* {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}.
*/
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
@RequiresPermission(Manifest.permission.READ_PHONE_STATE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment