I want to re-present the data transfer arrows for Wi-Fi (as seen in the Quick Settings panel) in my app. I have been looking at the source code for Quick Settings and have been roadblocked by a couple of non-public APIs (AsyncChannel & WiFiManager.getWifiServiceMessenger) - does anyone know if there is any conceivable way around this?
For example, NetworkController...
// wifi
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
Handler handler = new WifiHandler();
mWifiChannel = new AsyncChannel(); //Private
Messenger wifiMessenger = mWifiManager.getWifiServiceMessenger(); // Private
if (wifiMessenger != null) {
mWifiChannel.connect(mContext, handler, wifiMessenger);
}
...is handled in...
// ===== Wifi ===================================================================
class WifiHandler extends Handler {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
...
case WifiManager.DATA_ACTIVITY_NOTIFICATION:
if (msg.arg1 != mWifiActivity) {
mWifiActivity = msg.arg1;
refreshViews();
}
break;
...
}
}
}
...where mWifiConnectivity
is communicated to the Quick Setting panel.
I am thinking this is not possible, but thanks for your consideration and confirmation of this hunch :-\
check out this other question here in SO, looks like he's done the monitoring part.