diff options
| author | 2016-11-02 09:56:38 +0100 | |
|---|---|---|
| committer | 2016-12-01 10:36:21 -0800 | |
| commit | 67f579be19e548932137480ae0311b6d627b27e4 (patch) | |
| tree | d6b7c4e8c732c611880f05ba0f713dbbd3e973e9 | |
| parent | 99bd27f7ee9613f2e26c4fe02d98bc07922db42e (diff) | |
Get the correct operator name
If the long operator name is not given by RIL,
try to get the short operator name.
Bug: 32791744
Test: ServiceStateTrackerTest.java exteneded in partner cl
Depends-On: commit in frameworks/opt/telephony with the same Change-Id
Change-Id: I4983ad708c57a650ce4a806e1f53837825bad2db
| -rw-r--r-- | telephony/java/android/telephony/ServiceState.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 11d84c1d66bc..7a83979ef61a 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -20,6 +20,7 @@ import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.telephony.Rlog; +import android.text.TextUtils; /** * Contains phone state and service related information. @@ -590,6 +591,24 @@ public class ServiceState implements Parcelable { } /** + * Get current registered operator name in long alphanumeric format if + * available or short otherwise. + * + * @see #getOperatorAlphaLong + * @see #getOperatorAlphaShort + * + * @return name of operator, null if unregistered or unknown + * @hide + */ + public String getOperatorAlpha() { + if (TextUtils.isEmpty(mVoiceOperatorAlphaLong)) { + return mVoiceOperatorAlphaShort; + } + + return mVoiceOperatorAlphaLong; + } + + /** * Get current registered operator numeric id. * * In GSM/UMTS, numeric format is 3 digit country code plus 2 or 3 digit |