diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index 46066dfc7a..2a5e5ca214 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -33,6 +33,7 @@ #endif #endif +#include "common_defs.h" #include "filesys.h" #include "parse.h" #include "str_util.h" @@ -290,11 +291,11 @@ int CLIENT_STATE::check_suspend_processing() { if (cp >= 0) { if (cp < 90) { hyst_state = true; - return SUSPEND_REASON_BATTERY_CHARGE; + return SUSPEND_REASON_BATTERY_CHARGING; } if (cp < 95) { if (hyst_state) { - return SUSPEND_REASON_BATTERY_CHARGE; + return SUSPEND_REASON_BATTERY_CHARGING; } } else { hyst_state = false; diff --git a/client/hostinfo_network.cpp b/client/hostinfo_network.cpp index 0ff7e1d474..8ad1e5b915 100644 --- a/client/hostinfo_network.cpp +++ b/client/hostinfo_network.cpp @@ -63,20 +63,15 @@ // if value cant be read, default return false // bool HOST_INFO::host_wifi_online() { - char wifipath_pri[1024]; - snprintf(wifipath_pri, sizeof(wifipath_pri), - char wifipath_sec[1024]; - snprintf(wifipath_sec, sizeof(wifipath_sec), - - FILE *f = fopen("/sys/class/net/eth0/operstate", "r"); - // location in Android 2.3 - if (!fsyswifi) { - fsyswifi = fopen("/sys/class/net/wlan0/operstate", "r"); - // location in Android 4 - } - char wifi_state[64]; + // location in Android 2.3 + FILE *f = fopen("/sys/class/net/eth0/operstate", "r"); + if (!f) { + // location in Android 4 + f = fopen("/sys/class/net/wlan0/operstate", "r"); + } + if (f) { fgets(wifi_state, 64, f); fclose(f); @@ -85,7 +80,7 @@ bool HOST_INFO::host_wifi_online() { return false; } - if (strstr(wifi_state,"up"))) { + if (strstr(wifi_state,"up")) { return true; } return false; diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index dbd1079ab6..83d1946259 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -468,11 +468,13 @@ void HOST_INFO::get_battery_status() { if (fcap) { rewind(fcap); fscanf(fcap, "%d", &battery_charge_pct); + snprintf(msg, sizeof(msg), + "battery capacity at: %d%% charge", + battery_charge_pct + ); + LOGD(msg); } - snprintf(msg, sizeof(msg), "battery capacity at: %d%% charge", capacity); - LOGD(msg); - char health[256]; char status[256]; strcpy(health, ""); @@ -491,7 +493,7 @@ void HOST_INFO::get_battery_status() { battery_state = BATTERY_STATE_UNKNOWN; if (strstr(health, "Overheat")) { LOGD("battery is overheating"); - battery_state = BATTERY_STATE_OVERHEAT; + battery_state = BATTERY_STATE_OVERHEATED; } else if (strstr(status, "Not charging")) { LOGD("battery is discharging"); battery_state = BATTERY_STATE_DISCHARGING; diff --git a/lib/common_defs.h b/lib/common_defs.h index 90474f7f16..c5bf00f844 100644 --- a/lib/common_defs.h +++ b/lib/common_defs.h @@ -118,7 +118,7 @@ enum BATTERY_STATE { BATTERY_STATE_DISCHARGING, BATTERY_STATE_CHARGING, BATTERY_STATE_FULL, - BATTERY_STATE_OVERHEAT + BATTERY_STATE_OVERHEATED }; // Values of RESULT::state in client. diff --git a/win_build/installerv2/redist/Windows/Win32/boinccas.dll b/win_build/installerv2/redist/Windows/Win32/boinccas.dll index 207d632eb9..00cc32f68c 100644 Binary files a/win_build/installerv2/redist/Windows/Win32/boinccas.dll and b/win_build/installerv2/redist/Windows/Win32/boinccas.dll differ diff --git a/win_build/installerv2/redist/Windows/Win32/boinccas95.dll b/win_build/installerv2/redist/Windows/Win32/boinccas95.dll index 6b601f9151..45d44aed70 100644 Binary files a/win_build/installerv2/redist/Windows/Win32/boinccas95.dll and b/win_build/installerv2/redist/Windows/Win32/boinccas95.dll differ diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CACreateBOINCAccounts.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CACreateBOINCAccounts.cpp index 73a9e2ed7e..af077f0b06 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CACreateBOINCAccounts.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CACreateBOINCAccounts.cpp @@ -97,7 +97,7 @@ UINT CACreateBOINCAccounts::OnExecution() uiReturnValue = GetProperty( _T("MsiNTProductType"), strProductType ); if ( uiReturnValue ) return uiReturnValue; - uiReturnValue = GetProperty( _T("ENABLEPROTECTEDAPPLICATIONEXECUTION2"), strEnableProtectedApplicationExecution ); + uiReturnValue = GetProperty( _T("ENABLEPROTECTEDAPPLICATIONEXECUTION3"), strEnableProtectedApplicationExecution ); if ( uiReturnValue ) return uiReturnValue; diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CACreateBOINCGroups.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CACreateBOINCGroups.cpp index 3db02a19be..88f2836d59 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CACreateBOINCGroups.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CACreateBOINCGroups.cpp @@ -92,7 +92,7 @@ UINT CACreateBOINCGroups::OnExecution() uiReturnValue = GetProperty( _T("BOINC_PROJECT_USERNAME"), strBOINCProjectAccountUsername ); if ( uiReturnValue ) return uiReturnValue; - uiReturnValue = GetProperty( _T("ENABLEPROTECTEDAPPLICATIONEXECUTION2"), strEnableProtectedApplicationExecution ); + uiReturnValue = GetProperty( _T("ENABLEPROTECTEDAPPLICATIONEXECUTION3"), strEnableProtectedApplicationExecution ); if ( uiReturnValue ) return uiReturnValue; diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CACreateClientAuthFile.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CACreateClientAuthFile.cpp index d0653e255e..35452e3b38 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CACreateClientAuthFile.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CACreateClientAuthFile.cpp @@ -75,7 +75,7 @@ UINT CACreateClientAuthFile::OnExecution() uiReturnValue = GetProperty( _T("DATADIR"), strDataDirectory ); if ( uiReturnValue ) return uiReturnValue; - uiReturnValue = GetProperty( _T("ENABLEPROTECTEDAPPLICATIONEXECUTION2"), strEnableProtectedApplicationExecution ); + uiReturnValue = GetProperty( _T("ENABLEPROTECTEDAPPLICATIONEXECUTION3"), strEnableProtectedApplicationExecution ); if ( uiReturnValue ) return uiReturnValue; uiReturnValue = GetProperty( _T("BOINC_PROJECT_ISUSERNAME"), strBOINCProjectAccountUsername ); diff --git a/win_build/installerv2/redist/Windows/x64/boinccas.dll b/win_build/installerv2/redist/Windows/x64/boinccas.dll index 48076512ef..5a0f1c77c9 100644 Binary files a/win_build/installerv2/redist/Windows/x64/boinccas.dll and b/win_build/installerv2/redist/Windows/x64/boinccas.dll differ diff --git a/win_build/installerv2/redist/Windows/x64/boinccas95.dll b/win_build/installerv2/redist/Windows/x64/boinccas95.dll index 2788842d05..f9ae4f222e 100644 Binary files a/win_build/installerv2/redist/Windows/x64/boinccas95.dll and b/win_build/installerv2/redist/Windows/x64/boinccas95.dll differ