[roll] Roll fuchsia [starnix][power] use session power listener if available
When initializing the power listener, try connecting
to the session power listener first.
If the session power listener is unavaiable, then
fall back to the system power listener.
Alternatives considered...
Option A
--------
We could have the session implement the ActivityGovernor
protocol, and have Starnix attempt to connect to the instance
from the session, using `connect_to_protocl_at_container_svc()`.
But with this version:
1. It is easier to correlate error messages to which
listener protocol is in use.
2. We don't run the risk that other components will
mistakenly connect to the ActivityGovernor protocol
from the session.
3. The session doesn't have to worry about how to
implement GetPowerElements().
And we get these benefits without much more code.
Option B
--------
We could have the session provide its own protocol for
registering a listener, but deliver the event notifications
using ActivityGovernorListener.
However:
1. The API evolution guidelines discourage one library
(in this case: fuchsia.session.power) from depending
on API elements from another library (in this case:
fuchsia.power.system).
2. Referencing elements of `fuchsia.power.system` from
`fuchsia.session.power` would complicate adding `ffx`
commands to control session power management, because
`ffx` does not allow references to `internal` libraries
(and `fuchsia.session.power` is currently `internal`).
Test: manual (see below)
Manual test #1
--------------
Started Starnix in an environment where the
`fuchsia.session.power.ListenerRegistry` protocol is
not routed to Starnix.
Observed that Starnix falls back to the system power listener:
[00007.384097][kernels:o4Ni0Ev][starnix] INFO: Initializing power listener
[00007.385103][kernels:o4Ni0Ev][starnix] INFO: Connecting to session power management returned A FIDL client's channel to the protocol fuchsia.session.power.ListenerRegistry was closed: PEER_CLOSED
[00007.385136][kernels:o4Ni0Ev][starnix] INFO: Session power management unavailable, falling back to system power management
[00007.384258][klog] INFO: [component_manager] INFO: Optional protocol `fuchsia.session.power.ListenerRegistry` was not available for target `core/session-manager/session:session/elements:main/container`:
`fuchsia.session.power.ListenerRegist
[00007.384269][klog] INFO: [component_manager] INFO: ry` was not offered to `core/session-manager/session:session/elements:main/container` by parent
Manual test #2
--------------
Started Starnix in an environment where the ListenerRegistry
protocol is routed to Starnix, but the session is configured
not to implement its own power management.
Observed that Starnix falls back to the system power listener:
[00007.360520][kernels:4oGMf7g][starnix] INFO: Initializing power listener
[00007.360921][session:session] INFO: rejecting SessionPowerListenerRegistry connection, because session power is disabled
[00007.360987][kernels:4oGMf7g][starnix] INFO: Connecting to session power management returned A FIDL client's channel to the protocol fuchsia.session.power.ListenerRegistry was closed: PEER_CLOSED
[00007.361018][kernels:4oGMf7g][starnix] INFO: Session power management unavailable, falling back to system power management
Manual test #3
--------------
Started Starnix in an environment where the ListenerRegistry
protocol is routed to Starnix, and the session is configured
to implement its own power management.
[00021.314191][kernels:HH0wLrC][starnix] INFO: Initializing power listener
[00021.326221][kernels:HH0wLrC][starnix] INFO: Session Power Listener task starting...
<initialize suspend>
[00160.474188][kernels:HH0wLrC][starnix] INFO: Resuming from suspend
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1078679
Original-Revision: 5d8b1e2f200d5236bd9f0510e7d9105a8a5ae674
GitOrigin-RevId: 2b8c372020d7efe8e0849e95e670ac8d2f247f5a
Change-Id: Ieb1c7fc31446bf985c0f4acec6c1f3e0574b424b
This repository contains Fuchsia's Global Integration manifest files.
All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.
Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.
First install Jiri.
Next run:
$ jiri init $ jiri import minimal https://fuchsia.googlesource.com/integration $ jiri update
Third party projects should have their own subdirectory in ./third_party.