Activity based permissions

I got a CleanSpace Tag pollution monitor via a promotion with the London Cycling Campaign.

Putting aside the fact that users don't retain rights to the data they generate, it's a rather excellent idea: build a real-time crowd-source map of pollution by getting cyclists to mount cheap devices on their bikes.

The problem is that it requires an app to constantly track your location, even when the app is not running. This means 1) my location is being stored somewhere, even when I'm not using the device 2) it runs down my phone battery like crazy.

What I would like is to be able to allow an app access to my location only while I am cycling.

Android has a 'DetectedActivity' class, which is the closest thing I can find. Although ideally, it would be an OS level preference.

I can't find any papers on the general concept of activity based permissions or authentication, though.