Skip to content

Releases: leonida92/HomeKeyTV

HomeKey TV v1.8.0

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.

HomeKey TV v1.7.0

Choose a tag to compare

@leonida92 leonida92 released this 09 Oct 22:45

Fix Remote Navigation Double-Input Glitch

  • Eliminated Accessibility Input Filter Dual-Dispatch: Fixed a race condition where rapid, concurrent Secure Settings wipes during service initialization caused Android's AccessibilityManagerService to maintain both an active binding and a crashed service connection, resulting in doubled D-pad remote inputs across the entire OS.
  • Early Return in Secure Settings Write: tryEnableViaSecureSettings() now checks whether the service is already listed in enabled_accessibility_services and exits immediately without tearing down the existing binder connection.

Stable Key Filtering & Native Pass-Through

  • Removed Runtime Filter Flag Flapping: Eliminated dynamic mutations of FLAG_REQUEST_FILTER_KEY_EVENTS via setServiceInfo() in RemoteButtonRemapService. Key events that should not be intercepted (including unmapped volume and navigation keys) now pass through natively by returning false in onKeyEvent(), preventing system-level input filter rebuilds and queue desynchronization.
  • Clean Volume Hold Engine: Retained the active software volume repeat generator for devices with suppressed hold repeats without disturbing system key filtering state.

Package Replacement & Startup Hardening

  • Package Update Grace Period: Added an initial delay in PackageReplacedReceiver so Android OS can complete its native accessibility service rebinding without interference after an APK update.
  • Eliminated Redundant Cold Boot Writes: Removed eager tryEnableViaSecureSettings() invocations from Application.onCreate() that raced against system service startup.
  • Window Token Attachment Buffer: Postponed DockOverlayManager prewarming by 500ms to guarantee WindowManager token readiness and avoid BadTokenException on cold connection.

HomeKey TV v1.6.9

Choose a tag to compare

@leonida92 leonida92 released this 09 Oct 22:27

Remote Volume Long-Press Repeat Generator

  • Active Volume Hold Engine: On devices like Xiaomi TV running Android 9 where the remote hardware or vendor OS intercepts or drops volume key repeat events when an accessibility service is active, HomeKey TV now generates continuous volume adjustments via AudioManager after a 350ms hold delay at 90ms intervals.
  • Unmapped Pass-Through Fix: Resolved fast-path bypass so both unmapped volume keys and custom-mapped volume button actions dispatch accurately and without conflicts.

Interactive TV D-pad Brightness Dialog

  • D-pad Focusable Slider: Replaced static touch slider in BrightnessDialog with a fully focusable D-pad control supporting Left and Right key steps (5% adjustment per click).
  • Visual & Audio Feedback: Integrated active scale animation, highlighted cyan border, and direct bidirectional navigation linking the brightness slider to Close and Quick Preset buttons.

Code Quality and Performance Improvements

  • High-Speed QR Generation: Replaced per-pixel JNI loop in QRCodeGenerator with a single bulk bitmap.setPixels() invocation.
  • Camera Stream Resource Optimization: Reused a shared singleton OkHttpClient in CameraDialog instead of creating new instances during dialog display.
  • Network Interface Detection: Prioritized physical Ethernet and Wi-Fi adapters over virtual/VPN tunnel interfaces in NetworkUtils.
  • Dead Code Elimination: Removed obsolete unused EntityCard component and cleaned up Compose parameter declarations.

HomeKey TV v1.6.8

Choose a tag to compare

@leonida92 leonida92 released this 30 Sep 17:56

Button Remap UI & Navigation Overhaul

  • Inline Volume Fix Compact Toggle: Moved the Xiaomi / Android 9 volume repeat toggle into an inline pill toggle within the Accessibility Status Card header, freeing vertical real estate and preventing clipping of the Remote Buttons card and preset options.
  • Symmetrical D-pad Navigation: Entering Tab 3 directs focus immediately to the left column (Learn Remote Button or Accessibility Setup) rather than jumping to the right column; UP navigates through Volume Fix to Tab 3; RIGHT transitions smoothly to the configured remaps list; LEFT from any configured remap card returns focus directly to Learn Remote Button; UP from the top remap returns to Tab 3.

Compact Recent Apps Settings Card

  • Single-Row Design: Squeezed RecentAppsToggleCard into a slim single-row card (height reduced from 160dp to 46dp), saving over 110dp of vertical space so an extra full row of installed apps is visible in the grid without scrolling.
  • Inline Limit Chips: Sized limit chips to 34x28dp with 12sp font and horizontal expand/collapse animation.
  • Fluid D-pad Navigation: Tab 4 DOWN moves directly to Toggle; DOWN from Toggle enters the apps grid; RIGHT enters limit chips (1..5); LEFT returns to Toggle; UP from top apps row returns to Toggle.

HomeKey TV v1.6.7

Choose a tag to compare

@leonida92 leonida92 released this 30 Sep 16:58

HomeKey TV v1.6.7

