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

Commit 36182212 authored by Hui Wang's avatar Hui Wang Committed by Android (Google) Code Review
Browse files

Merge "Update annotation, constant name, and javadoc of cell broadcast API"

parents e768daa3 1ebbd4cb
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -13232,10 +13232,10 @@ package android.telephony {
  }
  public final class CellBroadcastIdRange implements android.os.Parcelable {
    ctor public CellBroadcastIdRange(int, int, int, boolean) throws java.lang.IllegalArgumentException;
    ctor public CellBroadcastIdRange(@IntRange(from=0, to=65535) int, @IntRange(from=0, to=65535) int, int, boolean) throws java.lang.IllegalArgumentException;
    method public int describeContents();
    method public int getEndId();
    method public int getStartId();
    method @IntRange(from=0, to=65535) public int getEndId();
    method @IntRange(from=0, to=65535) public int getStartId();
    method public int getType();
    method public boolean isEnabled();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
@@ -14177,11 +14177,11 @@ package android.telephony {
    field public static final int CDMA_SUBSCRIPTION_NV = 1; // 0x1
    field public static final int CDMA_SUBSCRIPTION_RUIM_SIM = 0; // 0x0
    field public static final int CDMA_SUBSCRIPTION_UNKNOWN = -1; // 0xffffffff
    field public static final int CELLBROADCAST_RESULT_FAIL_ACTIVATION = 3; // 0x3
    field public static final int CELLBROADCAST_RESULT_FAIL_CONFIG = 2; // 0x2
    field public static final int CELLBROADCAST_RESULT_SUCCESS = 0; // 0x0
    field public static final int CELLBROADCAST_RESULT_UNKNOWN = -1; // 0xffffffff
    field public static final int CELLBROADCAST_RESULT_UNSUPPORTED = 1; // 0x1
    field public static final int CELL_BROADCAST_RESULT_FAIL_ACTIVATION = 3; // 0x3
    field public static final int CELL_BROADCAST_RESULT_FAIL_CONFIG = 2; // 0x2
    field public static final int CELL_BROADCAST_RESULT_SUCCESS = 0; // 0x0
    field public static final int CELL_BROADCAST_RESULT_UNKNOWN = -1; // 0xffffffff
    field public static final int CELL_BROADCAST_RESULT_UNSUPPORTED = 1; // 0x1
    field public static final int ENABLE_NR_DUAL_CONNECTIVITY_INVALID_STATE = 4; // 0x4
    field public static final int ENABLE_NR_DUAL_CONNECTIVITY_NOT_SUPPORTED = 1; // 0x1
    field public static final int ENABLE_NR_DUAL_CONNECTIVITY_RADIO_ERROR = 3; // 0x3
+10 −4
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package android.telephony;

import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.Parcel;
@@ -29,7 +30,9 @@ import java.util.Objects;
@SystemApi
public final class CellBroadcastIdRange implements Parcelable {

    @IntRange(from = 0, to = 0xFFFF)
    private int mStartId;
    @IntRange(from = 0, to = 0xFFFF)
    private int mEndId;
    private int mType;
    private boolean mIsEnabled;
@@ -38,18 +41,19 @@ public final class CellBroadcastIdRange implements Parcelable {
     * Create a new CellBroacastRange
     *
     * @param startId first message identifier as specified in TS 23.041 (3GPP)
     * or C.R1001-G (3GPP2)
     * or C.R1001-G (3GPP2). The value must be between 0 and 0xFFFF.
     * @param endId last message identifier as specified in TS 23.041 (3GPP)
     * or C.R1001-G (3GPP2)
     * or C.R1001-G (3GPP2). The value must be between 0 and 0xFFFF.
     * @param type the message format as defined in {@link SmsCbMessage}
     * @param isEnabled whether the range is enabled
     *
     * @throws IllegalArgumentException if endId < startId or invalid value
     */
    public CellBroadcastIdRange(int startId, int endId,
    public CellBroadcastIdRange(@IntRange(from = 0, to = 0xFFFF) int startId,
            @IntRange(from = 0, to = 0xFFFF) int endId,
            @android.telephony.SmsCbMessage.MessageFormat int type, boolean isEnabled)
            throws IllegalArgumentException {
        if (startId < 0 || endId < 0) {
        if (startId < 0 || endId < 0 || startId > 0xFFFF || endId > 0xFFFF) {
            throw new IllegalArgumentException("invalid id");
        }
        if (endId < startId) {
@@ -65,6 +69,7 @@ public final class CellBroadcastIdRange implements Parcelable {
     * Return the first message identifier of this range as specified in TS 23.041 (3GPP)
     * or C.R1001-G (3GPP2)
     */
    @IntRange(from = 0, to = 0xFFFF)
    public int getStartId() {
        return mStartId;
    }
@@ -73,6 +78,7 @@ public final class CellBroadcastIdRange implements Parcelable {
     * Return the last message identifier of this range as specified in TS 23.041 (3GPP)
     * or C.R1001-G (3GPP2)
     */
    @IntRange(from = 0, to = 0xFFFF)
    public int getEndId() {
        return mEndId;
    }
+3 −3
Original line number Diff line number Diff line
@@ -2014,7 +2014,7 @@ public final class SmsManager {
     * @see #disableCellBroadcastRange(int, int, int)
     *
     * @throws IllegalArgumentException if endMessageId < startMessageId
     * @deprecated Use {@link TelephonyManager#setCellBroadcastRanges} instead.
     * @deprecated Use {@link TelephonyManager#setCellBroadcastIdRanges} instead.
     * {@hide}
     */
    @Deprecated
@@ -2076,7 +2076,7 @@ public final class SmsManager {
     * @see #enableCellBroadcastRange(int, int, int)
     *
     * @throws IllegalArgumentException if endMessageId < startMessageId
     * @deprecated Use {@link TelephonyManager#setCellBroadcastRanges} instead.
     * @deprecated Use {@link TelephonyManager#setCellBroadcastIdRanges} instead.
     * {@hide}
     */
    @Deprecated
@@ -3486,7 +3486,7 @@ public final class SmsManager {

    /**
     * Reset all cell broadcast ranges. Previously enabled ranges will become invalid after this.
     * @deprecated Use {@link TelephonyManager#resetAllCellBroadcastRanges} instead
     * @deprecated Use {@link TelephonyManager#setCellBroadcastIdRanges} with empty list instead
     * @hide
     */
    @Deprecated
+11 −11
Original line number Diff line number Diff line
@@ -17851,12 +17851,12 @@ public class TelephonyManager {
    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(prefix = {"CELLBROADCAST_RESULT_"}, value = {
            CELLBROADCAST_RESULT_UNKNOWN,
            CELLBROADCAST_RESULT_SUCCESS,
            CELLBROADCAST_RESULT_UNSUPPORTED,
            CELLBROADCAST_RESULT_FAIL_CONFIG,
            CELLBROADCAST_RESULT_FAIL_ACTIVATION})
    @IntDef(prefix = {"CELL_BROADCAST_RESULT_"}, value = {
            CELL_BROADCAST_RESULT_UNKNOWN,
            CELL_BROADCAST_RESULT_SUCCESS,
            CELL_BROADCAST_RESULT_UNSUPPORTED,
            CELL_BROADCAST_RESULT_FAIL_CONFIG,
            CELL_BROADCAST_RESULT_FAIL_ACTIVATION})
    public @interface CellBroadcastResult {}
    /**
@@ -17864,35 +17864,35 @@ public class TelephonyManager {
     * @hide
     */
    @SystemApi
    public static final int CELLBROADCAST_RESULT_UNKNOWN = -1;
    public static final int CELL_BROADCAST_RESULT_UNKNOWN = -1;
    /**
     * The cell broadcast request is successful.
     * @hide
     */
    @SystemApi
    public static final int CELLBROADCAST_RESULT_SUCCESS = 0;
    public static final int CELL_BROADCAST_RESULT_SUCCESS = 0;
    /**
     * The cell broadcast request is not supported.
     * @hide
     */
    @SystemApi
    public static final int CELLBROADCAST_RESULT_UNSUPPORTED = 1;
    public static final int CELL_BROADCAST_RESULT_UNSUPPORTED = 1;
    /**
     * The cell broadcast request is failed due to the error to set config
     * @hide
     */
    @SystemApi
    public static final int CELLBROADCAST_RESULT_FAIL_CONFIG = 2;
    public static final int CELL_BROADCAST_RESULT_FAIL_CONFIG = 2;
    /**
     * The cell broadcast request is failed due to the error to set activation
     * @hide
     */
    @SystemApi
    public static final int CELLBROADCAST_RESULT_FAIL_ACTIVATION = 3;
    public static final int CELL_BROADCAST_RESULT_FAIL_ACTIVATION = 3;
    /**
     * Set reception of cell broadcast messages with the list of the given ranges