Back process-only triggers with an owned foreground service #23
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some Android broadcasts cannot be delivered to a manifest receiver, only to one registered at runtime, so the trigger
only fires while the Macros process happens to be alive.
AudioRouteReceiverandScreenStateReceiveralready livewith this through
dynamicActionsByEvent, andRINGER_MODE_CHANGEDis the same shape — which is why a ringer-modetrigger was left out of the first device-controls increment.
Proposal
Where such a trigger exists and a workflow actually subscribes to it, run a foreground service that keeps the process
alive and holds the dynamic registrations. The service is owned exactly like the current registrations: derived from
trigger subscriptions and durable continuations by
BackgroundResourceManager, started when the first owner appears andstopped when the last one disappears. No workflow needs it, no service runs.
Points to settle
restrictions; this is only for the ones that are not.
which automations are keeping it alive, and the Background activity screen should project it like any other resource.
BackgroundResourceManageralready reports qualitative battery behaviour per resource; aprocess-resident service is a materially different cost from an alarm and must be labelled as such.
added.
RUN_AS_NON_EXPEDITED_WORK_REQUESTpath and with #21, since a live foreground servicealso removes the background foreground-service start problem for playback.
Why it is worth doing
Without it these triggers are close to decorative: they appear in the catalogue, compile, and then rarely fire. Either
back them properly or mark them unavailable with a reason, the way planned event sources already are — a trigger that
silently does not fire is the worst of the three options.