mirror of https://github.com/BOINC/boinc.git
Merge branch 'master' of ssh://boinc.berkeley.edu/boinc
Conflicts: client/hostinfo_unix.cpp
This commit is contained in:
commit
eb79b9e78b
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue