diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2013-08-14 15:25:22 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2013-08-15 11:13:03 -0700 |
commit | bbabe1433361d83e4cabab80acdc839e437a8452 (patch) | |
tree | 90933347a6febb35f4845909d02fe1a77b46935e /wifi/java/android | |
parent | 80f7ec06d0e45a8724122d5b4451ee12e37f9aac (diff) | |
download | frameworks_base-bbabe1433361d83e4cabab80acdc839e437a8452.zip frameworks_base-bbabe1433361d83e4cabab80acdc839e437a8452.tar.gz frameworks_base-bbabe1433361d83e4cabab80acdc839e437a8452.tar.bz2 |
wifi: Send event without prefix to p2p0
Bug: 9298955
Change-Id: I71037dd1cd60ee4efa75e1d6fab60a07bdf0626d
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'wifi/java/android')
-rw-r--r-- | wifi/java/android/net/wifi/WifiMonitor.java | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/wifi/java/android/net/wifi/WifiMonitor.java b/wifi/java/android/net/wifi/WifiMonitor.java index f6d5c98..a80238b 100644 --- a/wifi/java/android/net/wifi/WifiMonitor.java +++ b/wifi/java/android/net/wifi/WifiMonitor.java @@ -506,13 +506,14 @@ public class WifiMonitor { Log.d(TAG, "Event [" + eventStr + "]"); } + String iface = "p2p0"; WifiMonitor m = null; mStateMachine = null; if (eventStr.startsWith("IFNAME=")) { int space = eventStr.indexOf(' '); if (space != -1) { - String iface = eventStr.substring(7,space); + iface = eventStr.substring(7,space); m = mWifiMonitorSingleton.getMonitor(iface); if (m == null && iface.startsWith("p2p-")) { // p2p interfaces are created dynamically, but we have @@ -520,20 +521,20 @@ public class WifiMonitor { // for it explicitly, and send messages there .. m = mWifiMonitorSingleton.getMonitor("p2p0"); } - if (m != null) { - if (m.mMonitoring) { - mStateMachine = m.mWifiStateMachine; - eventStr = eventStr.substring(space + 1); - } - else { - if (DBG) Log.d(TAG, "Dropping event because monitor (" + iface + - ") is stopped"); - continue; - } - } - else { - eventStr = eventStr.substring(space + 1); - } + eventStr = eventStr.substring(space + 1); + } + } else { + // events without prefix belong to p2p0 monitor + m = mWifiMonitorSingleton.getMonitor("p2p0"); + } + + if (m != null) { + if (m.mMonitoring) { + mStateMachine = m.mWifiStateMachine; + } else { + if (DBG) Log.d(TAG, "Dropping event because monitor (" + iface + + ") is stopped"); + continue; } } |