What's New & Fixed

  • Dynamic Accessibility Key Filtering:

    • Automatically manages AccessibilityServiceInfo.FLAG_REQUEST_FILTER_KEY_EVENTS at runtime.
    • When no button remaps are configured and Learn Mode is inactive, key filtering is completely detached from the Android framework.
    • Eliminates Binder IPC round-trips for remote key navigation across the entire TV UI, resulting in 0ms added latency and zero system-level interference when remapping is not in use.
  • Volume Buttons Fix (Xiaomi & Android 9 / Pie TV Compatibility):

    • Resolves the AOSP / PatchWall hardware key repeat bug on Android 9 devices (such as Xiaomi Mi TV).
    • When unmapped volume buttons (Volume Up, Volume Down, Mute) are pressed, key filtering is temporarily suspended for 3.5 seconds.
    • Allows the TV's native PhoneWindowManager to process the hardware key repeat stream directly, restoring continuous volume ramping when holding buttons down.
    • Restores native HDMI-CEC soundbar volume control and prevents stream hijacking to STREAM_ACCESSIBILITY.
    • Automatically re-engages key filtering 3.5 seconds after volume adjustment stops.
  • Volume Fix Setting & Auto-Detection:

    • Added Volume Buttons Fix (Android 9 / Xiaomi) toggle in the Button Remap settings tab.
    • Defaults to enabled on Android 9 and older (API <= 28), and disabled on modern Android 10+ devices.
    • Can be toggled manually at any time in TV Settings.
  • Documentation:

    • Added comprehensive PROJECT_STATE.md capturing current architecture, feature matrix, design decisions, and future roadmap.

HomeKey TV v1.6.6

Choose a tag to compare

@leonida92 leonida92 released this 13 Sep 23:13

HomeKey TV v1.6.6

What's New & Fixed

  • Theme Presets & Domain Color Palettes:

    • Added 5 built-in theme presets: HomeKey Classic, Cupertino Glow (Apple HomeKit warm glow), Cyberpunk Neon (high-contrast electric neon), Nordic Calm (minimal earth tones), and Monochrome Luxe (high-contrast OLED white and platinum).
    • Added full Custom Palette mode to customize domain colors individually.
    • Dedicated domain color for camera feeds with automatic detection for online cameras reporting idle, streaming, or recording states.
    • Added customization for Off-State Background and Active Icon Color with luminance-based contrast adaptation to prevent icons disappearing into matching backgrounds.
    • Full synchronization between TV interface, PreferencesManager, and local Web Setup Server (Port 8124).
  • Borderless Idle Styling:

    • Removed idle borders across all dock tiles (DockTile, DockReorderTile, DockSettingsTile). Tiles remain cleanly borderless when unfocused, displaying a crisp highlight border only when focused or reordering.
    • Removed active blue border from the main dock button when an entity popup is open, keeping the open tile borderless while other tiles dim.
    • Removed outer container borders from all popups and dialogs (BrightnessDialog, SwitchDialog, ClimateDialog, MediaPlayerDialog, CameraDialog, and MinimalEntityPopups).
    • Removed idle borders from internal popup buttons, chips, and controls.
  • TV Color Picker & Navigation Fixes:

    • Trapped D-Pad UP navigation in the Choose Color dialog to prevent focus from escaping to the parent Settings tab bar.
    • Removed nested clickable focus containers so pressing Back dismisses the color picker in exactly 1 press.
    • Restored focus directly to the clicked domain card upon dismissal or color selection.
    • Pre-focused the current domain color swatch upon dialog opening.
  • Web Setup Enhancements:

    • Added collapsible card sections for clean navigation on mobile screens.
    • Added interactive theme preset cards with swatch previews and native color pickers for all 12 domains.

HomeKey TV v1.6.3

Choose a tag to compare

@leonida92 leonida92 released this 13 Sep 22:09

HomeKey TV v1.6.3

What's New & Fixed

  • Fixed Dock Icon Mismatches:

    • ac (Air Conditioner): Fixed missing exact match in computeDockIcon where ac fell through to domain fallback.
    • socket (Power Socket): Corrected from power plug (Power) to wall electrical outlet (Outlet).
    • strip (LED Strip): Corrected from highlighter marker pen (Highlight) to horizontal tube fixture (Fluorescent).
    • spotlight: Corrected from highlighter marker pen (Highlight) to direct light beam (FlashOn).
    • ceiling_light: Added dedicated mapping to ceiling lamp fixture (Light).
    • lamp: Mapped to vintage incandescent desk lamp (WbIncandescent).
    • vacuum: Mapped to robot vector (SmartToy).
    • heater: Mapped from firefighter badge (LocalFireDepartment) to flame (Whatshot).
    • kitchen: Mapped from knife and fork (Restaurant) to kitchen refrigerator (Kitchen).
    • coffee: Mapped to coffee maker machine (CoffeeMaker).
    • doorbell: Fixed substring collision where doorbell was matched as door.
    • headphones: Fixed substring collision where headphones was matched as phone.
    • electric_car: Fixed substring collision where electric_car was matched as bolt.
  • Expanded Smart Home Icon Gallery:

    • Expanded ICON_GALLERY on the web setup page to 78 icons across 11 categories (Lighting, Rooms & Furniture, Climate & Air, Doors & Covers, Security & Access, Power & Energy, Appliances, Media & Audio, Vehicles, Outdoor & Garden, Sensors & Automations).
    • All icons redesigned with uniform stroke SVG syntax for clean rendering in browser.
  • Automated Verification:

    • Added unit test testIconGalleryDockMapping verifying that all 78 icon IDs map 1:1 to their corresponding Compose ImageVectors.

