Split WifiStateMachine from WifiStateTracker
Notifications handled in WifiService. WifiStateTracker tracks state for connectivity service Change-Id: Idb0cf494898d28712af0f95f9e60c5417cd4a053
This commit is contained in:
@@ -314,14 +314,14 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
case ConnectivityManager.TYPE_WIFI:
|
||||
if (DBG) Slog.v(TAG, "Starting Wifi Service.");
|
||||
WifiStateTracker wst = new WifiStateTracker(context, mHandler);
|
||||
WifiService wifiService = new WifiService(context, wst);
|
||||
WifiService wifiService = new WifiService(context);
|
||||
ServiceManager.addService(Context.WIFI_SERVICE, wifiService);
|
||||
wifiService.startWifi();
|
||||
wifiService.checkAndStartWifi();
|
||||
mNetTrackers[ConnectivityManager.TYPE_WIFI] = wst;
|
||||
wst.startMonitoring();
|
||||
|
||||
//TODO: as part of WWS refactor, create only when needed
|
||||
mWifiWatchdogService = new WifiWatchdogService(context, wst);
|
||||
mWifiWatchdogService = new WifiWatchdogService(context);
|
||||
|
||||
break;
|
||||
case ConnectivityManager.TYPE_MOBILE:
|
||||
@@ -1205,16 +1205,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
sendConnectedBroadcast(info);
|
||||
}
|
||||
|
||||
private void handleScanResultsAvailable(NetworkInfo info) {
|
||||
int networkType = info.getType();
|
||||
if (networkType != ConnectivityManager.TYPE_WIFI) {
|
||||
if (DBG) Slog.v(TAG, "Got ScanResultsAvailable for " +
|
||||
info.getTypeName() + " network. Don't know how to handle.");
|
||||
}
|
||||
|
||||
mNetTrackers[networkType].interpretScanResultsAvailable();
|
||||
}
|
||||
|
||||
private void handleNotificationChange(boolean visible, int id,
|
||||
Notification notification) {
|
||||
NotificationManager notificationManager = (NotificationManager) mContext
|
||||
@@ -1619,11 +1609,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
}
|
||||
break;
|
||||
|
||||
case NetworkStateTracker.EVENT_SCAN_RESULTS_AVAILABLE:
|
||||
info = (NetworkInfo) msg.obj;
|
||||
handleScanResultsAvailable(info);
|
||||
break;
|
||||
|
||||
case NetworkStateTracker.EVENT_NOTIFICATION_CHANGED:
|
||||
handleNotificationChange(msg.arg1 == 1, msg.arg2,
|
||||
(Notification) msg.obj);
|
||||
|
||||
Reference in New Issue
Block a user