Comment 4 for bug 1502078

Revision history for this message
Sturm Flut (sturmflut) wrote :

Thinking about your idea: wouldn't it be possible to extend this "navigational mode" into a general "throttled background mode" and add escalations for the worst case? E.g. when a process running in the background hits the limit too often, the user is notified of it "misbehaving" and has the option to accept it (because she values the service the app provides more highly than battery life) or not. If it continues to hit the limit and the user doesn't react (e.g. because it's in the middle of the night and she is sleeping) the process gets frozen until the user decides.

The system call that is to be used to register a background process can carry as many semantic flags as we want, e.g. PRIORITY_POLL for processes that need a very very low limit because they just poll a network resource once every two minutes, or PRIORITY_BURST for a process that performs an one-shot heavy workload for a short amount of time, e.g. when the camera app needs a minute of full power to stitch a panorama together. The specific limits could be shipped with the device tarball (e.g. PRIORITY_POLL could be adjusted per device so that it usually doesn't have to increase the frequency and wake up a fast core), and when the device is connected to external power the limits could be increased or even lifted.

This would somehow pretty much solve the whole background processing question: It avoids excessive battery drain in the case of an error, the developer has a consistent experience on all devices and form factors (she can always have background processing, just the amount of available resources varies), everything always stays inside the app container and its address space(s), all the error cases (e.g. a failing network connection) can be handled by the app itself, it doesn't block the implementation of any use cases we don't yet know about, it should be quite easy to implement, and it takes all the load off of the platform developers who would have to maintain a long list of specialised background system services otherwise.