summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/statusbar/policy
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2011-03-10 15:29:49 -0800
committerJustin Ho <justinho@google.com>2011-03-10 22:21:50 -0800
commitf32621aded6858b8712511ee30313c94934e009d (patch)
tree64ea735c625682f9321084157c1a2d1c70e9473e /packages/SystemUI/src/com/android/systemui/statusbar/policy
parent3de30a4c1e48d92af14154abddd4fb6fe0c6aa13 (diff)
downloadframeworks_base-f32621aded6858b8712511ee30313c94934e009d.zip
frameworks_base-f32621aded6858b8712511ee30313c94934e009d.tar.gz
frameworks_base-f32621aded6858b8712511ee30313c94934e009d.tar.bz2
Wire up the data activity reporting on wifi icon in status bar.
Bug: 3412258 and #6699FF Change-Id: I11142f1cd5a2a60045b2a1fea371b2ead2aa81b4
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/policy')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java40
1 files changed, 21 insertions, 19 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index b17e41b..69585ab 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -94,6 +94,7 @@ public class NetworkController extends BroadcastReceiver {
int mWifiLevel;
String mWifiSsid;
int mWifiIconId = 0;
+ int mWifiActivity = WifiManager.DATA_ACTIVITY_NONE;
// bluetooth
private boolean mBluetoothTethered = false;
@@ -153,9 +154,7 @@ public class NetworkController extends BroadcastReceiver {
// wifi
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
- HandlerThread handlerThread = new HandlerThread("WifiServiceThread");
- handlerThread.start();
- Handler handler = new WifiHandler(handlerThread.getLooper());
+ Handler handler = new WifiHandler();
mWifiChannel = new AsyncChannel();
Messenger wifiMessenger = mWifiManager.getMessenger();
if (wifiMessenger != null) {
@@ -549,11 +548,6 @@ public class NetworkController extends BroadcastReceiver {
// ===== Wifi ===================================================================
class WifiHandler extends Handler {
-
- WifiHandler(Looper looper) {
- super(looper);
- }
-
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
@@ -566,17 +560,9 @@ public class NetworkController extends BroadcastReceiver {
}
break;
case WifiManager.DATA_ACTIVITY_NOTIFICATION:
- int dataActivity = msg.arg1;
- /* TODO: update icons based on data activity */
- switch (dataActivity) {
- case WifiManager.DATA_ACTIVITY_IN:
- break;
- case WifiManager.DATA_ACTIVITY_OUT:
- break;
- case WifiManager.DATA_ACTIVITY_INOUT:
- break;
- case WifiManager.DATA_ACTIVITY_NONE:
- break;
+ if (msg.arg1 != mWifiActivity) {
+ mWifiActivity = msg.arg1;
+ refreshViews();
}
break;
default:
@@ -697,6 +683,19 @@ public class NetworkController extends BroadcastReceiver {
label = context.getString(R.string.status_bar_settings_signal_meter_wifi_nossid);
} else {
label = mWifiSsid;
+ switch (mWifiActivity) {
+ case WifiManager.DATA_ACTIVITY_IN:
+ dataDirectionOverlayIconId = R.drawable.stat_sys_wifi_in;
+ break;
+ case WifiManager.DATA_ACTIVITY_OUT:
+ dataDirectionOverlayIconId = R.drawable.stat_sys_wifi_out;
+ break;
+ case WifiManager.DATA_ACTIVITY_INOUT:
+ dataDirectionOverlayIconId = R.drawable.stat_sys_wifi_inout;
+ break;
+ case WifiManager.DATA_ACTIVITY_NONE:
+ break;
+ }
}
combinedSignalIconId = mWifiIconId;
dataTypeIconId = 0;
@@ -884,6 +883,9 @@ public class NetworkController extends BroadcastReceiver {
pw.println(mWifiSsid);
pw.print(" mWifiIconId=");
pw.println(mWifiIconId);
+ pw.print(" mWifiActivity=");
+ pw.println(mWifiActivity);
+
pw.println(" - Bluetooth ----");
pw.print(" mBtReverseTethered=");