diff options
7 files changed, 39 insertions, 84 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 024c1a089ef2..03c46e8b3726 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java @@ -223,7 +223,8 @@ public class MobileSignalController extends SignalController< String contentDescription = getStringIfExists(getContentDescription()); String dataContentDescription = getStringIfExists(icons.mDataContentDescription); - final boolean dataDisabled = isDataDisabled() && mCurrentState.userSetup; + final boolean dataDisabled = mCurrentState.iconGroup == TelephonyIcons.DATA_DISABLED + && mCurrentState.userSetup; // Show icon in QS when we are connected or data is disabled. boolean showDataIcon = mCurrentState.dataConnected || dataDisabled; @@ -403,7 +404,7 @@ public class MobileSignalController extends SignalController< mCurrentState.roaming = isRoaming(); if (isCarrierNetworkChangeActive()) { mCurrentState.iconGroup = TelephonyIcons.CARRIER_NETWORK_CHANGE; - } else if (isDataDisabled() && !mConfig.alwaysShowDataRatIcon) { + } else if (isDataDisabled()) { mCurrentState.iconGroup = TelephonyIcons.DATA_DISABLED; } if (isEmergencyOnly() != mCurrentState.isEmergency) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index dd1a4c5ed8c3..2f7cd0033f4c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -28,9 +28,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Looper; -import android.os.PersistableBundle; import android.provider.Settings; -import android.telephony.CarrierConfigManager; import android.telephony.ServiceState; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; @@ -221,7 +219,6 @@ public class NetworkControllerImpl extends BroadcastReceiver filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction(ConnectivityManager.INET_CONDITION_ACTION); filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED); - filter.addAction(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED); mContext.registerReceiver(this, filter, null, mReceiverHandler); mListening = true; @@ -399,14 +396,6 @@ public class NetworkControllerImpl extends BroadcastReceiver // emergency state. recalculateEmergency(); } - } else if (action.equals(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED)) { - mConfig = Config.readConfig(mContext); - mReceiverHandler.post(new Runnable() { - @Override - public void run() { - handleConfigurationChanged(); - } - }); } else { int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.INVALID_SUBSCRIPTION_ID); @@ -915,7 +904,6 @@ public class NetworkControllerImpl extends BroadcastReceiver boolean show4gForLte = false; boolean hideLtePlus = false; boolean hspaDataDistinguishable; - boolean alwaysShowDataRatIcon = false; static Config readConfig(Context context) { Config config = new Config(); @@ -928,14 +916,6 @@ public class NetworkControllerImpl extends BroadcastReceiver config.hspaDataDistinguishable = res.getBoolean(R.bool.config_hspa_data_distinguishable); config.hideLtePlus = res.getBoolean(R.bool.config_hideLtePlus); - - CarrierConfigManager configMgr = (CarrierConfigManager) - context.getSystemService(Context.CARRIER_CONFIG_SERVICE); - PersistableBundle b = configMgr.getConfig(); - if (b != null) { - config.alwaysShowDataRatIcon = b.getBoolean( - CarrierConfigManager.KEY_ALWAYS_SHOW_DATA_RAT_ICON_BOOL); - } return config; } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java index 93e1e6ca8af8..fce1172ff625 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java @@ -110,21 +110,6 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { verifyDataIndicators(0, 0); } - public void testAlwaysShowDataRatIcon() { - setupDefaultSignal(); - Mockito.when(mMockTm.getDataEnabled(mSubId)).thenReturn(false); - updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, - TelephonyManager.NETWORK_TYPE_GSM); - - // Switch to showing data RAT icon when data is diconnected - // and re-initialize the NetworkController. - mConfig.alwaysShowDataRatIcon = true; - mNetworkController.handleConfigurationChanged(); - - verifyDataIndicators(TelephonyIcons.DATA_G[1][0 /* No direction */], - TelephonyIcons.QS_DATA_G); - } - public void test4gDataIconConfigChange() { setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index e3d66e7599ee..f96b26ca78ba 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -895,12 +895,6 @@ public class CarrierConfigManager { public static final String KEY_STK_DISABLE_LAUNCH_BROWSER_BOOL = "stk_disable_launch_browser_bool"; - /** - * Boolean indicating if show data RAT icon on status bar even when data is disabled - * @hide - */ - public static final String KEY_ALWAYS_SHOW_DATA_RAT_ICON_BOOL = - "always_show_data_rat_icon_bool"; // These variables are used by the MMS service and exposed through another API, {@link // SmsManager}. The variable names and string values are copied from there. @@ -1582,7 +1576,6 @@ public class CarrierConfigManager { sDefaults.putInt(KEY_LTE_EARFCNS_RSRP_BOOST_INT, 0); sDefaults.putStringArray(KEY_BOOSTED_LTE_EARFCNS_STRING_ARRAY, null); sDefaults.putBoolean(KEY_DISABLE_VOICE_BARRING_NOTIFICATION_BOOL, false); - sDefaults.putBoolean(KEY_ALWAYS_SHOW_DATA_RAT_ICON_BOOL, false); } /** diff --git a/tests/net/java/com/android/server/connectivity/IpConnectivityEventBuilderTest.java b/tests/net/java/com/android/server/connectivity/IpConnectivityEventBuilderTest.java index 8c16dbb5798b..011e505c46c4 100644 --- a/tests/net/java/com/android/server/connectivity/IpConnectivityEventBuilderTest.java +++ b/tests/net/java/com/android/server/connectivity/IpConnectivityEventBuilderTest.java @@ -58,6 +58,8 @@ public class IpConnectivityEventBuilderTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 1", + " transport: 0", " default_network_event <", " network_id <", " network_id: 102", @@ -70,8 +72,6 @@ public class IpConnectivityEventBuilderTest extends TestCase { " transport_types: 2", " transport_types: 3", " >", - " time_ms: 1", - " transport: 0", ">", "version: 2"); @@ -89,14 +89,13 @@ public class IpConnectivityEventBuilderTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 1", + " transport: 0", " dhcp_event <", " duration_ms: 192", - " error_code: 0", " if_name: \"wlan0\"", " state_transition: \"SomeState\"", " >", - " time_ms: 1", - " transport: 0", ">", "version: 2"); @@ -113,14 +112,13 @@ public class IpConnectivityEventBuilderTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 1", + " transport: 0", " dhcp_event <", " duration_ms: 0", - " error_code: 50397184", " if_name: \"wlan0\"", - " state_transition: \"\"", + " error_code: 50397184", " >", - " time_ms: 1", - " transport: 0", ">", "version: 2"); @@ -139,6 +137,8 @@ public class IpConnectivityEventBuilderTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 1", + " transport: 0", " dns_lookup_batch <", " event_types: 1", " event_types: 1", @@ -168,8 +168,6 @@ public class IpConnectivityEventBuilderTest extends TestCase { " return_codes: 200", " return_codes: 178", " >", - " time_ms: 1", - " transport: 0", ">", "version: 2"); @@ -187,13 +185,13 @@ public class IpConnectivityEventBuilderTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 1", + " transport: 0", " ip_provisioning_event <", " event_type: 1", " if_name: \"wlan0\"", " latency_ms: 5678", " >", - " time_ms: 1", - " transport: 0", ">", "version: 2"); @@ -210,12 +208,12 @@ public class IpConnectivityEventBuilderTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 1", + " transport: 0", " ip_reachability_event <", " event_type: 512", " if_name: \"wlan0\"", " >", - " time_ms: 1", - " transport: 0", ">", "version: 2"); @@ -233,6 +231,8 @@ public class IpConnectivityEventBuilderTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 1", + " transport: 0", " network_event <", " event_type: 5", " latency_ms: 20410", @@ -240,8 +240,6 @@ public class IpConnectivityEventBuilderTest extends TestCase { " network_id: 100", " >", " >", - " time_ms: 1", - " transport: 0", ">", "version: 2"); @@ -289,6 +287,8 @@ public class IpConnectivityEventBuilderTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 1", + " transport: 0", " apf_program_event <", " current_ras: 9", " drop_multicast: true", @@ -297,8 +297,6 @@ public class IpConnectivityEventBuilderTest extends TestCase { " lifetime: 200", " program_length: 2048", " >", - " time_ms: 1", - " transport: 0", ">", "version: 2"); @@ -321,6 +319,8 @@ public class IpConnectivityEventBuilderTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 1", + " transport: 0", " apf_statistics <", " dropped_ras: 2", " duration_ms: 45000", @@ -331,8 +331,6 @@ public class IpConnectivityEventBuilderTest extends TestCase { " received_ras: 10", " zero_lifetime_ras: 1", " >", - " time_ms: 1", - " transport: 0", ">", "version: 2"); @@ -353,6 +351,8 @@ public class IpConnectivityEventBuilderTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 1", + " transport: 0", " ra_event <", " dnssl_lifetime: -1", " prefix_preferred_lifetime: 300", @@ -361,8 +361,6 @@ public class IpConnectivityEventBuilderTest extends TestCase { " route_info_lifetime: -1", " router_lifetime: 2000", " >", - " time_ms: 1", - " transport: 0", ">", "version: 2"); diff --git a/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java b/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java index 9a33cdeec864..450653cdb01f 100644 --- a/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java +++ b/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java @@ -158,24 +158,25 @@ public class IpConnectivityMetricsTest extends TestCase { String want = joinLines( "dropped_events: 0", "events <", + " time_ms: 100", + " transport: 0", " ip_reachability_event <", " event_type: 512", " if_name: \"wlan0\"", " >", - " time_ms: 100", - " transport: 0", ">", "events <", + " time_ms: 200", + " transport: 0", " dhcp_event <", " duration_ms: 192", - " error_code: 0", " if_name: \"wlan0\"", " state_transition: \"SomeState\"", " >", - " time_ms: 200", - " transport: 0", ">", "events <", + " time_ms: 300", + " transport: 0", " default_network_event <", " network_id <", " network_id: 102", @@ -188,17 +189,15 @@ public class IpConnectivityMetricsTest extends TestCase { " transport_types: 2", " transport_types: 3", " >", - " time_ms: 300", - " transport: 0", ">", "events <", + " time_ms: 400", + " transport: 0", " ip_provisioning_event <", " event_type: 1", " if_name: \"wlan0\"", " latency_ms: 5678", " >", - " time_ms: 400", - " transport: 0", ">", "events <", " time_ms: 500", @@ -213,6 +212,8 @@ public class IpConnectivityMetricsTest extends TestCase { " >", ">", "events <", + " time_ms: 600", + " transport: 0", " apf_statistics <", " dropped_ras: 2", " duration_ms: 45000", @@ -223,10 +224,10 @@ public class IpConnectivityMetricsTest extends TestCase { " received_ras: 10", " zero_lifetime_ras: 1", " >", - " time_ms: 600", - " transport: 0", ">", "events <", + " time_ms: 700", + " transport: 0", " ra_event <", " dnssl_lifetime: -1", " prefix_preferred_lifetime: 300", @@ -235,8 +236,6 @@ public class IpConnectivityMetricsTest extends TestCase { " route_info_lifetime: -1", " router_lifetime: 2000", " >", - " time_ms: 700", - " transport: 0", ">", "version: 2"); diff --git a/tests/net/java/com/android/server/connectivity/NetdEventListenerServiceTest.java b/tests/net/java/com/android/server/connectivity/NetdEventListenerServiceTest.java index 6c8babbd39ac..97afa60f0c6d 100644 --- a/tests/net/java/com/android/server/connectivity/NetdEventListenerServiceTest.java +++ b/tests/net/java/com/android/server/connectivity/NetdEventListenerServiceTest.java @@ -212,6 +212,8 @@ public class NetdEventListenerServiceTest extends TestCase { IpConnectivityEvent got = events.get(0); String want = joinLines( + "time_ms: 0", + "transport: 0", "connect_statistics <", " connect_count: 12", " errnos_counters <", @@ -245,10 +247,7 @@ public class NetdEventListenerServiceTest extends TestCase { " latencies_ms: 67", " latencies_ms: 110", " latencies_ms: 214", - " latencies_ms: 523", - ">", - "time_ms: 0", - "transport: 0"); + " latencies_ms: 523"); verifyConnectEvent(want, got); } |