From d285c8eb20e9868a90aaeb8a9137e02fdffb979b Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Mon, 22 Oct 2018 15:07:06 -0700 Subject: Add getMobileNetworkOperator to CellIdentityTdscdma For consistency with CellIdentityLte, Wcdma, and Gsm adding this function. It will aid in future refactors to possibly create a common interface for these classes. Bug: 111808089 Test: compilation Change-Id: Ia6b21bcc368089d8346951ae9476e7eb12a05130 --- api/current.txt | 1 + telephony/java/android/telephony/CellIdentityTdscdma.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/api/current.txt b/api/current.txt index 443116f6ffd2..ffb613080b25 100755 --- a/api/current.txt +++ b/api/current.txt @@ -42078,6 +42078,7 @@ package android.telephony { method public int getLac(); method public java.lang.String getMccString(); method public java.lang.String getMncString(); + method public java.lang.String getMobileNetworkOperator(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } diff --git a/telephony/java/android/telephony/CellIdentityTdscdma.java b/telephony/java/android/telephony/CellIdentityTdscdma.java index 5a9e474806a3..bc83de190347 100644 --- a/telephony/java/android/telephony/CellIdentityTdscdma.java +++ b/telephony/java/android/telephony/CellIdentityTdscdma.java @@ -108,6 +108,13 @@ public final class CellIdentityTdscdma extends CellIdentity { return mMncStr; } + /** + * @return a 5 or 6 character string (MCC+MNC), null if any field is unknown + */ + public String getMobileNetworkOperator() { + return (mMccStr == null || mMncStr == null) ? null : mMccStr + mMncStr; + } + /** * @return 16-bit Location Area Code, 0..65535, INT_MAX if unknown */ -- cgit v1.2.3-59-g8ed1b