summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andrew Flynn <flynn@google.com> 2015-05-29 08:33:46 -0400
committer Andrew Flynn <flynn@google.com> 2015-06-02 12:41:53 -0400
commit55fc8004ad1896da615fd08caca87d1b393d085c (patch)
tree7f21b6c372df6333f3a813f4fddefad7cfc63c6a
parent233241f13d5d7f841d3db80408429d4d0a528c78 (diff)
Show Carrier Network Change icon SysUI even while connected
Taking connect/disconnect events into accounts results in frequent jank while trying to show the icon. Bug: 21504588 Change-Id: If271980cc46cfc20f80083de17a4b57c42439069
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java2
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java38
2 files changed, 4 insertions, 36 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index cfc95bfba372..686e24c1655d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -272,7 +272,7 @@ public class MobileSignalController extends SignalController<
}
private boolean isCarrierNetworkChangeActive() {
- return !hasService() && mCurrentState.carrierNetworkChangeMode;
+ return mCurrentState.carrierNetworkChangeMode;
}
public void handleBroadcast(Intent intent) {
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 dd6f272404a5..2df19803b6e6 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
@@ -391,35 +391,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
}
- public void testCarrierNetworkChange_carrierNetworkChangeWhileConnected() {
- int strength = SignalStrength.SIGNAL_STRENGTH_GREAT;
-
- setupDefaultSignal();
- setLevel(strength);
-
- // API call is made
- setCarrierNetworkChange(true /* enabled */);
-
- // Boolean value is set, but we still have a signal, should be showing normal
- verifyLastMobileDataIndicators(true /* visible */,
- TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[1][strength] /* strengthIcon */,
- DEFAULT_ICON /* typeIcon */);
-
- // Lose voice but still have data
- setVoiceRegState(ServiceState.STATE_OUT_OF_SERVICE);
- verifyLastMobileDataIndicators(true /* visible */,
- TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[1][strength] /* strengthIcon */,
- DEFAULT_ICON /* typeIcon */);
-
- // Voice but no data
- setVoiceRegState(ServiceState.STATE_IN_SERVICE);
- setDataRegState(ServiceState.STATE_OUT_OF_SERVICE);
- verifyLastMobileDataIndicators(true /* visible */,
- TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[1][strength] /* strengthIcon */,
- DEFAULT_ICON /* typeIcon */);
- }
-
- public void testCarrierNetworkChange_carrierNetworkChangeWhileDisconnected() {
+ public void testCarrierNetworkChange_carrierNetworkChange() {
int strength = SignalStrength.SIGNAL_STRENGTH_GREAT;
setupDefaultSignal();
@@ -430,20 +402,16 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[1][strength] /* strengthIcon */,
DEFAULT_ICON /* typeIcon */);
- // API call is made and all connectivity lost
+ // API call is made
setCarrierNetworkChange(true /* enabled */);
- setVoiceRegState(ServiceState.STATE_OUT_OF_SERVICE);
- setDataRegState(ServiceState.STATE_OUT_OF_SERVICE);
- // Out of service and carrier network change is true, show special indicator
+ // Carrier network change is true, show special indicator
verifyLastMobileDataIndicators(true /* visible */,
TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE[0][0] /* strengthIcon */,
0 /* typeIcon */);
// Revert back
setCarrierNetworkChange(false /* enabled */);
- setVoiceRegState(ServiceState.STATE_IN_SERVICE);
- setDataRegState(ServiceState.STATE_IN_SERVICE);
// Verify back in previous state
verifyLastMobileDataIndicators(true /* visible */,