HomeKey TV v1.6.2

Choose a tag to compare

@leonida92 leonida92 released this 13 Sep 19:50

HomeKey TV v1.6.2 Release Notes

New Features & Improvements

Home Assistant Integration Toggle & Resource Optimization

  • Enable Home Assistant Integration Switch: Added a dedicated toggle in Settings > Phone Setup tab allowing users without Home Assistant (or those wanting an apps-only dock) to disable HA integration with a single click.
  • Resource & Performance Optimization: When HA integration is disabled, the local web setup server (port 8124) is stopped completely so no background port is listening and no webpage is streamed. The Home Assistant WebSocket client is disconnected to eliminate background CPU and network activity.
  • Dock Entity Filtering: Pinned HA entities are dynamically hidden from the dock when the integration is toggled off, leaving only pinned apps and/or the recent apps satellite dock.
  • Contextual Phone Setup UI: The QR code, setup URL, and pairing PIN are hidden when integration is disabled, replaced with an informative status card. The Settings header connection status indicator displays "Disabled".
  • Direct Settings Launch: Made SettingsActivity exported for direct launch from Android TV system settings or launchers.

Bug Fixes

Recent Apps Focus Scaling Clipping Fix

  • Smooth Expansion: Fixed an issue where focused app icons in the recent apps satellite row (e.g., YouTube) were clipped flat along rectangular box boundaries when expanding to 1.15x focus scale.
  • RenderNode Clipping Removal: Removed unconditional Modifier.blur on the satellite container which previously enforced rectangular RenderNode clipping even at 0.dp.
  • Headroom Padding: Added internal padding to satellite containers and offset outer dock spacings to allow full, unclipped focus enlargement while preserving exact visual dock alignment.

HomeKey TV v1.6.1

Choose a tag to compare

@leonida92 leonida92 released this 13 Sep 19:12

HomeKey TV v1.6.1 Release Notes

Bug Fixes & Layout Improvements

Dock Position Stability During Active Popups

  • Fixed Layout Shift: Resolved an issue where opening an entity dialog popup (e.g. brightness slider, climate, switches, media player) while recent apps was enabled caused the dock, the highlighted icon, and the popup to jump downward by 56dp to the un-elevated dock position.
  • Persistent Recent Apps Layout: The recent apps satellite row now remains rendered in the bottom column while popups are active, keeping the dock capsule and popup stable at their exact vertical positions.
  • Unified Background Dimming & Blur: The recent apps satellite row smoothly animates its opacity to 0.22f and blurs by 6.dp when a dialog is active, visually matching the unselected background dock tiles.
  • Focus Isolation: Focus and click interactions on recent apps circular items and the settings shortcut are disabled while dialogs are open, preventing focus escape from active popup dialog controls.
  • Side Dock Collision Prevention: Maintained collision prevention in Left and Right dock layouts by hiding the satellite column while horizontal dialogs are open without affecting the independently centered vertical dock.

HomeKey TV v1.6.0

Choose a tag to compare

@leonida92 leonida92 released this 13 Sep 16:32

HomeKey TV v1.6.0 Release Notes

Recent Apps Satellite Dock

  • Display up to 5 recently opened Android TV apps as circular icons directly adjacent to the dock.
  • Configurable recent apps count (1 to 5) directly in Settings > Installed Apps tab.
  • Smooth bidirectional D-pad navigation:
    • Bottom Dock: press DPAD DOWN to move into the recent apps satellite row, and DPAD UP to return to the primary dock.
    • Side Docks (Left / Right): vertically centered satellite column accessible via D-pad navigation.
  • Full-bleed circular app icons with a smooth 1.15x scale focus animation.

Clean Empty Dock States & Standalone Settings

  • When no entities are pinned and Recent Apps is enabled, the dock displays only recent apps along with a matching circular Settings shortcut.
  • When no entities are pinned and Recent Apps is disabled, shows a clean "Configure from settings" card (eliminating the arbitrary 12-entity fallback).

Smart Reorder Visibility & Side Dock Inset Badges

  • Reorder button is automatically hidden when 1 or fewer items are pinned in the dock, keeping the interface uncluttered.
  • In Side Dock positions (Left / Right), entity text badges are positioned at the top and inset horizontally to avoid overlapping tall vertical dock icon stacks.

Package Standardization

  • Standardized package namespace across all codebase files to com.homekey.tv.