Ethernet connection in status bar

1,044 views
Skip to first unread message

Darren Landoll

unread,
Feb 6, 2012, 8:09:20 PM2/6/12
to Android Contributors
I was doing some work with getting Ethernet to work on the Pandaboard
over the weekend. Once I had applications accessing the network via
Ethernet I noticed that the status bar was reporting "No Internet
connection" (I had wifi disabled).

I tracked down the code in SystemUI and made some changes so the
status bar now reports when it is connected to Ethernet (mostly
working in all cases with some hard coded text and no icon
indicator). Is this something that should be supported or would it be
better not to since most devices do not require an Ethernet status?

Jean-Baptiste Queru

unread,
Feb 7, 2012, 10:28:57 AM2/7/12
to android...@googlegroups.com
I think it'd be good to go in that direction. "No connection" is
definitely surprising when in fact Ethernet is working fine.

JBQ

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

József Király

unread,
Feb 7, 2012, 2:26:53 PM2/7/12
to android...@googlegroups.com
I had the same on the old x86 porting projects, on my Motion M1400. While ethernet connections were working properly, and internet connection was made, the indicators said "No internet connection" every time (no ethernet indicator either, till someone merged a fix for that in their trees). Although it was on Gingerbread (2.3.3), and I don't know how much that changed towards Ice Cream Sandwich, it might be the same problem.

2012/2/7 Jean-Baptiste Queru <j...@android.com>

Darren Landoll

unread,
Feb 19, 2012, 6:15:41 PM2/19/12
to android...@googlegroups.com
I've uploaded my initial changes with basic icon support for review:

https://android-review.googlesource.com/32890

Arun Joseph

unread,
Feb 23, 2012, 8:03:00 AM2/23/12
to Android Contributors
Hi Darren,

I could successfully try your patches for the rowboat project
(arowboat.org)

I have added the following things which could be missing in the
original patch

1)Ethernet connection status is updated on boot up
2)Ethernet status is added to the PhoneStatusBar

Please see my additional changes in the below diff

2)Ethernet status is added to the PhoneStatusBar

--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/
PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/
PhoneStatusBar.java
@@ -356,6 +356,12 @@ public class PhoneStatusBar extends StatusBar {
mNetworkController.addSignalCluster(signalCluster);
signalCluster.setNetworkController(mNetworkController);

+ final ImageView ethernetStatus =
+ (ImageView)sb.findViewById(R.id.ethernet_status);
+ if (ethernetStatus != null) {
+
mNetworkController.addEthernetIconView(ethernetStatus);
+ }
+
// Recents Panel
mRecentTasksLoader = new RecentTasksLoader(context);
updateRecentsPanel();

1)Ethernet connection status is updated on boot up

--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/
NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/
NetworkController.java
@@ -110,8 +110,9 @@ public class NetworkController extends
BroadcastReceiver {
com.android.internal.R.drawable.stat_sys_tether_bluetooth;

// Ethernet
- boolean mEthernetEnabled, mEthernetConnected;
- int mEthernetIconId = 0; // overlay arrows for wifi direction
+ boolean mEthernetEnabled, mEthernetConnected, mHasEthernet;
+ int mEthernetIconId = R.drawable.stat_sys_ethernet_disconnected;
+
int mEthernetActivity = EthernetManager.DATA_ACTIVITY_NONE;
private static final int[] sEthImages = {
R.drawable.connect_established,

Please comment.

Thanks,
Arun

Darren Landoll

unread,
Feb 23, 2012, 9:21:55 PM2/23/12
to android...@googlegroups.com
Thanks Arun.  Those look like good suggestions and I'll try to get them integrated into my next set of patches.

For the phone related change, it looks like PhoneStatusBarPolicy may be a possible choice also as the wifi stuff appears to be handled there but I'll need to look more closely.

Darren
Reply all
Reply to author
Forward
0 new messages