From 61524e1b6144c7ab0dc80f370e6d95bd7f6d42e7 Mon Sep 17 00:00:00 2001 From: sqian Date: Fri, 19 Oct 2018 16:47:52 -0700 Subject: [PATCH] Make SignalStrength#INVALID public Bug: 113074174 Bug: 118460482 Test: Treehugger; compile Change-Id: I088f2f46c0adfbedc0fd53838add57078d6aac56 --- api/current.txt | 1 + .../java/android/telephony/SignalStrength.java | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/api/current.txt b/api/current.txt index 443116f6ffd20..bd7c52277ea3b 100755 --- a/api/current.txt +++ b/api/current.txt @@ -42467,6 +42467,7 @@ package android.telephony { method public int getLevel(); method public boolean isGsm(); method public void writeToParcel(android.os.Parcel, int); + field public static final int INVALID = 2147483647; // 0x7fffffff } public final class SmsManager { diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java index fb801b29b945c..def5e7d87108a 100644 --- a/telephony/java/android/telephony/SignalStrength.java +++ b/telephony/java/android/telephony/SignalStrength.java @@ -65,8 +65,9 @@ public class SignalStrength implements Parcelable { }; /** - * Use Integer.MAX_VALUE because -1 is a valid value in signal strength. - * @hide + * Indicates the invalid measures of signal strength. + * + * For example, this can be returned by {@link #getEvdoDbm()} or {@link #getCdmaDbm()} */ public static final int INVALID = Integer.MAX_VALUE; @@ -173,9 +174,9 @@ public class SignalStrength implements Parcelable { public SignalStrength(boolean gsmFlag) { mGsmSignalStrength = 99; mGsmBitErrorRate = -1; - mCdmaDbm = -1; + mCdmaDbm = INVALID; mCdmaEcio = -1; - mEvdoDbm = -1; + mEvdoDbm = INVALID; mEvdoEcio = -1; mEvdoSnr = -1; mLteSignalStrength = 99; @@ -542,6 +543,8 @@ public class SignalStrength implements Parcelable { /** * Get the CDMA RSSI value in dBm + * + * @return the CDMA RSSI value or {@link #INVALID} if invalid */ public int getCdmaDbm() { return this.mCdmaDbm; @@ -556,6 +559,8 @@ public class SignalStrength implements Parcelable { /** * Get the EVDO RSSI value in dBm + * + * @return the EVDO RSSI value or {@link #INVALID} if invalid */ public int getEvdoDbm() { return this.mEvdoDbm;