Improve documentation of addEthernetStateListener

The existing documentation was not clear at all about how this API
behaves.

Test: TH
Change-Id: I408f32c1e7b6c910aaaa197b6774865e79a03579
This commit is contained in:
Patrick Rohr 2024-03-21 11:21:29 -07:00
commit e762554170

View file

@ -642,7 +642,14 @@ public class EthernetManager {
}
/**
* Listen to changes in the state of ethernet.
* Register a IntConsumer to be called back on ethernet state changes.
*
* <p>{@link IntConsumer#accept} with the current ethernet state will be triggered immediately
* upon adding a listener. The same callback is invoked on Ethernet state change, i.e. when
* calling {@link #setEthernetEnabled}.
* <p>The reported state is represented by:
* {@link #ETHERNET_STATE_DISABLED}: ethernet is now disabled.
* {@link #ETHERNET_STATE_ENABLED}: ethernet is now enabled.
*
* @param executor to run callbacks on.
* @param listener to listen ethernet state changed.