OpenSeizureDetector / Android_Pebble_SD

The main OpenSeizureDetector Android App, that is published on the Android Play Store.
http://openseizuredetector.org.uk
GNU General Public License v3.0
9 stars 11 forks source link

Aquiring Wakelock #81

Open AroonPro opened 1 year ago

AroonPro commented 1 year ago

For the good practice: SdServer must be project wide be updated

// Apply the wake-lock to prevent CPU sleeping (very battery intensive!) if (Objects.nonNull(mWakeLock)) { if (!mWakeLock.isHeld()) { mWakeLock.acquire(24 60 60 1000L /1 day*/); Log.v(TAG, "Applied Wake Lock to prevent device sleeping");

            } else Log.v(TAG, "onStartCommand(): lock already held");
            mUtil.writeToSysLogFile("SdServer.onStartCommand() - applying wake lock");
        } else {
            Log.d(TAG, "mmm...mWakeLock is null, so not aquiring lock.  This shouldn't happen!");
            mUtil.writeToSysLogFile("SdServer.onStartCommand() - mWakeLock is not null - this shouldn't happen???");
        }

I will reintroduce this code into the upstream