优化逻辑

lowmem
Matthew 2 months ago
parent 04abdbeb61
commit 24333d1882

@ -507,15 +507,13 @@ public class MicroPhotoService extends Service {
}
// Register Next Photo Timer
long startTime = (System.currentTimeMillis() + 999) / 1000 + 1;
if (ts != 0 && (startTime - ts) < 86400) {
// Ts != 0 means schedule time
// if ts is not during a day, the time is wrong, just use current system time
// if ts is valid schedule time, will use next time point
Log.e(TAG, "Current Photo Timer(" + ts + ") is wrong and use current system time");
startTime = ts + 1;
long startTime = System.currentTimeMillis() / 1000;
if (startTime < ts) {
// if current time is earlier schedule time
// we will register schedule time after ts
startTime = ts;
}
mService.updateCaptureSchedule(startTime);
mService.updateCaptureSchedule(startTime + 1);
} else if (TextUtils.equals(ACTION_HEARTBEAT_MANUALLY, action)) {
Log.i(TAG, "HB Timer Fired ACTION=" + action);
mService.sendHeartbeat(mService.mNativeHandle, mService.getSignalLevel());

Loading…
Cancel
Save