Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -462,11 +462,12 @@ public class PhoneStatusBar extends BaseStatusBar { signalCluster.setNetworkController(mNetworkController); signalCluster.setNetworkController(mNetworkController); if (SHOW_CARRIER_LABEL) { if (SHOW_CARRIER_LABEL) { // for wifi-only devices, we show SSID; otherwise, we show PLMN // for mobile devices, we always show mobile connection info here (SPN/PLMN) // for other devices, we show whatever network is connected if (mNetworkController.hasMobileDataFeature()) { if (mNetworkController.hasMobileDataFeature()) { mNetworkController.addMobileLabelView(mCarrierLabel); mNetworkController.addMobileLabelView(mCarrierLabel); } else { } else { mNetworkController.addWifiLabelView(mCarrierLabel); mNetworkController.addCombinedLabelView(mCarrierLabel); } } } } Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +27 −3 Original line number Original line Diff line number Diff line Loading @@ -121,8 +121,12 @@ public class NetworkController extends BroadcastReceiver { private int mWimaxSignal = 0; private int mWimaxSignal = 0; private int mWimaxState = 0; private int mWimaxState = 0; private int mWimaxExtraState = 0; private int mWimaxExtraState = 0; // data connectivity (regardless of state, can we access the internet?) // data connectivity (regardless of state, can we access the internet?) // state of inet connection - 0 not connected, 100 connected // state of inet connection - 0 not connected, 100 connected private boolean mConnected = false; private int mConnectedNetworkType = ConnectivityManager.TYPE_NONE; private String mConnectedNetworkTypeName; private int mInetCondition = 0; private int mInetCondition = 0; private static final int INET_CONDITION_THRESHOLD = 50; private static final int INET_CONDITION_THRESHOLD = 50; Loading Loading @@ -868,6 +872,16 @@ public class NetworkController extends BroadcastReceiver { .getSystemService(Context.CONNECTIVITY_SERVICE); .getSystemService(Context.CONNECTIVITY_SERVICE); final NetworkInfo info = connManager.getActiveNetworkInfo(); final NetworkInfo info = connManager.getActiveNetworkInfo(); // Are we connected at all, by any interface? mConnected = info != null && info.isConnected(); if (mConnected) { mConnectedNetworkType = info.getType(); mConnectedNetworkTypeName = info.getTypeName(); } else { mConnectedNetworkType = ConnectivityManager.TYPE_NONE; mConnectedNetworkTypeName = null; } int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0); int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0); if (CHATTY) { if (CHATTY) { Loading Loading @@ -912,12 +926,13 @@ public class NetworkController extends BroadcastReceiver { // - We are connected to mobile data, or // - We are connected to mobile data, or // - We are not connected to mobile data, as long as the *reason* packets are not // - We are not connected to mobile data, as long as the *reason* packets are not // being routed over that link is that we have better connectivity via wifi. // being routed over that link is that we have better connectivity via wifi. // If data is disconnected for some other reason but wifi is connected, we show nothing. // If data is disconnected for some other reason but wifi (or ethernet/bluetooth) // is connected, we show nothing. // Otherwise (nothing connected) we show "No internet connection". // Otherwise (nothing connected) we show "No internet connection". if (mDataConnected) { if (mDataConnected) { mobileLabel = mNetworkName; mobileLabel = mNetworkName; } else if (mWifiConnected) { } else if (mConnected) { if (hasService()) { if (hasService()) { mobileLabel = mNetworkName; mobileLabel = mNetworkName; } else { } else { Loading Loading @@ -997,6 +1012,12 @@ public class NetworkController extends BroadcastReceiver { R.string.accessibility_bluetooth_tether); R.string.accessibility_bluetooth_tether); } } final boolean ethernetConnected = (mConnectedNetworkType == ConnectivityManager.TYPE_ETHERNET); if (ethernetConnected) { // TODO: icons and strings for Ethernet connectivity combinedLabel = mConnectedNetworkTypeName; } if (mAirplaneMode && if (mAirplaneMode && (mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly()))) { (mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly()))) { // Only display the flight-mode icon if not in "emergency calls only" mode. // Only display the flight-mode icon if not in "emergency calls only" mode. Loading @@ -1023,7 +1044,7 @@ public class NetworkController extends BroadcastReceiver { combinedSignalIconId = mDataSignalIconId; combinedSignalIconId = mDataSignalIconId; } } } } else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered && !mWimaxConnected) { else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered && !mWimaxConnected && !ethernetConnected) { // pretty much totally disconnected // pretty much totally disconnected combinedLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected); combinedLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected); Loading Loading @@ -1224,6 +1245,9 @@ public class NetworkController extends BroadcastReceiver { public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("NetworkController state:"); pw.println("NetworkController state:"); pw.println(String.format(" %s network type %d (%s)", mConnected?"CONNECTED":"DISCONNECTED", mConnectedNetworkType, mConnectedNetworkTypeName)); pw.println(" - telephony ------"); pw.println(" - telephony ------"); pw.print(" hasService()="); pw.print(" hasService()="); pw.println(hasService()); pw.println(hasService()); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -462,11 +462,12 @@ public class PhoneStatusBar extends BaseStatusBar { signalCluster.setNetworkController(mNetworkController); signalCluster.setNetworkController(mNetworkController); if (SHOW_CARRIER_LABEL) { if (SHOW_CARRIER_LABEL) { // for wifi-only devices, we show SSID; otherwise, we show PLMN // for mobile devices, we always show mobile connection info here (SPN/PLMN) // for other devices, we show whatever network is connected if (mNetworkController.hasMobileDataFeature()) { if (mNetworkController.hasMobileDataFeature()) { mNetworkController.addMobileLabelView(mCarrierLabel); mNetworkController.addMobileLabelView(mCarrierLabel); } else { } else { mNetworkController.addWifiLabelView(mCarrierLabel); mNetworkController.addCombinedLabelView(mCarrierLabel); } } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +27 −3 Original line number Original line Diff line number Diff line Loading @@ -121,8 +121,12 @@ public class NetworkController extends BroadcastReceiver { private int mWimaxSignal = 0; private int mWimaxSignal = 0; private int mWimaxState = 0; private int mWimaxState = 0; private int mWimaxExtraState = 0; private int mWimaxExtraState = 0; // data connectivity (regardless of state, can we access the internet?) // data connectivity (regardless of state, can we access the internet?) // state of inet connection - 0 not connected, 100 connected // state of inet connection - 0 not connected, 100 connected private boolean mConnected = false; private int mConnectedNetworkType = ConnectivityManager.TYPE_NONE; private String mConnectedNetworkTypeName; private int mInetCondition = 0; private int mInetCondition = 0; private static final int INET_CONDITION_THRESHOLD = 50; private static final int INET_CONDITION_THRESHOLD = 50; Loading Loading @@ -868,6 +872,16 @@ public class NetworkController extends BroadcastReceiver { .getSystemService(Context.CONNECTIVITY_SERVICE); .getSystemService(Context.CONNECTIVITY_SERVICE); final NetworkInfo info = connManager.getActiveNetworkInfo(); final NetworkInfo info = connManager.getActiveNetworkInfo(); // Are we connected at all, by any interface? mConnected = info != null && info.isConnected(); if (mConnected) { mConnectedNetworkType = info.getType(); mConnectedNetworkTypeName = info.getTypeName(); } else { mConnectedNetworkType = ConnectivityManager.TYPE_NONE; mConnectedNetworkTypeName = null; } int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0); int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0); if (CHATTY) { if (CHATTY) { Loading Loading @@ -912,12 +926,13 @@ public class NetworkController extends BroadcastReceiver { // - We are connected to mobile data, or // - We are connected to mobile data, or // - We are not connected to mobile data, as long as the *reason* packets are not // - We are not connected to mobile data, as long as the *reason* packets are not // being routed over that link is that we have better connectivity via wifi. // being routed over that link is that we have better connectivity via wifi. // If data is disconnected for some other reason but wifi is connected, we show nothing. // If data is disconnected for some other reason but wifi (or ethernet/bluetooth) // is connected, we show nothing. // Otherwise (nothing connected) we show "No internet connection". // Otherwise (nothing connected) we show "No internet connection". if (mDataConnected) { if (mDataConnected) { mobileLabel = mNetworkName; mobileLabel = mNetworkName; } else if (mWifiConnected) { } else if (mConnected) { if (hasService()) { if (hasService()) { mobileLabel = mNetworkName; mobileLabel = mNetworkName; } else { } else { Loading Loading @@ -997,6 +1012,12 @@ public class NetworkController extends BroadcastReceiver { R.string.accessibility_bluetooth_tether); R.string.accessibility_bluetooth_tether); } } final boolean ethernetConnected = (mConnectedNetworkType == ConnectivityManager.TYPE_ETHERNET); if (ethernetConnected) { // TODO: icons and strings for Ethernet connectivity combinedLabel = mConnectedNetworkTypeName; } if (mAirplaneMode && if (mAirplaneMode && (mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly()))) { (mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly()))) { // Only display the flight-mode icon if not in "emergency calls only" mode. // Only display the flight-mode icon if not in "emergency calls only" mode. Loading @@ -1023,7 +1044,7 @@ public class NetworkController extends BroadcastReceiver { combinedSignalIconId = mDataSignalIconId; combinedSignalIconId = mDataSignalIconId; } } } } else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered && !mWimaxConnected) { else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered && !mWimaxConnected && !ethernetConnected) { // pretty much totally disconnected // pretty much totally disconnected combinedLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected); combinedLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected); Loading Loading @@ -1224,6 +1245,9 @@ public class NetworkController extends BroadcastReceiver { public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("NetworkController state:"); pw.println("NetworkController state:"); pw.println(String.format(" %s network type %d (%s)", mConnected?"CONNECTED":"DISCONNECTED", mConnectedNetworkType, mConnectedNetworkTypeName)); pw.println(" - telephony ------"); pw.println(" - telephony ------"); pw.print(" hasService()="); pw.print(" hasService()="); pw.println(hasService()); pw.println(hasService()); Loading