From cb93da6644da8ffd67089be445842329f2c6b641 Mon Sep 17 00:00:00 2001 From: Pauljd Date: Fri, 6 Nov 2026 13:42:11 +0000 Subject: [PATCH] The first frame no longer waits for the saved sign-in to open (0.108.56) 0.108.55's start on the box: Displayed +6.4 s, from 2.1 s. The screen asks the store for a ticket as it first draws, and ticket() shared the lock that the background open holds. The generation is now volatile and read without the lock. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../main/java/tv/orbit/classic/RememberedConnectionStore.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/tv/orbit/classic/RememberedConnectionStore.kt b/android/app/src/main/java/tv/orbit/classic/RememberedConnectionStore.kt index 4a65956b..54cd9e06 100644 --- a/android/app/src/main/java/tv/orbit/classic/RememberedConnectionStore.kt +++ b/android/app/src/main/java/tv/orbit/classic/RememberedConnectionStore.kt @@ -40,8 +40,10 @@ internal class RememberedConnectionStore(path: File, private val alias: String, } @Synchronized fun invalidate() { generation++; lastRead = null } private val file = AtomicFile(path) - private var generation = 0L - @Synchronized fun ticket() = generation + // Read without the lock: the screen asks for a ticket as it first draws, and must not wait while the sign-in is opened in + // the background (that wait held Orbit's first frame back by four seconds on the box, 6 November 2026). + @Volatile private var generation = 0L + fun ticket() = generation private fun key(create: Boolean): SecretKey { val store = KeyStore.getInstance("AndroidKeyStore").apply { load(null) } (store.getKey(alias, null) as? SecretKey)?.let { return it }