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

Commit 5a12a27a authored by Sarah Chin's avatar Sarah Chin Committed by Android (Google) Code Review
Browse files

Merge "Update APIs for SliceStore"

parents edf35dd8 2a69c116
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -41727,10 +41727,12 @@ package android.telephony {
    field public static final String KEY_OPPORTUNISTIC_NETWORK_PING_PONG_TIME_LONG = "opportunistic_network_ping_pong_time_long";
    field public static final String KEY_PING_TEST_BEFORE_DATA_SWITCH_BOOL = "ping_test_before_data_switch_bool";
    field public static final String KEY_PREFER_2G_BOOL = "prefer_2g_bool";
    field public static final String KEY_PREMIUM_CAPABILITY_MAXIMUM_NOTIFICATION_COUNT_INT_ARRAY = "premium_capability_maximum_notification_count_int_array";
    field public static final String KEY_PREMIUM_CAPABILITY_NOTIFICATION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG = "premium_capability_notification_backoff_hysteresis_time_millis_long";
    field public static final String KEY_PREMIUM_CAPABILITY_NOTIFICATION_DISPLAY_TIMEOUT_MILLIS_LONG = "premium_capability_notification_display_timeout_millis_long";
    field public static final String KEY_PREMIUM_CAPABILITY_PURCHASE_CONDITION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG = "premium_capability_purchase_condition_backoff_hysteresis_time_millis_long";
    field public static final String KEY_PREMIUM_CAPABILITY_PURCHASE_URL_STRING = "premium_capability_purchase_url_string";
    field public static final String KEY_PREMIUM_CAPABILITY_SUPPORTED_ON_LTE_BOOL = "premium_capability_supported_on_lte_bool";
    field public static final String KEY_PREVENT_CLIR_ACTIVATION_AND_DEACTIVATION_CODE_BOOL = "prevent_clir_activation_and_deactivation_code_bool";
    field public static final String KEY_RADIO_RESTART_FAILURE_CAUSES_INT_ARRAY = "radio_restart_failure_causes_int_array";
    field public static final String KEY_RCS_CONFIG_SERVER_URL_STRING = "rcs_config_server_url_string";
@@ -44009,7 +44011,7 @@ package android.telephony {
    field public static final int PHONE_TYPE_GSM = 1; // 0x1
    field public static final int PHONE_TYPE_NONE = 0; // 0x0
    field public static final int PHONE_TYPE_SIP = 3; // 0x3
    field public static final int PREMIUM_CAPABILITY_REALTIME_INTERACTIVE_TRAFFIC = 1; // 0x1
    field public static final int PREMIUM_CAPABILITY_PRIORITIZE_LATENCY = 34; // 0x22
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_IN_PROGRESS = 4; // 0x4
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_PURCHASED = 3; // 0x3
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_CARRIER_DISABLED = 7; // 0x7
@@ -44017,12 +44019,13 @@ package android.telephony {
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_FEATURE_NOT_SUPPORTED = 10; // 0xa
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_NETWORK_CONGESTED = 13; // 0xd
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_NETWORK_NOT_AVAILABLE = 12; // 0xc
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_NOT_DEFAULT_DATA = 14; // 0xe
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_OVERRIDDEN = 5; // 0x5
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_REQUEST_FAILED = 11; // 0xb
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_SUCCESS = 1; // 0x1
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_THROTTLED = 2; // 0x2
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_TIMEOUT = 9; // 0x9
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_CANCELED = 6; // 0x6
    field public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_DISABLED = 5; // 0x5
    field public static final int SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION = 2; // 0x2
    field public static final int SET_OPPORTUNISTIC_SUB_NO_OPPORTUNISTIC_SUB_AVAILABLE = 3; // 0x3
    field public static final int SET_OPPORTUNISTIC_SUB_REMOTE_SERVICE_EXCEPTION = 4; // 0x4
+36 −1
Original line number Diff line number Diff line
@@ -8715,6 +8715,8 @@ public class CarrierConfigManager {
     * premium capabilities should be blocked when
     * {@link TelephonyManager#purchasePremiumCapability(int, Executor, Consumer)}
     * returns a failure due to user action or timeout.
     * The maximum number of network boost notifications to show the user are defined in
     * {@link #KEY_PREMIUM_CAPABILITY_MAXIMUM_NOTIFICATION_COUNT_INT_ARRAY}.
     *
     * The default value is 30 minutes.
     *
@@ -8725,6 +8727,22 @@ public class CarrierConfigManager {
            KEY_PREMIUM_CAPABILITY_NOTIFICATION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG =
            "premium_capability_notification_backoff_hysteresis_time_millis_long";

    /**
     * The maximum number of times that we display the notification for a network boost via premium
     * capabilities when {@link TelephonyManager#purchasePremiumCapability(int, Executor, Consumer)}
     * returns a failure due to user action or timeout.
     *
     * An int array with 2 values: {max_notifications_per_day, max_notifications_per_month}.
     *
     * The default value is {2, 10}, meaning we display a maximum of 2 network boost notifications
     * per day and 10 notifications per month.
     *
     * @see TelephonyManager#PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_CANCELED
     * @see TelephonyManager#PURCHASE_PREMIUM_CAPABILITY_RESULT_TIMEOUT
     */
    public static final String KEY_PREMIUM_CAPABILITY_MAXIMUM_NOTIFICATION_COUNT_INT_ARRAY =
            "premium_capability_maximum_notification_count_int_array";

    /**
     * The amount of time in milliseconds that the purchase request should be throttled when
     * {@link TelephonyManager#purchasePremiumCapability(int, Executor, Consumer)}
@@ -8751,6 +8769,20 @@ public class CarrierConfigManager {
    public static final String KEY_PREMIUM_CAPABILITY_PURCHASE_URL_STRING =
            "premium_capability_purchase_url_string";

    /**
     * Whether to allow premium capabilities to be purchased when the device is connected to LTE.
     * If this is {@code true}, applications can call
     * {@link TelephonyManager#purchasePremiumCapability(int, Executor, Consumer)}
     * when connected to {@link TelephonyManager#NETWORK_TYPE_LTE} to purchase and use
     * premium capabilities.
     * If this is {@code false}, applications can only purchase and use premium capabilities when
     * conencted to {@link TelephonyManager#NETWORK_TYPE_NR}.
     *
     * This is {@code false} by default.
     */
    public static final String KEY_PREMIUM_CAPABILITY_SUPPORTED_ON_LTE_BOOL =
            "premium_capability_supported_on_lte_bool";

    /**
     * IWLAN handover rules that determine whether handover is allowed or disallowed between
     * cellular and IWLAN.
@@ -9437,10 +9469,13 @@ public class CarrierConfigManager {
                TimeUnit.MINUTES.toMillis(30));
        sDefaults.putLong(KEY_PREMIUM_CAPABILITY_NOTIFICATION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG,
                TimeUnit.MINUTES.toMillis(30));
        sDefaults.putIntArray(KEY_PREMIUM_CAPABILITY_MAXIMUM_NOTIFICATION_COUNT_INT_ARRAY,
                new int[] {2, 10});
        sDefaults.putLong(
                KEY_PREMIUM_CAPABILITY_PURCHASE_CONDITION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG,
                TimeUnit.MINUTES.toMillis(30));
        sDefaults.putString(KEY_PREMIUM_CAPABILITY_PURCHASE_URL_STRING, null);
        sDefaults.putBoolean(KEY_PREMIUM_CAPABILITY_SUPPORTED_ON_LTE_BOOL, false);
        sDefaults.putStringArray(KEY_IWLAN_HANDOVER_POLICY_STRING_ARRAY, new String[]{
                "source=GERAN|UTRAN|EUTRAN|NGRAN|IWLAN, "
                        + "target=GERAN|UTRAN|EUTRAN|NGRAN|IWLAN, type=allowed"});
+44 −19
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkCapabilities;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Binder;
@@ -17115,11 +17116,12 @@ public class TelephonyManager {
    }
    /**
     * A premium capability boosting the network to allow real-time interactive traffic.
     * Corresponds to NetworkCapabilities#NET_CAPABILITY_REALTIME_INTERACTIVE_TRAFFIC.
     * A premium capability that boosts the network to allow for real-time interactive traffic
     * by prioritizing low latency communication.
     * Corresponds to {@link NetworkCapabilities#NET_CAPABILITY_PRIORITIZE_LATENCY}.
     */
    // TODO(b/245748544): add @link once NET_CAPABILITY_REALTIME_INTERACTIVE_TRAFFIC is defined.
    public static final int PREMIUM_CAPABILITY_REALTIME_INTERACTIVE_TRAFFIC = 1;
    public static final int PREMIUM_CAPABILITY_PRIORITIZE_LATENCY =
            NetworkCapabilities.NET_CAPABILITY_PRIORITIZE_LATENCY;
    /**
     * Purchasable premium capabilities.
@@ -17127,7 +17129,7 @@ public class TelephonyManager {
     */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(prefix = { "PREMIUM_CAPABILITY_" }, value = {
            PREMIUM_CAPABILITY_REALTIME_INTERACTIVE_TRAFFIC})
            PREMIUM_CAPABILITY_PRIORITIZE_LATENCY})
    public @interface PremiumCapability {}
    /**
@@ -17139,8 +17141,8 @@ public class TelephonyManager {
     */
    public static String convertPremiumCapabilityToString(@PremiumCapability int capability) {
        switch (capability) {
            case PREMIUM_CAPABILITY_REALTIME_INTERACTIVE_TRAFFIC:
                return "REALTIME_INTERACTIVE_TRAFFIC";
            case PREMIUM_CAPABILITY_PRIORITIZE_LATENCY:
                return "PRIORITIZE_LATENCY";
            default:
                return "UNKNOWN (" + capability + ")";
        }
@@ -17178,11 +17180,18 @@ public class TelephonyManager {
    public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_SUCCESS = 1;
    /**
     * Purchase premium capability failed because the request is throttled for the amount of time
     * Purchase premium capability failed because the request is throttled.
     * If purchasing premium capabilities is throttled, it will be for the amount of time
     * specified by {@link CarrierConfigManager
     * #KEY_PREMIUM_CAPABILITY_NOTIFICATION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG}
     * or {@link CarrierConfigManager
     * #KEY_PREMIUM_CAPABILITY_PURCHASE_CONDITION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG}.
     * If displaying the network boost notification is throttled, it will be for the amount of time
     * specified by {@link CarrierConfigManager
     * #KEY_PREMIUM_CAPABILITY_NOTIFICATION_BACKOFF_HYSTERESIS_TIME_INT_ARRAY}.
     * If a foreground application requests premium capabilities, the network boost notification
     * will be displayed to the user regardless of the throttled status.
     * We will show the network boost notification to the user up to the daily and monthly maximum
     * number of times specified by {@link CarrierConfigManager
     * #KEY_PREMIUM_CAPABILITY_MAXIMUM_NOTIFICATION_COUNT_INT_ARRAY}.
     * Subsequent attempts will return the same error until the request is no longer throttled
     * or throttling conditions change.
     */
@@ -17202,10 +17211,14 @@ public class TelephonyManager {
    public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_IN_PROGRESS = 4;
    /**
     * Purchase premium capability failed because the user disabled the feature.
     * Subsequent attempts will return the same error until the user re-enables the feature.
     * Purchase premium capability failed because a foreground application requested the same
     * capability. The notification for the current application will be dismissed and a new
     * notification will be displayed to the user for the foreground application.
     * Subsequent attempts will return
     * {@link #PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_IN_PROGRESS} until the foreground
     * application's request is completed.
     */
    public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_DISABLED = 5;
    public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_OVERRIDDEN = 5;
    /**
     * Purchase premium capability failed because the user canceled the operation.
@@ -17252,7 +17265,8 @@ public class TelephonyManager {
    public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_FEATURE_NOT_SUPPORTED = 10;
    /**
     * Purchase premium capability failed because the telephony service is down or unavailable.
     * Purchase premium capability failed because the telephony service is unavailable
     * or there was an error in the phone process.
     * Subsequent attempts will return the same error until request conditions are satisfied.
     */
    public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_REQUEST_FAILED = 11;
@@ -17273,6 +17287,14 @@ public class TelephonyManager {
     */
    public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_NETWORK_CONGESTED = 13;
    /**
     * Purchase premium capability failed because the request was not made on the default data
     * subscription, indicated by {@link SubscriptionManager#getDefaultDataSubscriptionId()}.
     * Subsequent attempts will return the same error until the request is made on the default
     * data subscription.
     */
    public static final int PURCHASE_PREMIUM_CAPABILITY_RESULT_NOT_DEFAULT_DATA = 14;
    /**
     * Results of the purchase premium capability request.
     * @hide
@@ -17283,14 +17305,15 @@ public class TelephonyManager {
            PURCHASE_PREMIUM_CAPABILITY_RESULT_THROTTLED,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_PURCHASED,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_IN_PROGRESS,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_DISABLED,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_OVERRIDDEN,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_CANCELED,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_CARRIER_DISABLED,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_CARRIER_ERROR,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_TIMEOUT,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_FEATURE_NOT_SUPPORTED,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_NETWORK_NOT_AVAILABLE,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_NETWORK_CONGESTED})
            PURCHASE_PREMIUM_CAPABILITY_RESULT_NETWORK_CONGESTED,
            PURCHASE_PREMIUM_CAPABILITY_RESULT_NOT_DEFAULT_DATA})
    public @interface PurchasePremiumCapabilityResult {}
    /**
@@ -17311,8 +17334,8 @@ public class TelephonyManager {
                return "ALREADY_PURCHASED";
            case PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_IN_PROGRESS:
                return "ALREADY_IN_PROGRESS";
            case PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_DISABLED:
                return "USER_DISABLED";
            case PURCHASE_PREMIUM_CAPABILITY_RESULT_OVERRIDDEN:
                return "OVERRIDDEN";
            case PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_CANCELED:
                return "USER_CANCELED";
            case PURCHASE_PREMIUM_CAPABILITY_RESULT_CARRIER_DISABLED:
@@ -17329,6 +17352,8 @@ public class TelephonyManager {
                return "NETWORK_NOT_AVAILABLE";
            case PURCHASE_PREMIUM_CAPABILITY_RESULT_NETWORK_CONGESTED:
                return "NETWORK_CONGESTED";
            case PURCHASE_PREMIUM_CAPABILITY_RESULT_NOT_DEFAULT_DATA:
                return "NOT_DEFAULT_DATA";
            default:
                return "UNKNOWN (" + result + ")";
        }
@@ -17346,7 +17371,7 @@ public class TelephonyManager {
     * @param callback The result of the purchase request.
     *                 One of {@link PurchasePremiumCapabilityResult}.
     * @throws SecurityException if the caller does not hold permission READ_BASIC_PHONE_STATE.
     * @see #isPremiumCapabilityAvailableForPurchase(int) to check whether the capability is valid
     * @see #isPremiumCapabilityAvailableForPurchase(int) to check whether the capability is valid.
     */
    @RequiresPermission(android.Manifest.permission.READ_BASIC_PHONE_STATE)
    public void purchasePremiumCapability(@PremiumCapability int capability,