On 29/08/2014 20:37, Fabrice Desré wrote:
> One question: do you think it would be worthwhile to have more direct
> signals from the system app on what app is important or not? I see that
> in your proposals you still relies on somewhat indirect hints like
> visibility, etc. The system app is part of the platform for all
> practical matters so it's ok from an overall architecture point of view.

Currently we're relying on the following information:

- visibility, used to establish background (hidden) and foreground
(visible) priority
- cpu/high-priority wakelocks, used to boost priority to both foreground
and background apps
- system message handlers, used to boost priority if the app has pending
messages in the handlers it registered
- audio output to boost priority of background apps playing audio
- app type, we currently special-case the keyboard (which is less
important than other foreground apps) and homescreen (which is more
important than background apps but less important than background apps
playing audio)

This has worked relatively well for us except when activities were
involved where we had multiple foreground apps. Now the presence of the
search bar (which is always visible for practical purposes) is also
making this more complicated.

I've given some thought about relying on explicit commands from the
system app but it sounds to me as that would be effectively moving the
priority assignment logic out of gecko and into gaia. Would that be a
good thing? I think that information such as audio playback and wakelock
control and system messages is not available there so that would need to
be handled in gecko anyway.

Visibility on the other hand might be better handled in the system app
since it's aware of "external" connections between the app such as
activity chains. Special-casing apps could also be done better in the
system app (note that we recently had problems because the keyboard app
changed an attribute name and the priority manager couldn't tell it
apart from other apps anymore).

Naturally we would need some kind of exposed API to allow the system app
to communicate this information to Gecko. Maybe a basic set of
priorities associated with an app.

 Gabriele

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to