优化拍照时间的注册处理,避免始时钟丢失校时成功之后的错误

lowmem
Matthew 2 months ago
parent 7ad52b042c
commit 4106ce8cb3

@ -507,7 +507,14 @@ public class MicroPhotoService extends Service {
} }
// Register Next Photo Timer // Register Next Photo Timer
long startTime = (ts == 0) ? (((new Date()).getTime() + 999) / 1000 + 1) : (ts + 1); // Add one second 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;
}
mService.updateCaptureSchedule(startTime); mService.updateCaptureSchedule(startTime);
} else if (TextUtils.equals(ACTION_HEARTBEAT_MANUALLY, action)) { } else if (TextUtils.equals(ACTION_HEARTBEAT_MANUALLY, action)) {
Log.i(TAG, "HB Timer Fired ACTION=" + action); Log.i(TAG, "HB Timer Fired ACTION=" + action);

Loading…
Cancel
Save