Files

EPG health check (read-only)

This utility monitors the failure signature that previously grew EpgDatabase.db to 1.62 GiB. It has no repair, delete, package-management or device-write function.

Live ADB mode

From the workspace root:

python .\tools\epg-health-check\health_check.py --serial <TV_IP>:5555

It executes exactly two allowlisted read-only commands:

adb -s <TV_IP>:5555 shell dumpsys dbinfo org.droidtv.channels -v
adb -s <TV_IP>:5555 shell df -k /data

This mode sees DB file size and /data capacity, not private row contents.

Offline snapshot mode

Use a consistent, already existing copy of EpgDatabase.db:

python .\tools\epg-health-check\health_check.py --snapshot C:\path\EpgDatabase.db

SQLite is opened with mode=ro&immutable=1 and PRAGMA query_only=ON. The tool reads schedule count, oldest/newest end time, freelist/page metadata and quick_check(1). Do not point immutable mode at a live, changing DB or a copy that is missing a required WAL; first obtain a transaction-consistent snapshot through an authorized maintenance procedure.

Empirical thresholds

These are conservative operational thresholds for this TV, not Android or Philips specifications:

Metric OK WARN MAINTENANCE_RECOMMENDED
DB size <64 MiB 64–255 MiB >=256 MiB
schedule rows (snapshot) <100,000 100,000–249,999 >=250,000
oldest schedule entry <14 days >=14 days >=30 days and DB >=64 MiB

Healthy post-repair references were about 0.8–8.3 MiB; the defective snapshot was 1.62 GiB with 3.07 million expired rows. The generous thresholds avoid reacting to ordinary guide variation.

Exit codes: 0=OK, 1=WARN, 2=MAINTENANCE_RECOMMENDED, 3=tool/error. --json provides machine-readable output but still performs no writes.

What to do on a warning

  1. Capture an offline, consistent snapshot and rerun snapshot mode.
  2. Confirm /data pressure and that stale EPG rows—not another app—are the cause.
  3. If maintenance is recommended, stop and obtain explicit authorization.
  4. Reuse the documented, supervised Phase-5 repair with a fresh backup and rollback artifact. This tool will never start it automatically.