From 9cd3b7b3f57058766ba7c3ac69c8337957813a87 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Tue, 2 Jan 2018 15:51:34 -0800 Subject: [PATCH] Exposed CDMA SID/NID get APIs Made two existing hidden APIs getSystemId() and getNetworkId() into public APIs. Test: Telephony sanity tests bug: 32718590 Change-Id: I436bd2699f8f805def753878d93e7dbf524e5f44 --- api/current.txt | 3 +++ .../java/android/telephony/ServiceState.java | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index e8d0ee279ba90..caf522b73de96 100644 --- a/api/current.txt +++ b/api/current.txt @@ -40465,11 +40465,13 @@ package android.telephony { method protected void copyFrom(android.telephony.ServiceState); method public int describeContents(); method public boolean getIsManualSelection(); + method public int getNetworkId(); method public java.lang.String getOperatorAlphaLong(); method public java.lang.String getOperatorAlphaShort(); method public java.lang.String getOperatorNumeric(); method public boolean getRoaming(); method public int getState(); + method public int getSystemId(); method public void setIsManualSelection(boolean); method public void setOperatorName(java.lang.String, java.lang.String, java.lang.String); method public void setRoaming(boolean); @@ -40482,6 +40484,7 @@ package android.telephony { field public static final int STATE_IN_SERVICE = 0; // 0x0 field public static final int STATE_OUT_OF_SERVICE = 1; // 0x1 field public static final int STATE_POWER_OFF = 3; // 0x3 + field public static final int UNKNOWN_ID = -1; // 0xffffffff } public class SignalStrength implements android.os.Parcelable { diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 116e711ee886c..ce2781eb570c5 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -19,7 +19,6 @@ package android.telephony; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; -import android.telephony.Rlog; import android.text.TextUtils; /** @@ -216,6 +215,11 @@ public class ServiceState implements Parcelable { */ public static final int ROAMING_TYPE_INTERNATIONAL = 3; + /** + * Unknown ID. Could be returned by {@link #getNetworkId()} or {@link #getSystemId()} + */ + public static final int UNKNOWN_ID = -1; + private int mVoiceRoamingType; private int mDataRoamingType; private String mVoiceOperatorAlphaLong; @@ -1212,12 +1216,20 @@ public class ServiceState implements Parcelable { return this.mCssIndicator ? 1 : 0; } - /** @hide */ + /** + * Get the CDMA NID (Network Identification Number), a number uniquely identifying a network + * within a wireless system. (Defined in 3GPP2 C.S0023 3.4.8) + * @return The CDMA NID or {@link #UNKNOWN_ID} if not available. + */ public int getNetworkId() { return this.mNetworkId; } - /** @hide */ + /** + * Get the CDMA SID (System Identification Number), a number uniquely identifying a wireless + * system. (Defined in 3GPP2 C.S0023 3.4.8) + * @return The CDMA SID or {@link #UNKNOWN_ID} if not available. + */ public int getSystemId() { return this.mSystemId; }