summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/tests/src')
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java12
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java12
2 files changed, 7 insertions, 17 deletions
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
index 9b95d5c..260dea0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
@@ -69,6 +69,8 @@ public class NetworkControllerBaseTest extends AndroidTestCase {
protected TelephonyManager mMockTm;
protected Config mConfig;
+ protected int mSubId;
+
private NetworkCapabilities mNetCapabilities;
@Override
@@ -100,13 +102,13 @@ public class NetworkControllerBaseTest extends AndroidTestCase {
protected void setupNetworkController() {
// For now just pretend to be the data sim, so we can test that too.
- final int subId = SubscriptionManager.getDefaultDataSubId();
+ mSubId = SubscriptionManager.getDefaultDataSubId();
SubscriptionInfo subscription = mock(SubscriptionInfo.class);
List<SubscriptionInfo> subs = new ArrayList<SubscriptionInfo>();
- when(subscription.getSubscriptionId()).thenReturn(subId);
+ when(subscription.getSubscriptionId()).thenReturn(mSubId);
subs.add(subscription);
mNetworkController.setCurrentSubscriptions(subs);
- mMobileSignalController = mNetworkController.mMobileSignalControllers.get(subId);
+ mMobileSignalController = mNetworkController.mMobileSignalControllers.get(mSubId);
mPhoneStateListener = mMobileSignalController.mPhoneStateListener;
mSignalCluster = mock(SignalCluster.class);
mNetworkSignalChangedCallback = mock(NetworkSignalChangedCallback.class);
@@ -291,10 +293,6 @@ public class NetworkControllerBaseTest extends AndroidTestCase {
assertEquals("Visibility in status bar", visible, (boolean) visibleArg.getValue());
}
- protected void assertSimStateEquals(IccCardConstants.State expected) {
- assertEquals("Sim state", expected, mMobileSignalController.getSimState());
- }
-
protected void assertNetworkNameEquals(String expected) {
assertEquals("Network name", expected, mNetworkController.getMobileNetworkName());
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
index 65b0971..7fa3f68 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
@@ -25,6 +25,7 @@ import android.telephony.SubscriptionInfo;
import android.telephony.TelephonyManager;
import com.android.internal.telephony.IccCardConstants;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyIntents;
import com.android.systemui.R;
@@ -254,16 +255,6 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
setCdmaRoaming(false);
}
- public void testOnReceive_updateSimState_noSim() {
- Intent intent = new Intent();
- intent.setAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
- intent.putExtra(IccCardConstants.INTENT_KEY_ICC_STATE, IccCardConstants.INTENT_VALUE_ICC_ABSENT);
-
- mNetworkController.onReceive(mContext, intent);
-
- assertSimStateEquals(IccCardConstants.State.ABSENT);
- }
-
public void testOnReceive_stringsUpdatedAction_spn() {
String expectedMNetworkName = "Test";
Intent intent = createStringsUpdatedIntent(true /* showSpn */,
@@ -344,6 +335,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
intent.putExtra(TelephonyIntents.EXTRA_SHOW_PLMN, showPlmn);
intent.putExtra(TelephonyIntents.EXTRA_PLMN, plmn);
+ intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, mSubId);
return intent;
}