Merge "Expose SignalThresholdInfo as public class"

This commit is contained in:
Rambo Wang
2021-01-16 01:53:15 +00:00
committed by Gerrit Code Review
2 changed files with 52 additions and 19 deletions

View File

@@ -40796,6 +40796,32 @@ package android.telephony {
field public static final int INVALID = 2147483647; // 0x7fffffff field public static final int INVALID = 2147483647; // 0x7fffffff
} }
public final class SignalThresholdInfo implements android.os.Parcelable {
method public int describeContents();
method public int getRadioAccessNetworkType();
method public int getSignalMeasurementType();
method @NonNull public int[] getThresholds();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SignalThresholdInfo> CREATOR;
field public static final int SIGNAL_MEASUREMENT_TYPE_RSCP = 2; // 0x2
field public static final int SIGNAL_MEASUREMENT_TYPE_RSRP = 3; // 0x3
field public static final int SIGNAL_MEASUREMENT_TYPE_RSRQ = 4; // 0x4
field public static final int SIGNAL_MEASUREMENT_TYPE_RSSI = 1; // 0x1
field public static final int SIGNAL_MEASUREMENT_TYPE_RSSNR = 5; // 0x5
field public static final int SIGNAL_MEASUREMENT_TYPE_SSRSRP = 6; // 0x6
field public static final int SIGNAL_MEASUREMENT_TYPE_SSRSRQ = 7; // 0x7
field public static final int SIGNAL_MEASUREMENT_TYPE_SSSINR = 8; // 0x8
field public static final int SIGNAL_MEASUREMENT_TYPE_UNKNOWN = 0; // 0x0
}
public static final class SignalThresholdInfo.Builder {
ctor public SignalThresholdInfo.Builder();
method @NonNull public android.telephony.SignalThresholdInfo build();
method @NonNull public android.telephony.SignalThresholdInfo.Builder setRadioAccessNetworkType(int);
method @NonNull public android.telephony.SignalThresholdInfo.Builder setSignalMeasurementType(int);
method @NonNull public android.telephony.SignalThresholdInfo.Builder setThresholds(@NonNull int[]);
}
public final class SmsManager { public final class SmsManager {
method public String createAppSpecificSmsToken(android.app.PendingIntent); method public String createAppSpecificSmsToken(android.app.PendingIntent);
method @Nullable public String createAppSpecificSmsTokenWithPackageInfo(@Nullable String, @NonNull android.app.PendingIntent); method @Nullable public String createAppSpecificSmsTokenWithPackageInfo(@Nullable String, @NonNull android.app.PendingIntent);

View File

@@ -28,13 +28,11 @@ import java.util.Objects;
/** /**
* Defines the threshold value of the signal strength. * Defines the threshold value of the signal strength.
* @hide
*/ */
public final class SignalThresholdInfo implements Parcelable { public final class SignalThresholdInfo implements Parcelable {
/** /**
* Unknown signal measurement type. * Unknown signal measurement type.
* @hide
*/ */
public static final int SIGNAL_MEASUREMENT_TYPE_UNKNOWN = 0; public static final int SIGNAL_MEASUREMENT_TYPE_UNKNOWN = 0;
@@ -44,7 +42,6 @@ public final class SignalThresholdInfo implements Parcelable {
* Used RAN: {@link AccessNetworkConstants.AccessNetworkType#GERAN}, * Used RAN: {@link AccessNetworkConstants.AccessNetworkType#GERAN},
* {@link AccessNetworkConstants.AccessNetworkType#CDMA2000} * {@link AccessNetworkConstants.AccessNetworkType#CDMA2000}
* Reference: 3GPP TS 27.007 section 8.5. * Reference: 3GPP TS 27.007 section 8.5.
* @hide
*/ */
public static final int SIGNAL_MEASUREMENT_TYPE_RSSI = 1; public static final int SIGNAL_MEASUREMENT_TYPE_RSSI = 1;
@@ -53,7 +50,6 @@ public final class SignalThresholdInfo implements Parcelable {
* Range: -120 dBm to -25 dBm; * Range: -120 dBm to -25 dBm;
* Used RAN: {@link AccessNetworkConstants.AccessNetworkType#UTRAN} * Used RAN: {@link AccessNetworkConstants.AccessNetworkType#UTRAN}
* Reference: 3GPP TS 25.123, section 9.1.1.1 * Reference: 3GPP TS 25.123, section 9.1.1.1
* @hide
*/ */
public static final int SIGNAL_MEASUREMENT_TYPE_RSCP = 2; public static final int SIGNAL_MEASUREMENT_TYPE_RSCP = 2;
@@ -62,7 +58,6 @@ public final class SignalThresholdInfo implements Parcelable {
* Range: -140 dBm to -44 dBm; * Range: -140 dBm to -44 dBm;
* Used RAN: {@link AccessNetworkConstants.AccessNetworkType#EUTRAN} * Used RAN: {@link AccessNetworkConstants.AccessNetworkType#EUTRAN}
* Reference: 3GPP TS 36.133 9.1.4 * Reference: 3GPP TS 36.133 9.1.4
* @hide
*/ */
public static final int SIGNAL_MEASUREMENT_TYPE_RSRP = 3; public static final int SIGNAL_MEASUREMENT_TYPE_RSRP = 3;
@@ -71,7 +66,6 @@ public final class SignalThresholdInfo implements Parcelable {
* Range: -34 dB to 3 dB; * Range: -34 dB to 3 dB;
* Used RAN: {@link AccessNetworkConstants.AccessNetworkType#EUTRAN} * Used RAN: {@link AccessNetworkConstants.AccessNetworkType#EUTRAN}
* Reference: 3GPP TS 36.133 9.1.7 * Reference: 3GPP TS 36.133 9.1.7
* @hide
*/ */
public static final int SIGNAL_MEASUREMENT_TYPE_RSRQ = 4; public static final int SIGNAL_MEASUREMENT_TYPE_RSRQ = 4;
@@ -79,7 +73,6 @@ public final class SignalThresholdInfo implements Parcelable {
* Reference Signal Signal to Noise Ratio * Reference Signal Signal to Noise Ratio
* Range: -20 dB to 30 dB; * Range: -20 dB to 30 dB;
* Used RAN: {@link AccessNetworkConstants.AccessNetworkType#EUTRAN} * Used RAN: {@link AccessNetworkConstants.AccessNetworkType#EUTRAN}
* @hide
*/ */
public static final int SIGNAL_MEASUREMENT_TYPE_RSSNR = 5; public static final int SIGNAL_MEASUREMENT_TYPE_RSSNR = 5;
@@ -88,7 +81,6 @@ public final class SignalThresholdInfo implements Parcelable {
* Range: -140 dBm to -44 dBm. * Range: -140 dBm to -44 dBm.
* Used RAN: {@link AccessNetworkConstants.AccessNetworkType#NGRAN} * Used RAN: {@link AccessNetworkConstants.AccessNetworkType#NGRAN}
* Reference: 3GPP TS 38.215. * Reference: 3GPP TS 38.215.
* @hide
*/ */
public static final int SIGNAL_MEASUREMENT_TYPE_SSRSRP = 6; public static final int SIGNAL_MEASUREMENT_TYPE_SSRSRP = 6;
@@ -97,7 +89,6 @@ public final class SignalThresholdInfo implements Parcelable {
* Range: -43 dB to 20 dB. * Range: -43 dB to 20 dB.
* Used RAN: {@link AccessNetworkConstants.AccessNetworkType#NGRAN} * Used RAN: {@link AccessNetworkConstants.AccessNetworkType#NGRAN}
* Reference: 3GPP TS 38.133 section 10.1.11.1. * Reference: 3GPP TS 38.133 section 10.1.11.1.
* @hide
*/ */
public static final int SIGNAL_MEASUREMENT_TYPE_SSRSRQ = 7; public static final int SIGNAL_MEASUREMENT_TYPE_SSRSRQ = 7;
@@ -106,7 +97,6 @@ public final class SignalThresholdInfo implements Parcelable {
* Range: -23 dB to 40 dB * Range: -23 dB to 40 dB
* Used RAN: {@link AccessNetworkConstants.AccessNetworkType#NGRAN} * Used RAN: {@link AccessNetworkConstants.AccessNetworkType#NGRAN}
* Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1.
* @hide
*/ */
public static final int SIGNAL_MEASUREMENT_TYPE_SSSINR = 8; public static final int SIGNAL_MEASUREMENT_TYPE_SSSINR = 8;
@@ -316,8 +306,6 @@ public final class SignalThresholdInfo implements Parcelable {
/** /**
* Builder class to create {@link SignalThresholdInfo} objects. * Builder class to create {@link SignalThresholdInfo} objects.
*
* @hide
*/ */
public static final class Builder { public static final class Builder {
private int mRan = AccessNetworkConstants.AccessNetworkType.UNKNOWN; private int mRan = AccessNetworkConstants.AccessNetworkType.UNKNOWN;
@@ -378,12 +366,22 @@ public final class SignalThresholdInfo implements Parcelable {
} }
/** /**
* Set the signal threshold values of the corresponding signal measurement type. * Set the signal strength thresholds of the corresponding signal measurement type.
* *
* The range and unit must reference specific SignalMeasurementType. * The range and unit must reference specific SignalMeasurementType.
* *
* @param thresholds array of integer as the signal threshold values * @param thresholds array of integer as the signal threshold values
* @return the builder to facilitate the chaining * @return the builder to facilitate the chaining
*
* @see #SIGNAL_MEASUREMENT_TYPE_RSSI
* @see #SIGNAL_MEASUREMENT_TYPE_RSCP
* @see #SIGNAL_MEASUREMENT_TYPE_RSRP
* @see #SIGNAL_MEASUREMENT_TYPE_RSRQ
* @see #SIGNAL_MEASUREMENT_TYPE_RSSNR
* @see #SIGNAL_MEASUREMENT_TYPE_SSRSRP
* @see #SIGNAL_MEASUREMENT_TYPE_SSRSRQ
* @see #SIGNAL_MEASUREMENT_TYPE_SSSINR
* @see #getThresholds() for more details on signal strength thresholds
*/ */
public @NonNull Builder setThresholds(@NonNull int[] thresholds) { public @NonNull Builder setThresholds(@NonNull int[] thresholds) {
Objects.requireNonNull(thresholds, "thresholds must not be null"); Objects.requireNonNull(thresholds, "thresholds must not be null");
@@ -423,8 +421,6 @@ public final class SignalThresholdInfo implements Parcelable {
* Get the radio access network type. * Get the radio access network type.
* *
* @return radio access network type * @return radio access network type
*
* @hide
*/ */
public @AccessNetworkConstants.RadioAccessNetworkType int getRadioAccessNetworkType() { public @AccessNetworkConstants.RadioAccessNetworkType int getRadioAccessNetworkType() {
return mRan; return mRan;
@@ -434,8 +430,6 @@ public final class SignalThresholdInfo implements Parcelable {
* Get the signal measurement type. * Get the signal measurement type.
* *
* @return the SignalMeasurementType value * @return the SignalMeasurementType value
*
* @hide
*/ */
public @SignalMeasurementType int getSignalMeasurementType() { public @SignalMeasurementType int getSignalMeasurementType() {
return mSignalMeasurementType; return mSignalMeasurementType;
@@ -457,11 +451,24 @@ public final class SignalThresholdInfo implements Parcelable {
} }
/** /**
* Get the signal threshold values. * Get the signal strength thresholds.
*
* Signal strength thresholds are a list of integer used for suggesting signal level and signal
* reporting criteria. The range and unit must reference specific SignalMeasurementType.
*
* Please refer to https://source.android.com/devices/tech/connect/signal-strength on how signal
* strength thresholds are used for signal strength reporting.
* *
* @return array of integer of the signal thresholds * @return array of integer of the signal thresholds
* *
* @hide * @see #SIGNAL_MEASUREMENT_TYPE_RSSI
* @see #SIGNAL_MEASUREMENT_TYPE_RSCP
* @see #SIGNAL_MEASUREMENT_TYPE_RSRP
* @see #SIGNAL_MEASUREMENT_TYPE_RSRQ
* @see #SIGNAL_MEASUREMENT_TYPE_RSSNR
* @see #SIGNAL_MEASUREMENT_TYPE_SSRSRP
* @see #SIGNAL_MEASUREMENT_TYPE_SSRSRQ
* @see #SIGNAL_MEASUREMENT_TYPE_SSSINR
*/ */
public @NonNull int[] getThresholds() { public @NonNull int[] getThresholds() {
return mThresholds.clone(); return mThresholds.clone();