mainline:Replace serviceState.getDataRegState and getVoiceRegState
Replace serviceState.getVoiceRegState with getState
Replace serviceState.getDataRegState with getDataRegistrationState
Bug: 146637978
Test: atest TelephonyConnectionServiceTest (PASS)
atest ServiceStateProviderTest (PASS)
atest NumberVerificationManagerTest (PASS)
Change-Id: Id458f4e030186d4bb91573ba638e63280f246df3
Merged-In: Id458f4e030186d4bb91573ba638e63280f246df3
diff --git a/src/com/android/phone/NumberVerificationManager.java b/src/com/android/phone/NumberVerificationManager.java
index 9ec16f8..2298d40 100644
--- a/src/com/android/phone/NumberVerificationManager.java
+++ b/src/com/android/phone/NumberVerificationManager.java
@@ -135,7 +135,7 @@
}
// make sure at least one phone is registered for voice
- if (phone.getServiceState().getVoiceRegState() == ServiceState.STATE_IN_SERVICE) {
+ if (phone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE) {
isAnyPhoneVoiceRegistered = true;
}
// make sure at least one phone has room for an incoming call.
diff --git a/src/com/android/phone/ServiceStateProvider.java b/src/com/android/phone/ServiceStateProvider.java
index 69ea27c..9e6ea83 100644
--- a/src/com/android/phone/ServiceStateProvider.java
+++ b/src/com/android/phone/ServiceStateProvider.java
@@ -209,8 +209,8 @@
}
// Build the result
- final int voice_reg_state = ss.getVoiceRegState();
- final int data_reg_state = ss.getDataRegState();
+ final int voice_reg_state = ss.getState();
+ final int data_reg_state = ss.getDataRegistrationState();
final int voice_roaming_type = ss.getVoiceRoamingType();
final int data_roaming_type = ss.getDataRoamingType();
final String voice_operator_alpha_long = ss.getOperatorAlphaLong();
@@ -324,11 +324,11 @@
}
private static boolean voiceRegStateChanged(ServiceState oldSS, ServiceState newSS) {
- return oldSS.getVoiceRegState() != newSS.getVoiceRegState();
+ return oldSS.getState() != newSS.getState();
}
private static boolean dataRegStateChanged(ServiceState oldSS, ServiceState newSS) {
- return oldSS.getDataRegState() != newSS.getDataRegState();
+ return oldSS.getDataRegistrationState() != newSS.getDataRegistrationState();
}
private static boolean voiceRoamingTypeChanged(ServiceState oldSS, ServiceState newSS) {
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index bac4793..fe853fe 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -896,7 +896,7 @@
int dataNetType = phone.getServiceState().getDataNetworkType();
if (dataNetType == TelephonyManager.NETWORK_TYPE_LTE ||
dataNetType == TelephonyManager.NETWORK_TYPE_LTE_CA) {
- state = phone.getServiceState().getDataRegState();
+ state = phone.getServiceState().getDataRegistrationState();
}
}
diff --git a/tests/src/com/android/phone/NumberVerificationManagerTest.java b/tests/src/com/android/phone/NumberVerificationManagerTest.java
index d476ba5..f7914ab 100644
--- a/tests/src/com/android/phone/NumberVerificationManagerTest.java
+++ b/tests/src/com/android/phone/NumberVerificationManagerTest.java
@@ -57,7 +57,7 @@
public void setUp() {
MockitoAnnotations.initMocks(this);
ServiceState ss = mock(ServiceState.class);
- when(ss.getVoiceRegState()).thenReturn(ServiceState.STATE_IN_SERVICE);
+ when(ss.getState()).thenReturn(ServiceState.STATE_IN_SERVICE);
when(mPhone1.getServiceState()).thenReturn(ss);
when(mPhone1.getForegroundCall()).thenReturn(mForegroundCall);
when(mPhone1.getRingingCall()).thenReturn(mRingingCall);
@@ -107,7 +107,7 @@
@Test
public void testNoPhoneInServiceFailure() throws Exception {
ServiceState ss = mock(ServiceState.class);
- when(ss.getVoiceRegState()).thenReturn(ServiceState.STATE_POWER_OFF);
+ when(ss.getState()).thenReturn(ServiceState.STATE_POWER_OFF);
when(mPhone1.getServiceState()).thenReturn(ss);
when(mPhone2.getServiceState()).thenReturn(ss);
NumberVerificationManager manager =
@@ -138,7 +138,7 @@
@Test
public void testVerificationWorksWithOnePhoneInService() throws Exception {
ServiceState ss = mock(ServiceState.class);
- when(ss.getVoiceRegState()).thenReturn(ServiceState.STATE_POWER_OFF);
+ when(ss.getState()).thenReturn(ServiceState.STATE_POWER_OFF);
when(mPhone1.getServiceState()).thenReturn(ss);
NumberVerificationManager manager =
new NumberVerificationManager(() -> new Phone[]{mPhone1, mPhone2});
diff --git a/tests/src/com/android/phone/ServiceStateProviderTest.java b/tests/src/com/android/phone/ServiceStateProviderTest.java
index 5f13389..574c0c9 100644
--- a/tests/src/com/android/phone/ServiceStateProviderTest.java
+++ b/tests/src/com/android/phone/ServiceStateProviderTest.java
@@ -161,8 +161,8 @@
assertNotNull(cursor);
cursor.moveToFirst();
- final int voiceRegState = ss.getVoiceRegState();
- final int dataRegState = ss.getDataRegState();
+ final int voiceRegState = ss.getState();
+ final int dataRegState = ss.getDataRegistrationState();
final String voiceOperatorAlphaLong = ss.getOperatorAlphaLong();
final String voiceOperatorAlphaShort = ss.getOperatorAlphaShort();
final String voiceOperatorNumeric = ss.getOperatorNumeric();