Activity Recognition API has states ON_FOOT and STILL [0]. They can probably register to handle ON_FOOT-->STILL and wait for N minutes without touching.
This also reminds me of the Idle Detection API they tried adding in Chrome. [1]
[0] https://developers.google.com/android/reference/com/google/a...
[1] https://developer.chrome.com/docs/capabilities/web-apis/idle...