Merge "wifi: Send event without prefix to p2p0" into klp-dev

This commit is contained in:
Dmitry Shmidt
2013-08-15 19:32:33 +00:00
committed by Android (Google) Code Review

View File

@@ -506,13 +506,14 @@ public class WifiMonitor {
Log.d(TAG, "Event [" + eventStr + "]"); Log.d(TAG, "Event [" + eventStr + "]");
} }
String iface = "p2p0";
WifiMonitor m = null; WifiMonitor m = null;
mStateMachine = null; mStateMachine = null;
if (eventStr.startsWith("IFNAME=")) { if (eventStr.startsWith("IFNAME=")) {
int space = eventStr.indexOf(' '); int space = eventStr.indexOf(' ');
if (space != -1) { if (space != -1) {
String iface = eventStr.substring(7,space); iface = eventStr.substring(7,space);
m = mWifiMonitorSingleton.getMonitor(iface); m = mWifiMonitorSingleton.getMonitor(iface);
if (m == null && iface.startsWith("p2p-")) { if (m == null && iface.startsWith("p2p-")) {
// p2p interfaces are created dynamically, but we have // p2p interfaces are created dynamically, but we have
@@ -520,22 +521,22 @@ public class WifiMonitor {
// for it explicitly, and send messages there .. // for it explicitly, and send messages there ..
m = mWifiMonitorSingleton.getMonitor("p2p0"); m = mWifiMonitorSingleton.getMonitor("p2p0");
} }
eventStr = eventStr.substring(space + 1);
}
} else {
// events without prefix belong to p2p0 monitor
m = mWifiMonitorSingleton.getMonitor("p2p0");
}
if (m != null) { if (m != null) {
if (m.mMonitoring) { if (m.mMonitoring) {
mStateMachine = m.mWifiStateMachine; mStateMachine = m.mWifiStateMachine;
eventStr = eventStr.substring(space + 1); } else {
}
else {
if (DBG) Log.d(TAG, "Dropping event because monitor (" + iface + if (DBG) Log.d(TAG, "Dropping event because monitor (" + iface +
") is stopped"); ") is stopped");
continue; continue;
} }
} }
else {
eventStr = eventStr.substring(space + 1);
}
}
}
if (mStateMachine != null) { if (mStateMachine != null) {
if (dispatchEvent(eventStr)) { if (dispatchEvent(eventStr)) {