Skip to content

Start on boot: an opt-in setting for boxes without a firmware autorun #255

Closed

Description

@compot-dev

Problem

A box that only shows cameras (a wall display, a demo stand) should open Decoder by itself after power-on or a reboot. Today someone has to start it with the remote every time.

Some TV-box firmwares already have this: their app list has a per-app menu (Menu key on a tile) with AUTORUN / CLEAN AUTORUN, and a boot receiver of the firmware starts the chosen app. It works with Decoder as it is (checked on the Aceline box: Decoder comes up ~60 s after boot). Many firmwares and phones have nothing like it, and Decoder itself has no way to start on boot.

Proposal

An opt-in Start on boot setting in Decoder, off by default:

  1. A BOOT_COMPLETED receiver (RECEIVE_BOOT_COMPLETED permission). When the setting is on, it opens Decoder with the saved slots and view (grid, U cell, slides) as on a normal start.
  2. Android 10+ blocks activity starts from the background. The documented exception is an app allowed to draw over other apps (SYSTEM_ALERT_WINDOW). When the user turns the setting on and the app lacks it, Decoder opens the system "Display over other apps" screen; where the firmware has no such screen (many TV boxes), it shows the one-line adb command instead:
    adb shell appops set com.openipc.decoder SYSTEM_ALERT_WINDOW allow
  3. The checkbox lives in Settings. The menu grid keeps its shape (Menu as an 8 / 4 / 4 grid with words: slots on top, Settings WebUI Grid Slides, Exit Reset Debug UDP #177).
  4. /stats.json reports the setting and whether the permission is granted, so a box can be checked remotely.
  5. README (all three languages): a short "Start on boot" section — use the firmware's own autorun where there is one, otherwise this setting.

Out of scope

  • Making Decoder the home screen (a HOME category). It is a stronger lock-in and needs the user to pick the default launcher; a separate issue if needed.
  • Waking the box from standby: that is up to the firmware and its boot loader.

Test

  • A box without a firmware autorun and a phone: setting on → reboot → Decoder opens by itself with the saved view; setting off → it does not.
  • Android 10+ without the overlay permission: the hint appears, nothing crashes on boot.
  • A box with a firmware autorun: no double start when both are on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions