WifiScanAlarmBroadcastReceiver.wifi = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
if (!PPApplication.getApplicationStarted(context, true))
return;
PPApplication.loadPreferences(context);
int wifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, 0);
<BUG>if (PPApplication.getGlobalEventsRuning(context))
{</BUG>
PPApplication.logE("$$$ WifiStateChangedBroadcastReceiver.onReceive","state="+wifiState);
if ((wifiState == WifiManager.WIFI_STATE_ENABLED) || (wifiState == WifiManager.WIFI_STATE_DISABLED))
{

WifiScanAlarmBroadcastReceiver.wifi = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
if (!PPApplication.getApplicationStarted(context, true))
return;
PPApplication.loadPreferences(context);
int wifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, 0);
int forceOneScan = PPApplication.getForceOneWifiScan(context);
PPApplication.logE("$$$ WifiStateChangedBroadcastReceiver.onReceive", "forceOneScan="+forceOneScan);
if (PPApplication.getGlobalEventsRuning(context) || (forceOneScan == PPApplication.FORCE_ONE_SCAN_FROM_PREF_DIALOG))
{
PPApplication.logE("$$$ WifiStateChangedBroadcastReceiver.onReceive","state="+wifiState);
if ((wifiState == WifiManager.WIFI_STATE_ENABLED) || (wifiState == WifiManager.WIFI_STATE_DISABLED))
{
