Skip to content

HomeKey TV v1.8.0

Latest

Choose a tag to compare

@leonida92 leonida92 released this 16 Oct 10:55

Security & Storage Architecture

  • AndroidX DataStore Migration: Migrated user preferences, entity orderings, theme presets, and remap configurations from synchronous SharedPreferences to asynchronous, non-blocking AndroidX DataStore with atomic transactions.
  • Google Tink Keystore Encryption: Sensitive Home Assistant Long-Lived Access Tokens and credentials are encrypted using Google Tink AES256-GCM backed by the Android hardware Keystore, with automatic migration from legacy storage.
  • Atomic Backup & Restore: Preferences backup and restore now performs single-transaction atomic DataStore edits, preventing concurrent multi-thread disk race conditions.

Network & Streaming Performance

  • High-Performance MJPEG Stream Engine: Replaced byte-by-byte network parsing with an 8KB chunk buffer scanner in CameraDialog and CameraPipCard, slashing TV CPU cycles by up to 50x and enforcing a 5MB payload ceiling to eliminate memory churn and OutOfMemory errors.
  • Cancellable Coroutine Network Calls: Wrapped OkHttp blocking network calls in cancellable coroutine suspension bridges that immediately invoke call.cancel() when closed, preventing background thread starvation on stalled camera feeds.
  • Diff-Based Entity State Processing: Implemented HAEntityDiffProcessor for Home Assistant WebSocket entity subscriptions, applying granular delta diffs instead of re-parsing the entire entity dictionary on every update.

Android TV Overlay & Window System Hardening

  • WindowContext Compliance (Android 11+): Created visual views and WindowManager overlays on API 30+ using dedicated createWindowContext(TYPE_APPLICATION_OVERLAY, null) tokens, eliminating IncorrectContextUseViolation strict-mode errors and display density loss.
  • Picture-in-Picture Lifecycle Management: Added auto-dismiss countdown timers and explicit view tree release on PiP alert dismissal to prevent memory retention of ComposeView trees.
  • Native Focus Highlight Silencing: Disabled Android TV default system focus highlights on the overlay FrameLayout and ComposeView, routing initial focus directly into Compose without full-screen outline flashes.
  • Focus Pulse Elimination: Removed redundant delayed focus requests from LazyRow and LazyColumn containers, ensuring instant, static highlight placement on the first button without visual jitter.

Remote Button Remapping & Input Optimization

  • Two-Tier KeyCode Remap Cache: Sub-millisecond unboxed SparseArray lookup cache for physical TV button events with app-specific foreground package scoping.
  • Hardware Anti-Chatter & Debounce: Added multi-layer contact bounce rejection (250ms single-action threshold, 80ms multi-action window, and 350ms dock toggle cooldown) to prevent switch bounce and dual-code aliasing (KeyCode 313 / 225) from rapidly toggling the overlay.
  • Transient Window Package Protection: RemoteButtonRemapService now ignores internal com.homekey.tv and com.android.systemui window state changes, preserving app-scoped mappings when volume or overlay menus open.