mirror of
https://github.com/oxen-io/session-android.git
synced 2025-05-07 13:46:49 +00:00
Added a log so we can see when the version data is returned
This commit is contained in:
parent
42733c910d
commit
4b87e926c4
@ -8,11 +8,13 @@ import kotlinx.coroutines.Job
|
|||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.session.libsession.messaging.file_server.FileServerApi
|
import org.session.libsession.messaging.file_server.FileServerApi
|
||||||
import org.session.libsession.utilities.TextSecurePreferences
|
import org.session.libsession.utilities.TextSecurePreferences
|
||||||
|
import org.session.libsignal.utilities.Log
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class VersionUtil(
|
class VersionUtil(
|
||||||
private val prefs: TextSecurePreferences
|
private val prefs: TextSecurePreferences
|
||||||
) {
|
) {
|
||||||
|
private val TAG: String = VersionUtil::class.java.simpleName
|
||||||
private val FOUR_HOURS: Long = TimeUnit.HOURS.toMillis(4)
|
private val FOUR_HOURS: Long = TimeUnit.HOURS.toMillis(4)
|
||||||
|
|
||||||
private val handler = Handler(Looper.getMainLooper())
|
private val handler = Handler(Looper.getMainLooper())
|
||||||
@ -55,9 +57,11 @@ class VersionUtil(
|
|||||||
try {
|
try {
|
||||||
// perform the version check
|
// perform the version check
|
||||||
val clientVersion = FileServerApi.getClientVersion()
|
val clientVersion = FileServerApi.getClientVersion()
|
||||||
|
Log.i(TAG, "Fetched version data: $clientVersion")
|
||||||
prefs.setLastVersionCheck()
|
prefs.setLastVersionCheck()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
// we can silently ignore the error
|
// we can silently ignore the error
|
||||||
|
Log.e(TAG, "Error fetching version data: $e")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user