diff --git a/android/BOINC/src/edu/berkeley/boinc/client/Monitor.java b/android/BOINC/src/edu/berkeley/boinc/client/Monitor.java index 07bbbf342b..cebc8ea0bf 100644 --- a/android/BOINC/src/edu/berkeley/boinc/client/Monitor.java +++ b/android/BOINC/src/edu/berkeley/boinc/client/Monitor.java @@ -49,7 +49,6 @@ import android.os.Binder; import android.os.Build; import android.os.IBinder; import android.os.PowerManager; -import android.os.PowerManager.WakeLock; import android.util.Log; import edu.berkeley.boinc.AppPreferences; import edu.berkeley.boinc.R; @@ -107,13 +106,6 @@ public class Monitor extends Service { private Boolean clientSetup() { if(Logging.DEBUG) Log.d(Logging.TAG,"Monitor.clientSetup()"); - // initialize full wakelock. - // gets used if client has to be started from scratch - PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); - WakeLock setupWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, Logging.TAG); - // do not acquire here, otherwise screen turns on, every time rpc connection - // gets reconnected. - // try to get current client status from monitor ClientStatus status; try{ @@ -172,14 +164,8 @@ public class Monitor extends Service { Integer clientPid = getPidForProcessName(clientProcessName); if(clientPid == null) { if(Logging.DEBUG) Log.d(Logging.TAG, "Starting the BOINC client"); - // wake up device and acquire full WakeLock here to allow BOINC client to detect - // all available CPU cores if not acquired and device in power saving mode, client - // might detect fewer CPU cores than available. - // Lock needs to be release, before return! - setupWakeLock.acquire(); if (!runClient()) { if(Logging.DEBUG) Log.d(Logging.TAG, "BOINC client failed to start"); - setupWakeLock.release(); return false; } } @@ -223,9 +209,6 @@ public class Monitor extends Service { status.setSetupStatus(ClientStatus.SETUP_STATUS_ERROR,true); } - try{ - setupWakeLock.release(); // throws exception if it has not been acquired before - } catch(Exception e){} return connected; } diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index d6745e9f6f..a88c855d1a 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -1347,7 +1347,9 @@ int HOST_INFO::get_host_info() { ///////////// p_ncpus ///////////////// // sysconf not working on OS2 -#if defined(_SC_NPROCESSORS_ONLN) && !defined(__EMX__) && !defined(__APPLE__) +#if defined(ANDROID) + p_ncpus = sysconf(_SC_NPROCESSORS_CONF); +#elif defined(_SC_NPROCESSORS_ONLN) && !defined(__EMX__) && !defined(__APPLE__) p_ncpus = sysconf(_SC_NPROCESSORS_ONLN); #elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && defined(HW_NCPU) // Get number of CPUs