mainline:Replace serviceState.getDataRegState and getVoiceRegState
Replace serviceState.getVoiceRegState with getState
Replace serviceState.getDataRegState with getDataRegistrationState
Bug: 146637978
Test: atest ServiceStateTest (PASS)
atest PhoneStateListenerTest (PASS)
atest PhoneStateListenerExecutorTest (PASS)
atest GsmCdmaPhoneTest (PASS)
Change-Id: I9a064c250acbe57fb198ea4641837d99adb1931a
diff --git a/src/java/com/android/internal/telephony/CarrierServiceStateTracker.java b/src/java/com/android/internal/telephony/CarrierServiceStateTracker.java
index a61cc37..de3cdcb 100644
--- a/src/java/com/android/internal/telephony/CarrierServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/CarrierServiceStateTracker.java
@@ -166,8 +166,8 @@
if (mSST.mSS == null) {
return true; //something has gone wrong, return true and not show the notification.
}
- return (mSST.mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE
- || mSST.mSS.getDataRegState() == ServiceState.STATE_IN_SERVICE);
+ return (mSST.mSS.getState() == ServiceState.STATE_IN_SERVICE
+ || mSST.mSS.getDataRegistrationState() == ServiceState.STATE_IN_SERVICE);
}
private boolean isPhoneRegisteredForWifiCalling() {
diff --git a/src/java/com/android/internal/telephony/GsmCdmaPhone.java b/src/java/com/android/internal/telephony/GsmCdmaPhone.java
index 18d5a9c..77a614c 100644
--- a/src/java/com/android/internal/telephony/GsmCdmaPhone.java
+++ b/src/java/com/android/internal/telephony/GsmCdmaPhone.java
@@ -1003,11 +1003,11 @@
*/
private ServiceState mergeServiceStates(ServiceState baseSs, ServiceState imsSs) {
// No need to merge states if the baseSs is IN_SERVICE.
- if (baseSs.getVoiceRegState() == ServiceState.STATE_IN_SERVICE) {
+ if (baseSs.getState() == ServiceState.STATE_IN_SERVICE) {
return baseSs;
}
// "IN_SERVICE" in this case means IMS is registered.
- if (imsSs.getVoiceRegState() != ServiceState.STATE_IN_SERVICE) {
+ if (imsSs.getState() != ServiceState.STATE_IN_SERVICE) {
return baseSs;
}
@@ -1015,7 +1015,7 @@
// Voice override for IMS case. In this case, voice registration is OUT_OF_SERVICE, but
// IMS is available, so use data registration state as a basis for determining
// whether or not the physical link is available.
- newSs.setVoiceRegState(baseSs.getDataRegState());
+ newSs.setVoiceRegState(baseSs.getDataRegistrationState());
newSs.setEmergencyOnly(false); // only get here if voice is IN_SERVICE
return newSs;
}
@@ -1302,7 +1302,8 @@
}
if (mSST != null && mSST.mSS.getState() == ServiceState.STATE_OUT_OF_SERVICE
- && mSST.mSS.getDataRegState() != ServiceState.STATE_IN_SERVICE && !isEmergency) {
+ && mSST.mSS.getDataRegistrationState() != ServiceState.STATE_IN_SERVICE
+ && !isEmergency) {
throw new CallStateException("cannot dial in current state");
}
// Check non-emergency voice CS call - shouldn't dial when POWER_OFF
@@ -1318,7 +1319,7 @@
// Allow dial only if either CS is camped on any RAT (or) PS is in LTE service.
if (mSST != null
&& mSST.mSS.getState() == ServiceState.STATE_OUT_OF_SERVICE /* CS out of service */
- && !(mSST.mSS.getDataRegState() == ServiceState.STATE_IN_SERVICE
+ && !(mSST.mSS.getDataRegistrationState() == ServiceState.STATE_IN_SERVICE
&& ServiceState.isLte(mSST.mSS.getRilDataRadioTechnology())) /* PS not in LTE */
&& !VideoProfile.isVideo(dialArgs.videoState) /* voice call */
&& !isEmergency /* non-emergency call */) {
@@ -3940,7 +3941,7 @@
public @RilRadioTechnology int getCsCallRadioTech() {
int calcVrat = ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
if (mSST != null) {
- calcVrat = getCsCallRadioTech(mSST.mSS.getVoiceRegState(),
+ calcVrat = getCsCallRadioTech(mSST.mSS.getState(),
mSST.mSS.getRilVoiceRadioTechnology());
}
diff --git a/src/java/com/android/internal/telephony/ImsSmsDispatcher.java b/src/java/com/android/internal/telephony/ImsSmsDispatcher.java
index 6216080..58aac01 100644
--- a/src/java/com/android/internal/telephony/ImsSmsDispatcher.java
+++ b/src/java/com/android/internal/telephony/ImsSmsDispatcher.java
@@ -277,7 +277,7 @@
private boolean isLteService() {
return ((mPhone.getServiceState().getRilDataRadioTechnology() ==
ServiceState.RIL_RADIO_TECHNOLOGY_LTE) && (mPhone.getServiceState().
- getDataRegState() == ServiceState.STATE_IN_SERVICE));
+ getDataRegistrationState() == ServiceState.STATE_IN_SERVICE));
}
private boolean isLimitedLteService() {
diff --git a/src/java/com/android/internal/telephony/Phone.java b/src/java/com/android/internal/telephony/Phone.java
index 2ec36aa..51452a3 100644
--- a/src/java/com/android/internal/telephony/Phone.java
+++ b/src/java/com/android/internal/telephony/Phone.java
@@ -4104,7 +4104,7 @@
ServiceState ss = phone.getServiceStateTracker().getServiceState();
// One of the phone is in service, hence the device is not emergency call only.
if (ss.getState() == ServiceState.STATE_IN_SERVICE
- || ss.getDataRegState() == ServiceState.STATE_IN_SERVICE) {
+ || ss.getDataRegistrationState() == ServiceState.STATE_IN_SERVICE) {
return false;
}
isEmergencyCallOnly |= ss.isEmergencyOnly();
diff --git a/src/java/com/android/internal/telephony/ServiceStateTracker.java b/src/java/com/android/internal/telephony/ServiceStateTracker.java
index 781d479..e51d96f 100755
--- a/src/java/com/android/internal/telephony/ServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/ServiceStateTracker.java
@@ -697,7 +697,7 @@
}
// If we are previously in service, we need to notify that we are out of service now.
- if (mSS != null && mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE) {
+ if (mSS != null && mSS.getState() == ServiceState.STATE_IN_SERVICE) {
mNetworkDetachedRegistrants.notifyRegistrants();
}
@@ -839,7 +839,7 @@
*/
protected void notifyVoiceRegStateRilRadioTechnologyChanged() {
int rat = mSS.getRilVoiceRadioTechnology();
- int vrs = mSS.getVoiceRegState();
+ int vrs = mSS.getState();
if (DBG) log("notifyVoiceRegStateRilRadioTechnologyChanged: vrs=" + vrs + " rat=" + rat);
mVoiceRegStateOrRatChangedRegistrants.notifyResult(new Pair<Integer, Integer>(vrs, rat));
@@ -877,11 +877,11 @@
protected void useDataRegStateForDataOnlyDevices() {
if (mVoiceCapable == false) {
if (DBG) {
- log("useDataRegStateForDataOnlyDevice: VoiceRegState=" + mNewSS.getVoiceRegState()
- + " DataRegState=" + mNewSS.getDataRegState());
+ log("useDataRegStateForDataOnlyDevice: VoiceRegState=" + mNewSS.getState()
+ + " DataRegState=" + mNewSS.getDataRegistrationState());
}
// TODO: Consider not lying and instead have callers know the difference.
- mNewSS.setVoiceRegState(mNewSS.getDataRegState());
+ mNewSS.setVoiceRegState(mNewSS.getDataRegistrationState());
}
}
@@ -890,8 +890,8 @@
if (mPhone.getContext().getResources().
getBoolean(com.android.internal.R.bool.config_switch_phone_on_voice_reg_state_change)) {
// If the phone is not registered on a network, no need to update.
- boolean isRegistered = mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE ||
- mSS.getVoiceRegState() == ServiceState.STATE_EMERGENCY_ONLY;
+ boolean isRegistered = mSS.getState() == ServiceState.STATE_IN_SERVICE
+ || mSS.getState() == ServiceState.STATE_EMERGENCY_ONLY;
if (!isRegistered) {
log("updatePhoneObject: Ignore update");
return;
@@ -1363,7 +1363,7 @@
case EVENT_CHECK_REPORT_GPRS:
if (mPhone.isPhoneTypeGsm() && mSS != null &&
- !isGprsConsistent(mSS.getDataRegState(), mSS.getVoiceRegState())) {
+ !isGprsConsistent(mSS.getDataRegistrationState(), mSS.getState())) {
// Can't register data service while voice service is ok
// i.e. CREG is ok while CGREG is not
@@ -1855,7 +1855,7 @@
final int dataRat = getRilDataRadioTechnologyForWwan(mNewSS);
if (ServiceState.isCdma(dataRat)) {
final boolean isVoiceInService =
- (mNewSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE);
+ (mNewSS.getState() == ServiceState.STATE_IN_SERVICE);
if (isVoiceInService) {
boolean isVoiceRoaming = mNewSS.getVoiceRoaming();
if (mNewSS.getDataRoaming() != isVoiceRoaming) {
@@ -2722,7 +2722,7 @@
// is satisfied or SPN override is enabled for this carrier.
// Handle Flight Mode
- if (mSS.getVoiceRegState() == ServiceState.STATE_POWER_OFF) {
+ if (mSS.getState() == ServiceState.STATE_POWER_OFF) {
wfcVoiceSpnFormat = wfcFlightSpnFormat;
}
@@ -2735,7 +2735,7 @@
// Show PLMN + Wi-Fi Calling if there is no valid SPN in the above case
String originalPlmn = plmn.trim();
plmn = String.format(wfcVoiceSpnFormat, originalPlmn);
- } else if (mSS.getVoiceRegState() == ServiceState.STATE_POWER_OFF
+ } else if (mSS.getState() == ServiceState.STATE_POWER_OFF
|| (showPlmn && TextUtils.equals(spn, plmn))) {
// airplane mode or spn equals plmn, do not show spn
spn = null;
@@ -2933,7 +2933,7 @@
*/
@UnsupportedAppUsage
public int getCurrentDataConnectionState() {
- return mSS.getDataRegState();
+ return mSS.getDataRegistrationState();
}
/**
@@ -2950,7 +2950,7 @@
// There are cases where we we would setup data connection even data is not yet
// attached. In these cases we check voice rat.
if (radioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN
- && mSS.getDataRegState() != ServiceState.STATE_IN_SERVICE) {
+ && mSS.getDataRegistrationState() != ServiceState.STATE_IN_SERVICE) {
radioTechnology = mSS.getRilVoiceRadioTechnology();
}
// Concurrent voice and data is not allowed for 2G technologies. It's allowed in other
@@ -3108,16 +3108,16 @@
}
boolean hasRegistered =
- mSS.getVoiceRegState() != ServiceState.STATE_IN_SERVICE
- && mNewSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE;
+ mSS.getState() != ServiceState.STATE_IN_SERVICE
+ && mNewSS.getState() == ServiceState.STATE_IN_SERVICE;
boolean hasDeregistered =
- mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE
- && mNewSS.getVoiceRegState() != ServiceState.STATE_IN_SERVICE;
+ mSS.getState() == ServiceState.STATE_IN_SERVICE
+ && mNewSS.getState() != ServiceState.STATE_IN_SERVICE;
boolean hasAirplaneModeOnChanged =
- mSS.getVoiceRegState() != ServiceState.STATE_POWER_OFF
- && mNewSS.getVoiceRegState() == ServiceState.STATE_POWER_OFF;
+ mSS.getState() != ServiceState.STATE_POWER_OFF
+ && mNewSS.getState() == ServiceState.STATE_POWER_OFF;
SparseBooleanArray hasDataAttached = new SparseBooleanArray(
mTransportManager.getAvailableTransports().length);
@@ -3173,7 +3173,7 @@
&& (mSS.getRilDataRadioTechnology() != mNewSS.getRilDataRadioTechnology());
boolean hasVoiceRegStateChanged =
- mSS.getVoiceRegState() != mNewSS.getVoiceRegState();
+ mSS.getState() != mNewSS.getState();
boolean hasNrFrequencyRangeChanged =
mSS.getNrFrequencyRange() != mNewSS.getNrFrequencyRange();
@@ -3192,7 +3192,8 @@
// ratchet the new tech up through its rat family but don't drop back down
// until cell change or device is OOS
- boolean isDataInService = mNewSS.getDataRegState() == ServiceState.STATE_IN_SERVICE;
+ boolean isDataInService = mNewSS.getDataRegistrationState()
+ == ServiceState.STATE_IN_SERVICE;
if (isDataInService) {
mRatRatcheter.ratchet(mSS, mNewSS, hasLocationChanged);
}
@@ -3220,7 +3221,7 @@
if (mPhone.isPhoneTypeCdmaLte()) {
final int wwanDataRat = getRilDataRadioTechnologyForWwan(mSS);
final int newWwanDataRat = getRilDataRadioTechnologyForWwan(mNewSS);
- has4gHandoff = mNewSS.getDataRegState() == ServiceState.STATE_IN_SERVICE
+ has4gHandoff = mNewSS.getDataRegistrationState() == ServiceState.STATE_IN_SERVICE
&& ((ServiceState.isLte(wwanDataRat)
&& (newWwanDataRat == ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD))
||
@@ -3266,8 +3267,8 @@
if (hasVoiceRegStateChanged || anyDataRegChanged) {
EventLog.writeEvent(mPhone.isPhoneTypeGsm() ? EventLogTags.GSM_SERVICE_STATE_CHANGE :
EventLogTags.CDMA_SERVICE_STATE_CHANGE,
- mSS.getVoiceRegState(), mSS.getDataRegState(),
- mNewSS.getVoiceRegState(), mNewSS.getDataRegState());
+ mSS.getState(), mSS.getDataRegistrationState(),
+ mNewSS.getState(), mNewSS.getDataRegistrationState());
}
if (mPhone.isPhoneTypeGsm()) {
@@ -3503,7 +3504,7 @@
}
if (mPhone.isPhoneTypeGsm()) {
- if (!isGprsConsistent(mSS.getDataRegState(), mSS.getVoiceRegState())) {
+ if (!isGprsConsistent(mSS.getDataRegistrationState(), mSS.getState())) {
if (!mStartedGprsRegCheck && !mReportedGprsNoReg) {
mStartedGprsRegCheck = true;
@@ -3526,7 +3527,7 @@
if ((mCi.getRadioState() == TelephonyManager.RADIO_POWER_ON)
&& (!mIsSubscriptionFromRuim)) {
// Now the Phone sees the new ServiceState so it can get the new ERI text
- if (mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE) {
+ if (mSS.getState() == ServiceState.STATE_IN_SERVICE) {
eriText = mPhone.getCdmaEriText();
} else {
// Note that ServiceState.STATE_OUT_OF_SERVICE is valid used for
@@ -3546,16 +3547,16 @@
// Only when CDMA is in service, ERI will take effect
eriText = mSS.getOperatorAlpha();
// Now the Phone sees the new ServiceState so it can get the new ERI text
- if (mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE) {
+ if (mSS.getState() == ServiceState.STATE_IN_SERVICE) {
eriText = mPhone.getCdmaEriText();
- } else if (mSS.getVoiceRegState() == ServiceState.STATE_POWER_OFF) {
+ } else if (mSS.getState() == ServiceState.STATE_POWER_OFF) {
eriText = getServiceProviderName();
if (TextUtils.isEmpty(eriText)) {
// Sets operator alpha property by retrieving from
// build-time system property
eriText = SystemProperties.get("ro.cdma.home.operator.alpha");
}
- } else if (mSS.getDataRegState() != ServiceState.STATE_IN_SERVICE) {
+ } else if (mSS.getDataRegistrationState() != ServiceState.STATE_IN_SERVICE) {
// Note that ServiceState.STATE_OUT_OF_SERVICE is valid used
// for mRegistrationState 0,2,3 and 4
eriText = mPhone.getContext()
@@ -4469,7 +4470,7 @@
Registrant r = new Registrant(h, what, obj);
mNetworkAttachedRegistrants.add(r);
- if (mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE) {
+ if (mSS.getState() == ServiceState.STATE_IN_SERVICE) {
r.notifyRegistrant();
}
}
@@ -4488,7 +4489,7 @@
Registrant r = new Registrant(h, what, obj);
mNetworkDetachedRegistrants.add(r);
- if (mSS.getVoiceRegState() != ServiceState.STATE_IN_SERVICE) {
+ if (mSS.getState() != ServiceState.STATE_IN_SERVICE) {
r.notifyRegistrant();
}
}
@@ -4952,7 +4953,7 @@
TelephonyManager tm = TelephonyManager.from(mPhone.getContext())
.createForSubscriptionId(info.getSubscriptionId());
ServiceState ss = tm.getServiceState();
- if (ss != null && ss.getDataRegState() == ServiceState.STATE_IN_SERVICE) {
+ if (ss != null && ss.getDataRegistrationState() == ServiceState.STATE_IN_SERVICE) {
return true;
}
}
@@ -5223,7 +5224,7 @@
@UnsupportedAppUsage
protected void setRoamingType(ServiceState currentServiceState) {
final boolean isVoiceInService =
- (currentServiceState.getVoiceRegState() == ServiceState.STATE_IN_SERVICE);
+ (currentServiceState.getState() == ServiceState.STATE_IN_SERVICE);
if (isVoiceInService) {
if (currentServiceState.getVoiceRoaming()) {
if (mPhone.isPhoneTypeGsm()) {
@@ -5266,7 +5267,7 @@
}
}
final boolean isDataInService =
- (currentServiceState.getDataRegState() == ServiceState.STATE_IN_SERVICE);
+ (currentServiceState.getDataRegistrationState() == ServiceState.STATE_IN_SERVICE);
final int dataRegType = getRilDataRadioTechnologyForWwan(currentServiceState);
if (isDataInService) {
if (!currentServiceState.getDataRoaming()) {
@@ -5467,8 +5468,8 @@
* @param ss service state.
*/
protected int getCombinedRegState(ServiceState ss) {
- int regState = ss.getVoiceRegState();
- int dataRegState = ss.getDataRegState();
+ int regState = ss.getState();
+ int dataRegState = ss.getDataRegistrationState();
if ((regState == ServiceState.STATE_OUT_OF_SERVICE
|| regState == ServiceState.STATE_POWER_OFF)
&& (dataRegState == ServiceState.STATE_IN_SERVICE)) {
diff --git a/src/java/com/android/internal/telephony/TelephonyTester.java b/src/java/com/android/internal/telephony/TelephonyTester.java
index 7e393a3..72ee0d2 100644
--- a/src/java/com/android/internal/telephony/TelephonyTester.java
+++ b/src/java/com/android/internal/telephony/TelephonyTester.java
@@ -369,12 +369,12 @@
/*if (mServiceStateTestIntent.hasExtra(EXTRA_VOICE_REG_STATE)) {
ss.setVoiceRegState(mServiceStateTestIntent.getIntExtra(EXTRA_VOICE_REG_STATE,
ServiceState.STATE_OUT_OF_SERVICE));
- log("Override voice service state with " + ss.getVoiceRegState());
+ log("Override voice service state with " + ss.getState());
}
if (mServiceStateTestIntent.hasExtra(EXTRA_DATA_REG_STATE)) {
ss.setDataRegState(mServiceStateTestIntent.getIntExtra(EXTRA_DATA_REG_STATE,
ServiceState.STATE_OUT_OF_SERVICE));
- log("Override data service state with " + ss.getDataRegState());
+ log("Override data service state with " + ss.getDataRegistrationState());
}
if (mServiceStateTestIntent.hasExtra(EXTRA_VOICE_RAT)) {
ss.setRilVoiceRadioTechnology(mServiceStateTestIntent.getIntExtra(EXTRA_VOICE_RAT,
@@ -455,4 +455,4 @@
((ImsPhone) mPhone).notifyPreciseCallStateChanged();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/java/com/android/internal/telephony/cdnr/CarrierDisplayNameResolver.java b/src/java/com/android/internal/telephony/cdnr/CarrierDisplayNameResolver.java
index 87ee39d..b475767 100644
--- a/src/java/com/android/internal/telephony/cdnr/CarrierDisplayNameResolver.java
+++ b/src/java/com/android/internal/telephony/cdnr/CarrierDisplayNameResolver.java
@@ -337,7 +337,7 @@
if (useRootLocale) r.getConfiguration().setLocale(Locale.ROOT);
String[] wfcSpnFormats = r.getStringArray(com.android.internal.R.array.wfcSpnFormats);
WfcCarrierNameFormatter wfcFormatter = new WfcCarrierNameFormatter(config, wfcSpnFormats,
- getServiceState().getVoiceRegState() == ServiceState.STATE_POWER_OFF);
+ getServiceState().getState() == ServiceState.STATE_POWER_OFF);
// Override the spn, data spn, plmn by wifi-calling
String wfcSpn = wfcFormatter.formatVoiceName(rawCarrierDisplayNameData.getSpn());
@@ -380,7 +380,7 @@
boolean forceDisplayNoService =
mPhone.getServiceStateTracker().shouldForceDisplayNoService() && !isSimReady;
ServiceState ss = getServiceState();
- if (ss.getVoiceRegState() == ServiceState.STATE_POWER_OFF
+ if (ss.getState() == ServiceState.STATE_POWER_OFF
|| forceDisplayNoService || !Phone.isEmergencyCallOnly()) {
plmn = mContext.getResources().getString(
com.android.internal.R.string.lockscreen_carrier_default);
@@ -545,7 +545,7 @@
* @param ss service state.
*/
private static int getCombinedRegState(ServiceState ss) {
- if (ss.getVoiceRegState() != ServiceState.STATE_IN_SERVICE) return ss.getDataRegState();
- return ss.getVoiceRegState();
+ if (ss.getState() != ServiceState.STATE_IN_SERVICE) return ss.getDataRegistrationState();
+ return ss.getState();
}
}
diff --git a/src/java/com/android/internal/telephony/dataconnection/DataConnection.java b/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
index bec4b20..5346a00 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
@@ -595,7 +595,7 @@
mId = id;
mCid = -1;
ServiceState ss = mPhone.getServiceState();
- mDataRegState = mPhone.getServiceState().getDataRegState();
+ mDataRegState = mPhone.getServiceState().getDataRegistrationState();
int networkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
NetworkRegistrationInfo nri = ss.getNetworkRegistrationInfo(
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
index b599853..61b8240 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
@@ -1578,7 +1578,7 @@
}
int radioTech = getDataRat();
if (radioTech == ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN && mPhone.getServiceState()
- .getVoiceRegState() == ServiceState.STATE_IN_SERVICE) {
+ .getState() == ServiceState.STATE_IN_SERVICE) {
radioTech = getVoiceRat();
}
log("service state=" + mPhone.getServiceState());
@@ -3917,7 +3917,7 @@
if (phoneSwitcher == null || serviceState == null) return false;
// If voice is also not in service, don't auto attach.
- if (serviceState.getVoiceRegState() != ServiceState.STATE_IN_SERVICE) return false;
+ if (serviceState.getState() != ServiceState.STATE_IN_SERVICE) return false;
// If voice is on LTE or NR, don't auto attach as for LTE / NR data would be attached.
if (serviceState.getVoiceNetworkType() == NETWORK_TYPE_LTE
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhone.java b/src/java/com/android/internal/telephony/imsphone/ImsPhone.java
index 99a175f..f4a47bb 100644
--- a/src/java/com/android/internal/telephony/imsphone/ImsPhone.java
+++ b/src/java/com/android/internal/telephony/imsphone/ImsPhone.java
@@ -446,7 +446,7 @@
boolean isVoiceRegStateChanged = false;
synchronized (this) {
- isVoiceRegStateChanged = mSS.getVoiceRegState() != state;
+ isVoiceRegStateChanged = mSS.getState() != state;
mSS.setVoiceRegState(state);
}
updateDataServiceState();
@@ -1560,7 +1560,7 @@
if (mSS != null && mDefaultPhone.getServiceStateTracker() != null
&& mDefaultPhone.getServiceStateTracker().mSS != null) {
ServiceState ss = mDefaultPhone.getServiceStateTracker().mSS;
- mSS.setDataRegState(ss.getDataRegState());
+ mSS.setDataRegState(ss.getDataRegistrationState());
List<NetworkRegistrationInfo> nriList =
ss.getNetworkRegistrationInfoListForDomain(NetworkRegistrationInfo.DOMAIN_PS);
for (NetworkRegistrationInfo nri : nriList) {
@@ -2061,8 +2061,8 @@
if (mRoaming == newRoamingState) {
return;
}
- boolean isInService = (ss.getVoiceRegState() == ServiceState.STATE_IN_SERVICE
- || ss.getDataRegState() == ServiceState.STATE_IN_SERVICE);
+ boolean isInService = (ss.getState() == ServiceState.STATE_IN_SERVICE
+ || ss.getDataRegistrationState() == ServiceState.STATE_IN_SERVICE);
// If we are not IN_SERVICE for voice or data, ignore change roaming state, as we always
// move to home in this case.
if (!isInService) {
diff --git a/tests/telephonytests/src/com/android/internal/telephony/CarrierServiceStateTrackerTest.java b/tests/telephonytests/src/com/android/internal/telephony/CarrierServiceStateTrackerTest.java
index 9736f47..27ffeef 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/CarrierServiceStateTrackerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/CarrierServiceStateTrackerTest.java
@@ -145,8 +145,8 @@
notificationTypeMap.put(CarrierServiceStateTracker.NOTIFICATION_PREF_NETWORK,
spyPrefNetworkNotification);
Notification.Builder mNotificationBuilder = new Notification.Builder(mContext);
- doReturn(ServiceState.STATE_OUT_OF_SERVICE).when(mSST.mSS).getVoiceRegState();
- doReturn(ServiceState.STATE_OUT_OF_SERVICE).when(mSST.mSS).getDataRegState();
+ doReturn(ServiceState.STATE_OUT_OF_SERVICE).when(mSST.mSS).getState();
+ doReturn(ServiceState.STATE_OUT_OF_SERVICE).when(mSST.mSS).getDataRegistrationState();
doReturn(true).when(mSST).isRadioOn();
doReturn(mNotificationBuilder).when(spyPrefNetworkNotification).getNotificationBuilder();
diff --git a/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java b/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java
index 178f677..7221552 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java
@@ -233,8 +233,8 @@
ServiceState mergedServiceState = mPhoneUT.getServiceState();
- assertEquals(ServiceState.STATE_IN_SERVICE, mergedServiceState.getVoiceRegState());
- assertEquals(ServiceState.STATE_IN_SERVICE, mergedServiceState.getDataRegState());
+ assertEquals(ServiceState.STATE_IN_SERVICE, mergedServiceState.getState());
+ assertEquals(ServiceState.STATE_IN_SERVICE, mergedServiceState.getDataRegistrationState());
assertEquals(TelephonyManager.NETWORK_TYPE_IWLAN, mergedServiceState.getDataNetworkType());
}
@@ -315,8 +315,8 @@
ServiceState mergedServiceState = mPhoneUT.getServiceState();
- assertEquals(ServiceState.STATE_IN_SERVICE, mergedServiceState.getVoiceRegState());
- assertEquals(ServiceState.STATE_IN_SERVICE, mergedServiceState.getDataRegState());
+ assertEquals(ServiceState.STATE_IN_SERVICE, mergedServiceState.getState());
+ assertEquals(ServiceState.STATE_IN_SERVICE, mergedServiceState.getDataRegistrationState());
assertEquals(TelephonyManager.NETWORK_TYPE_LTE, mergedServiceState.getDataNetworkType());
}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/PhoneStateListenerExecutorTest.java b/tests/telephonytests/src/com/android/internal/telephony/PhoneStateListenerExecutorTest.java
index 5f6e917..73126f7 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/PhoneStateListenerExecutorTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/PhoneStateListenerExecutorTest.java
@@ -51,8 +51,8 @@
@Override
public void onServiceStateChanged(ServiceState serviceState) {
logd("Service State Changed");
- mServiceState.setVoiceRegState(serviceState.getVoiceRegState());
- mServiceState.setDataRegState(serviceState.getDataRegState());
+ mServiceState.setVoiceRegState(serviceState.getState());
+ mServiceState.setDataRegState(serviceState.getDataRegistrationState());
}
@Override
diff --git a/tests/telephonytests/src/com/android/internal/telephony/PhoneStateListenerTest.java b/tests/telephonytests/src/com/android/internal/telephony/PhoneStateListenerTest.java
index 2329d69..8c55442 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/PhoneStateListenerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/PhoneStateListenerTest.java
@@ -51,8 +51,8 @@
@Override
public void onServiceStateChanged(ServiceState serviceState) {
logd("Service State Changed");
- mServiceState.setVoiceRegState(serviceState.getVoiceRegState());
- mServiceState.setDataRegState(serviceState.getDataRegState());
+ mServiceState.setVoiceRegState(serviceState.getState());
+ mServiceState.setDataRegState(serviceState.getDataRegistrationState());
}
@Override
diff --git a/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTest.java b/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTest.java
index 2d47062..2ed0dc3 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTest.java
@@ -72,10 +72,10 @@
ServiceState ss = new ServiceState();
ss.setDataRegState(ServiceState.STATE_IN_SERVICE);
- assertEquals(ServiceState.STATE_IN_SERVICE, ss.getDataRegState());
+ assertEquals(ServiceState.STATE_IN_SERVICE, ss.getDataRegistrationState());
ss.setVoiceRegState(ServiceState.STATE_IN_SERVICE);
- assertEquals(ServiceState.STATE_IN_SERVICE, ss.getVoiceRegState());
+ assertEquals(ServiceState.STATE_IN_SERVICE, ss.getState());
}
@SmallTest