I grant that I haven't thought it through, but off the top of my head:
- You're doing something presumably event-driven to detect unoccupied and unlocked. Use the same trigger to check whether sentry should be enabled.
- If you aren't already using it, the common trick seems to be to use location services to wake the app occasionally. Some combination of noting the car location vs. the phone location shouldn't require waking the car at all to notice that te car and the phone are now in different locations and the check should be performed.
(I note that I'm presuming the logic is driven from a phone that is with the car and then not with the car, which is a stateful presumption rather than an elegant presumption. Still, I'd bet it's the 90% case.)