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
This commit is contained in:
Zoran Jovanovic
2016-11-02 09:56:38 +01:00
committed by Robert Greenwalt
parent 99bd27f7ee
commit 67f579be19

View File

@@ -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.
@@ -589,6 +590,24 @@ public class ServiceState implements Parcelable {
return mDataOperatorAlphaShort;
}
/**
* 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.
*