[Settings] Replace isImsRegistered
Replace isImsReigstered() by callback from ImsMmTelManager. Bug: 140542283 Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=SimStatusDialogControllerTest Merged-In: I904da749df7074918d205ebd004a173ed109c561 Change-Id: I193805ef947636e50bb21d273be15361378d8f8a
This commit is contained in:
committed by
SongFerngWang
parent
28c11a8c01
commit
a0b4ca3684
@@ -27,6 +27,7 @@ import android.content.res.Resources;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.PersistableBundle;
|
import android.os.PersistableBundle;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
import android.telephony.AccessNetworkConstants;
|
||||||
import android.telephony.Annotation;
|
import android.telephony.Annotation;
|
||||||
import android.telephony.CarrierConfigManager;
|
import android.telephony.CarrierConfigManager;
|
||||||
import android.telephony.CellBroadcastIntents;
|
import android.telephony.CellBroadcastIntents;
|
||||||
@@ -42,6 +43,9 @@ import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener;
|
|||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.telephony.UiccCardInfo;
|
import android.telephony.UiccCardInfo;
|
||||||
import android.telephony.euicc.EuiccManager;
|
import android.telephony.euicc.EuiccManager;
|
||||||
|
import android.telephony.ims.ImsException;
|
||||||
|
import android.telephony.ims.ImsMmTelManager;
|
||||||
|
import android.telephony.ims.ImsReasonInfo;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -107,11 +111,27 @@ public class SimStatusDialogController implements LifecycleObserver, OnResume, O
|
|||||||
new OnSubscriptionsChangedListener() {
|
new OnSubscriptionsChangedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscriptionsChanged() {
|
public void onSubscriptionsChanged() {
|
||||||
mSubscriptionInfo = mSubscriptionManager.getActiveSubscriptionInfo(
|
final int prevSubId = (mSubscriptionInfo != null)
|
||||||
mSubscriptionInfo.getSubscriptionId());
|
? mSubscriptionInfo.getSubscriptionId()
|
||||||
mTelephonyManager = mTelephonyManager.createForSubscriptionId(
|
: SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
mSubscriptionInfo.getSubscriptionId());
|
|
||||||
updateNetworkProvider();
|
mSubscriptionInfo = getPhoneSubscriptionInfo(mSlotIndex);
|
||||||
|
|
||||||
|
final int nextSubId = (mSubscriptionInfo != null)
|
||||||
|
? mSubscriptionInfo.getSubscriptionId()
|
||||||
|
: SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
|
|
||||||
|
if (prevSubId != nextSubId) {
|
||||||
|
if (SubscriptionManager.isValidSubscriptionId(prevSubId)) {
|
||||||
|
unregisterImsRegistrationCallback(prevSubId);
|
||||||
|
}
|
||||||
|
if (SubscriptionManager.isValidSubscriptionId(nextSubId)) {
|
||||||
|
mTelephonyManager =
|
||||||
|
mTelephonyManager.createForSubscriptionId(nextSubId);
|
||||||
|
registerImsRegistrationCallback(nextSubId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateSubscriptionStatus();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -201,13 +221,17 @@ public class SimStatusDialogController implements LifecycleObserver, OnResume, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
mPhoneStateListener = getPhoneStateListener();
|
mPhoneStateListener = getPhoneStateListener();
|
||||||
|
updateLatestAreaInfo();
|
||||||
|
updateSubscriptionStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateSubscriptionStatus() {
|
||||||
updateNetworkProvider();
|
updateNetworkProvider();
|
||||||
|
|
||||||
final ServiceState serviceState = mTelephonyManager.getServiceState();
|
final ServiceState serviceState = mTelephonyManager.getServiceState();
|
||||||
final SignalStrength signalStrength = mTelephonyManager.getSignalStrength();
|
final SignalStrength signalStrength = mTelephonyManager.getSignalStrength();
|
||||||
|
|
||||||
updatePhoneNumber();
|
updatePhoneNumber();
|
||||||
updateLatestAreaInfo();
|
|
||||||
updateServiceState(serviceState);
|
updateServiceState(serviceState);
|
||||||
updateSignalStrength(signalStrength);
|
updateSignalStrength(signalStrength);
|
||||||
updateNetworkType();
|
updateNetworkType();
|
||||||
@@ -241,6 +265,7 @@ public class SimStatusDialogController implements LifecycleObserver, OnResume, O
|
|||||||
| PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
|
| PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
|
||||||
| PhoneStateListener.LISTEN_SERVICE_STATE);
|
| PhoneStateListener.LISTEN_SERVICE_STATE);
|
||||||
mSubscriptionManager.addOnSubscriptionsChangedListener(mOnSubscriptionsChangedListener);
|
mSubscriptionManager.addOnSubscriptionsChangedListener(mOnSubscriptionsChangedListener);
|
||||||
|
registerImsRegistrationCallback(mSubscriptionInfo.getSubscriptionId());
|
||||||
|
|
||||||
if (mShowLatestAreaInfo) {
|
if (mShowLatestAreaInfo) {
|
||||||
updateAreaInfoText();
|
updateAreaInfoText();
|
||||||
@@ -255,6 +280,7 @@ public class SimStatusDialogController implements LifecycleObserver, OnResume, O
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unregisterImsRegistrationCallback(mSubscriptionInfo.getSubscriptionId());
|
||||||
mSubscriptionManager.removeOnSubscriptionsChangedListener(mOnSubscriptionsChangedListener);
|
mSubscriptionManager.removeOnSubscriptionsChangedListener(mOnSubscriptionsChangedListener);
|
||||||
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
|
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
|
||||||
|
|
||||||
@@ -525,21 +551,68 @@ public class SimStatusDialogController implements LifecycleObserver, OnResume, O
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateImsRegistrationState() {
|
private boolean isImsRegistrationStateShowUp() {
|
||||||
final int subscriptionId = mSubscriptionInfo.getSubscriptionId();
|
final int subscriptionId = mSubscriptionInfo.getSubscriptionId();
|
||||||
final PersistableBundle carrierConfig =
|
final PersistableBundle carrierConfig =
|
||||||
mCarrierConfigManager.getConfigForSubId(subscriptionId);
|
mCarrierConfigManager.getConfigForSubId(subscriptionId);
|
||||||
final boolean showImsRegState = carrierConfig == null ? false :
|
return carrierConfig == null ? false :
|
||||||
carrierConfig.getBoolean(
|
carrierConfig.getBoolean(
|
||||||
CarrierConfigManager.KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL);
|
CarrierConfigManager.KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL);
|
||||||
if (showImsRegState) {
|
}
|
||||||
final boolean isImsRegistered = mTelephonyManager.isImsRegistered(subscriptionId);
|
|
||||||
mDialog.setText(IMS_REGISTRATION_STATE_VALUE_ID, mRes.getString(isImsRegistered ?
|
private void updateImsRegistrationState() {
|
||||||
R.string.ims_reg_status_registered : R.string.ims_reg_status_not_registered));
|
if (isImsRegistrationStateShowUp()) {
|
||||||
} else {
|
return;
|
||||||
mDialog.removeSettingFromScreen(IMS_REGISTRATION_STATE_LABEL_ID);
|
|
||||||
mDialog.removeSettingFromScreen(IMS_REGISTRATION_STATE_VALUE_ID);
|
|
||||||
}
|
}
|
||||||
|
mDialog.removeSettingFromScreen(IMS_REGISTRATION_STATE_LABEL_ID);
|
||||||
|
mDialog.removeSettingFromScreen(IMS_REGISTRATION_STATE_VALUE_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ImsMmTelManager.RegistrationCallback mImsRegStateCallback =
|
||||||
|
new ImsMmTelManager.RegistrationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onRegistered(@AccessNetworkConstants.TransportType int imsTransportType) {
|
||||||
|
mDialog.setText(IMS_REGISTRATION_STATE_VALUE_ID, mRes.getString(
|
||||||
|
R.string.ims_reg_status_registered));
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onRegistering(@AccessNetworkConstants.TransportType int imsTransportType) {
|
||||||
|
mDialog.setText(IMS_REGISTRATION_STATE_VALUE_ID, mRes.getString(
|
||||||
|
R.string.ims_reg_status_not_registered));
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onUnregistered(@Nullable ImsReasonInfo info) {
|
||||||
|
mDialog.setText(IMS_REGISTRATION_STATE_VALUE_ID, mRes.getString(
|
||||||
|
R.string.ims_reg_status_not_registered));
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onTechnologyChangeFailed(
|
||||||
|
@AccessNetworkConstants.TransportType int imsTransportType,
|
||||||
|
@Nullable ImsReasonInfo info) {
|
||||||
|
mDialog.setText(IMS_REGISTRATION_STATE_VALUE_ID, mRes.getString(
|
||||||
|
R.string.ims_reg_status_not_registered));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private void registerImsRegistrationCallback(int subId) {
|
||||||
|
if (!isImsRegistrationStateShowUp()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
final ImsMmTelManager imsMmTelMgr = ImsMmTelManager.createForSubscriptionId(subId);
|
||||||
|
imsMmTelMgr.registerImsRegistrationCallback(mDialog.getContext().getMainExecutor(),
|
||||||
|
mImsRegStateCallback);
|
||||||
|
} catch (ImsException exception) {
|
||||||
|
Log.w(TAG, "fail to register IMS status for subId=" + subId, exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void unregisterImsRegistrationCallback(int subId) {
|
||||||
|
if (!isImsRegistrationStateShowUp()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final ImsMmTelManager imsMmTelMgr = ImsMmTelManager.createForSubscriptionId(subId);
|
||||||
|
imsMmTelMgr.unregisterImsRegistrationCallback(mImsRegStateCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SubscriptionInfo getPhoneSubscriptionInfo(int slotId) {
|
private SubscriptionInfo getPhoneSubscriptionInfo(int slotId) {
|
||||||
|
@@ -43,6 +43,7 @@ import static org.mockito.Mockito.never;
|
|||||||
import static org.mockito.Mockito.spy;
|
import static org.mockito.Mockito.spy;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
import static org.robolectric.Shadows.shadowOf;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
@@ -80,6 +81,7 @@ import org.robolectric.RuntimeEnvironment;
|
|||||||
import org.robolectric.Shadows;
|
import org.robolectric.Shadows;
|
||||||
import org.robolectric.annotation.Config;
|
import org.robolectric.annotation.Config;
|
||||||
import org.robolectric.shadows.ShadowPackageManager;
|
import org.robolectric.shadows.ShadowPackageManager;
|
||||||
|
import org.robolectric.shadows.ShadowTelephonyManager;
|
||||||
import org.robolectric.util.ReflectionHelpers;
|
import org.robolectric.util.ReflectionHelpers;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -93,7 +95,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
private SimStatusDialogFragment mDialog;
|
private SimStatusDialogFragment mDialog;
|
||||||
@Mock
|
|
||||||
private TelephonyManager mTelephonyManager;
|
private TelephonyManager mTelephonyManager;
|
||||||
@Mock
|
@Mock
|
||||||
private SubscriptionInfo mSubscriptionInfo;
|
private SubscriptionInfo mSubscriptionInfo;
|
||||||
@@ -115,7 +116,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
private PersistableBundle mPersistableBundle;
|
private PersistableBundle mPersistableBundle;
|
||||||
@Mock
|
@Mock
|
||||||
private EuiccManager mEuiccManager;
|
private EuiccManager mEuiccManager;
|
||||||
@Mock
|
|
||||||
private SubscriptionManager mSubscriptionManager;
|
private SubscriptionManager mSubscriptionManager;
|
||||||
|
|
||||||
private SimStatusDialogController mController;
|
private SimStatusDialogController mController;
|
||||||
@@ -131,10 +131,22 @@ public class SimStatusDialogControllerTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
mContext = RuntimeEnvironment.application;
|
mContext = spy(RuntimeEnvironment.application);
|
||||||
when(mDialog.getContext()).thenReturn(mContext);
|
when(mDialog.getContext()).thenReturn(mContext);
|
||||||
mLifecycleOwner = () -> mLifecycle;
|
mLifecycleOwner = () -> mLifecycle;
|
||||||
mLifecycle = new Lifecycle(mLifecycleOwner);
|
mLifecycle = new Lifecycle(mLifecycleOwner);
|
||||||
|
|
||||||
|
mSubscriptionManager = spy(mContext.getSystemService(SubscriptionManager.class));
|
||||||
|
|
||||||
|
mTelephonyManager = spy(mContext.getSystemService(TelephonyManager.class));
|
||||||
|
final ShadowTelephonyManager shadowTelephonyMgr = shadowOf(mTelephonyManager);
|
||||||
|
shadowTelephonyMgr.setTelephonyManagerForSubscriptionId(
|
||||||
|
SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, mTelephonyManager);
|
||||||
|
doReturn(2).when(mTelephonyManager).getCardIdForDefaultEuicc();
|
||||||
|
doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mTelephonyManager).getDataNetworkType();
|
||||||
|
|
||||||
|
doReturn(mEuiccManager).when(mContext).getSystemService(EuiccManager.class);
|
||||||
|
|
||||||
mController = spy(new SimStatusDialogController(mDialog, mLifecycle, 0 /* phone id */));
|
mController = spy(new SimStatusDialogController(mDialog, mLifecycle, 0 /* phone id */));
|
||||||
ShadowDeviceInfoUtils.setPhoneNumber("");
|
ShadowDeviceInfoUtils.setPhoneNumber("");
|
||||||
//CellSignalStrength setup
|
//CellSignalStrength setup
|
||||||
@@ -156,9 +168,9 @@ public class SimStatusDialogControllerTest {
|
|||||||
ReflectionHelpers.setField(mController, "mSubscriptionManager", mSubscriptionManager);
|
ReflectionHelpers.setField(mController, "mSubscriptionManager", mSubscriptionManager);
|
||||||
|
|
||||||
when(mTelephonyManager.getActiveModemCount()).thenReturn(MAX_PHONE_COUNT_SINGLE_SIM);
|
when(mTelephonyManager.getActiveModemCount()).thenReturn(MAX_PHONE_COUNT_SINGLE_SIM);
|
||||||
when(mTelephonyManager.getUiccCardsInfo()).thenReturn(new ArrayList<UiccCardInfo>());
|
doReturn(new ArrayList<UiccCardInfo>()).when(mTelephonyManager).getUiccCardsInfo();
|
||||||
when(mTelephonyManager.getLogicalToPhysicalSlotMapping()).thenReturn(
|
doReturn(new HashMap<Integer, Integer>()).when(mTelephonyManager)
|
||||||
new HashMap<Integer, Integer>());
|
.getLogicalToPhysicalSlotMapping();
|
||||||
|
|
||||||
when(mEuiccManager.isEnabled()).thenReturn(false);
|
when(mEuiccManager.isEnabled()).thenReturn(false);
|
||||||
when(mEuiccManager.getEid()).thenReturn("");
|
when(mEuiccManager.getEid()).thenReturn("");
|
||||||
@@ -168,7 +180,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
when(mPersistableBundle.getBoolean(
|
when(mPersistableBundle.getBoolean(
|
||||||
CarrierConfigManager.KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL))
|
CarrierConfigManager.KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
when(mTelephonyManager.createForSubscriptionId(anyInt())).thenReturn(mTelephonyManager);
|
|
||||||
doReturn(mServiceState).when(mTelephonyManager).getServiceState();
|
doReturn(mServiceState).when(mTelephonyManager).getServiceState();
|
||||||
doReturn(mSignalStrength).when(mTelephonyManager).getSignalStrength();
|
doReturn(mSignalStrength).when(mTelephonyManager).getSignalStrength();
|
||||||
|
|
||||||
@@ -185,7 +196,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateNetworkProviderWithFoobarCarrier_shouldUpdateCarrierWithFoobar() {
|
public void initialize_updateNetworkProviderWithFoobarCarrier_shouldUpdateCarrierWithFoobar() {
|
||||||
final CharSequence carrierName = "foobar";
|
final CharSequence carrierName = "foobar";
|
||||||
doReturn(carrierName).when(mSubscriptionInfo).getCarrierName();
|
doReturn(carrierName).when(mSubscriptionInfo).getCarrierName();
|
||||||
@@ -196,7 +206,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updatePhoneNumberWith1111111111_shouldUpdatePhoneNumber() {
|
public void initialize_updatePhoneNumberWith1111111111_shouldUpdatePhoneNumber() {
|
||||||
ShadowDeviceInfoUtils.setPhoneNumber("1111111111");
|
ShadowDeviceInfoUtils.setPhoneNumber("1111111111");
|
||||||
|
|
||||||
@@ -209,7 +218,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateLatestAreaInfoWithCdmaPhone_shouldRemoveOperatorInfoSetting() {
|
public void initialize_updateLatestAreaInfoWithCdmaPhone_shouldRemoveOperatorInfoSetting() {
|
||||||
when(mTelephonyManager.getPhoneType()).thenReturn(TelephonyManager.PHONE_TYPE_CDMA);
|
when(mTelephonyManager.getPhoneType()).thenReturn(TelephonyManager.PHONE_TYPE_CDMA);
|
||||||
|
|
||||||
@@ -220,7 +228,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateServiceStateWithInService_shouldUpdateTextToBeCInService() {
|
public void initialize_updateServiceStateWithInService_shouldUpdateTextToBeCInService() {
|
||||||
when(mServiceState.getState()).thenReturn(ServiceState.STATE_IN_SERVICE);
|
when(mServiceState.getState()).thenReturn(ServiceState.STATE_IN_SERVICE);
|
||||||
|
|
||||||
@@ -231,7 +238,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateServiceStateWithPowerOff_shouldUpdateTextAndResetSignalStrength() {
|
public void initialize_updateServiceStateWithPowerOff_shouldUpdateTextAndResetSignalStrength() {
|
||||||
when(mServiceState.getState()).thenReturn(ServiceState.STATE_POWER_OFF);
|
when(mServiceState.getState()).thenReturn(ServiceState.STATE_POWER_OFF);
|
||||||
when(mPersistableBundle.getBoolean(
|
when(mPersistableBundle.getBoolean(
|
||||||
@@ -245,7 +251,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateVoiceDataOutOfService_shouldUpdateSettingAndResetSignalStrength() {
|
public void initialize_updateVoiceDataOutOfService_shouldUpdateSettingAndResetSignalStrength() {
|
||||||
when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
|
when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
|
||||||
when(mServiceState.getDataRegistrationState()).thenReturn(
|
when(mServiceState.getDataRegistrationState()).thenReturn(
|
||||||
@@ -261,7 +266,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateVoiceOutOfServiceDataInService_shouldUpdateTextToBeInService() {
|
public void initialize_updateVoiceOutOfServiceDataInService_shouldUpdateTextToBeInService() {
|
||||||
when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
|
when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
|
||||||
when(mServiceState.getDataRegistrationState()).thenReturn(ServiceState.STATE_IN_SERVICE);
|
when(mServiceState.getDataRegistrationState()).thenReturn(ServiceState.STATE_IN_SERVICE);
|
||||||
@@ -275,7 +279,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateSignalStrengthWithLte50Wcdma40_shouldUpdateSignalStrengthTo50() {
|
public void initialize_updateSignalStrengthWithLte50Wcdma40_shouldUpdateSignalStrengthTo50() {
|
||||||
final int lteDbm = 50;
|
final int lteDbm = 50;
|
||||||
final int lteAsu = 50;
|
final int lteAsu = 50;
|
||||||
@@ -293,7 +296,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateSignalStrengthWithLte50Cdma30_shouldUpdateSignalStrengthTo50() {
|
public void initialize_updateSignalStrengthWithLte50Cdma30_shouldUpdateSignalStrengthTo50() {
|
||||||
final int lteDbm = 50;
|
final int lteDbm = 50;
|
||||||
final int lteAsu = 50;
|
final int lteAsu = 50;
|
||||||
@@ -311,7 +313,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateVoiceOutOfServiceDataInService_shouldUpdateSignalStrengthTo50() {
|
public void initialize_updateVoiceOutOfServiceDataInService_shouldUpdateSignalStrengthTo50() {
|
||||||
when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
|
when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
|
||||||
when(mServiceState.getDataRegistrationState()).thenReturn(ServiceState.STATE_IN_SERVICE);
|
when(mServiceState.getDataRegistrationState()).thenReturn(ServiceState.STATE_IN_SERVICE);
|
||||||
@@ -332,7 +333,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateVoiceNetworkTypeWithEdge_shouldUpdateSettingToEdge() {
|
public void initialize_updateVoiceNetworkTypeWithEdge_shouldUpdateSettingToEdge() {
|
||||||
when(mTelephonyManager.getVoiceNetworkType()).thenReturn(
|
when(mTelephonyManager.getVoiceNetworkType()).thenReturn(
|
||||||
TelephonyManager.NETWORK_TYPE_EDGE);
|
TelephonyManager.NETWORK_TYPE_EDGE);
|
||||||
@@ -344,7 +344,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateDataNetworkTypeWithEdge_shouldUpdateSettingToEdge() {
|
public void initialize_updateDataNetworkTypeWithEdge_shouldUpdateSettingToEdge() {
|
||||||
when(mTelephonyManager.getDataNetworkType()).thenReturn(
|
when(mTelephonyManager.getDataNetworkType()).thenReturn(
|
||||||
TelephonyManager.NETWORK_TYPE_EDGE);
|
TelephonyManager.NETWORK_TYPE_EDGE);
|
||||||
@@ -356,7 +355,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateRoamingStatusIsRoaming_shouldSetSettingToRoaming() {
|
public void initialize_updateRoamingStatusIsRoaming_shouldSetSettingToRoaming() {
|
||||||
when(mServiceState.getRoaming()).thenReturn(true);
|
when(mServiceState.getRoaming()).thenReturn(true);
|
||||||
|
|
||||||
@@ -367,7 +365,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_updateRoamingStatusNotRoaming_shouldSetSettingToRoamingOff() {
|
public void initialize_updateRoamingStatusNotRoaming_shouldSetSettingToRoamingOff() {
|
||||||
when(mServiceState.getRoaming()).thenReturn(false);
|
when(mServiceState.getRoaming()).thenReturn(false);
|
||||||
|
|
||||||
@@ -378,7 +375,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_doNotShowIccid_shouldRemoveIccidSetting() {
|
public void initialize_doNotShowIccid_shouldRemoveIccidSetting() {
|
||||||
when(mPersistableBundle.getBoolean(
|
when(mPersistableBundle.getBoolean(
|
||||||
CarrierConfigManager.KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL)).thenReturn(false);
|
CarrierConfigManager.KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL)).thenReturn(false);
|
||||||
@@ -390,7 +386,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_doNotShowSignalStrength_shouldRemoveSignalStrengthSetting() {
|
public void initialize_doNotShowSignalStrength_shouldRemoveSignalStrengthSetting() {
|
||||||
when(mPersistableBundle.getBoolean(
|
when(mPersistableBundle.getBoolean(
|
||||||
CarrierConfigManager.KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL))
|
CarrierConfigManager.KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL))
|
||||||
@@ -403,7 +398,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_showSignalStrengthAndIccId_shouldShowSignalStrengthAndIccIdSetting() {
|
public void initialize_showSignalStrengthAndIccId_shouldShowSignalStrengthAndIccIdSetting() {
|
||||||
// getConfigForSubId is nullable, so make sure the default behavior is correct
|
// getConfigForSubId is nullable, so make sure the default behavior is correct
|
||||||
when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(null);
|
when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(null);
|
||||||
@@ -416,7 +410,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_showIccid_shouldSetIccidToSetting() {
|
public void initialize_showIccid_shouldSetIccidToSetting() {
|
||||||
final String iccid = "12351351231241";
|
final String iccid = "12351351231241";
|
||||||
when(mPersistableBundle.getBoolean(
|
when(mPersistableBundle.getBoolean(
|
||||||
@@ -755,7 +748,6 @@ public class SimStatusDialogControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void initialize_nullSignalStrength_noCrash() {
|
public void initialize_nullSignalStrength_noCrash() {
|
||||||
doReturn(null).when(mTelephonyManager).getSignalStrength();
|
doReturn(null).when(mTelephonyManager).getSignalStrength();
|
||||||
// we should not crash when running the following line
|
// we should not crash when running the following line
|
||||||
|
Reference in New Issue
Block a user