Bläddra i källkod

WalledCheckCache: use current epoch instead of millis since boot to avoid problems on reboot

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Álvaro Brey 2 år sedan
förälder
incheckning
b32ea65774
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      app/src/main/java/com/nextcloud/client/network/WalledCheckCache.kt

+ 2 - 2
app/src/main/java/com/nextcloud/client/network/WalledCheckCache.kt

@@ -36,7 +36,7 @@ class WalledCheckCache @Inject constructor(private val clock: Clock) {
         return when (val timestamp = cachedEntry?.first) {
             null -> true
             else -> {
-                val diff = clock.millisSinceBoot - timestamp
+                val diff = clock.currentTime - timestamp
                 diff >= CACHE_TIME_MS
             }
         }
@@ -44,7 +44,7 @@ class WalledCheckCache @Inject constructor(private val clock: Clock) {
 
     @Synchronized
     fun setValue(isWalled: Boolean) {
-        this.cachedEntry = Pair(clock.millisSinceBoot, isWalled)
+        this.cachedEntry = Pair(clock.currentTime, isWalled)
     }
 
     @Synchronized