From 24333d1882c01550ba84a5fdb054c05f126a4378 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 18 Apr 2025 19:13:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xypower/mpapp/MicroPhotoService.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java b/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java index 8fd4e567..caa76aa3 100644 --- a/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java +++ b/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java @@ -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());