Files
philips-tv-speicher-voll/patches/gel-workmanager/ROOT-CAUSE.md

2.3 KiB

GEL WorkManager root cause and exact patch boundary

Confirmed callsite

APK: diagnostics/raw/storage/gel.apk, SHA-256 29A68E6B09700ED4CCDF312C0B99EEE0C3F67E329A537FE87ED4341A71D383D7. Target: classes.dex, Lorg/droidtv/gel/gathering/GatheringService;->onStartCommand(Intent,int,int)int, code item code_off=0x50bf0, registers=6, ins=4, outs=5.

DEX PC Stock instruction
0x0000 build OneTimeWorkRequest from the incoming Intent
0x000f load unique name GEL_WORK
0x0011 load policy integer 4
0x0012 construct WorkContinuationImpl(manager,name,policy,list)
0x0015 call enqueue()

The embedded EnqueueRunnable.run() branches policy values 3 and 4 into the append path. It gathers current leaf WorkSpecs and inserts each as a prerequisite of the new request. For value 4, failed/cancelled leaves trigger replacement; otherwise it is the AndroidX APPEND_OR_REPLACE behavior. This directly explains the observed single-name dependency chain, expensive leaf traversal, delayed enqueue and 229,453,824-byte WorkDatabase.

Patch decision

A one-instruction change from integer 4 to integer 2 would select KEEP and bound the WorkSpec graph, but it would silently discard every incoming Intent while another GEL job exists. The worker handles many unrelated actions and extras, so that binary micro-patch is not release-safe.

The release design is a bounded persistent FIFO/outbox plus one KEEP drain worker and one periodic KEEP watchdog. Repetitive sampling/state alarms may be coalesced; non-idempotent actions remain FIFO and are acknowledged only after dispatch. It preserves the current serial order without representing each event as a WorkManager dependency. Delivery is at-least-once after a crash, so event IDs or idempotent receivers are required.

Validation

  • tools/verify_stock_callsite.py asserts the APK hash and the five exact DEX instructions above.
  • tools/test_bounded_outbox.py covers 10,000 coalescible alarms, 10,000 durable FIFO events, O(1) active WorkSpec, bounded depth, ordering and a crash between dispatch and acknowledgement.

This phase emits source/design and executable model artifacts, not a signed APK. A rebuilt GEL APK still needs the Philips platform private key and an AVB-integrated system image.