summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/api/system-current.txt16
-rw-r--r--telephony/java/android/telephony/CellBroadcastIdRange.java14
-rw-r--r--telephony/java/android/telephony/SmsManager.java6
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java22
4 files changed, 32 insertions, 26 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 5f4c19beb3b5..9d70426aa0c9 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -13197,10 +13197,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);
@@ -14142,11 +14142,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
diff --git a/telephony/java/android/telephony/CellBroadcastIdRange.java b/telephony/java/android/telephony/CellBroadcastIdRange.java
index eaf4f1c4bf41..abee80f76f83 100644
--- a/telephony/java/android/telephony/CellBroadcastIdRange.java
+++ b/telephony/java/android/telephony/CellBroadcastIdRange.java
@@ -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;
}
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java
index e6f134921cd9..a2a110d3f758 100644
--- a/telephony/java/android/telephony/SmsManager.java
+++ b/telephony/java/android/telephony/SmsManager.java
@@ -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
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 059f4c355437..0ad5ba0eaa47 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -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