public abstract static class RadioTuner.Callback extends Object
RadioTuner
to receive asynchronous operation results, updates and error notifications.Constructor and Description |
---|
Callback() |
Modifier and Type | Method and Description |
---|---|
void |
onAntennaState(boolean connected)
onAntennaState() is called when the antenna is connected or disconnected.
|
void |
onConfigurationChanged(RadioManager.BandConfig config)
onConfigurationChanged() is called upon successful completion of
RadioManager#openTuner(int, RadioManager.BandConfig, boolean, Callback, Handler)
or RadioTuner.setConfiguration(RadioManager.BandConfig) |
void |
onControlChanged(boolean control)
onControlChanged() is called when the client loses or gains control of the radio tuner.
|
void |
onEmergencyAnnouncement(boolean active)
onEmergencyAnnouncement() is called when an emergency annoucement starts and stops.
|
void |
onError(int status)
onError() is called when an error occured while performing an asynchronous
operation of when the hardware or system service experiences a problem.
|
void |
onMetadataChanged(RadioMetadata metadata)
onMetadataChanged() is called when new meta data are received on current program.
|
void |
onProgramInfoChanged(RadioManager.ProgramInfo info)
onProgramInfoChanged() is called upon successful completion of
RadioTuner.step(int, boolean) , RadioTuner.scan(int, boolean) ,
RadioTuner.tune(int, int) or when a switching to alternate frequency occurs. |
void |
onTrafficAnnouncement(boolean active)
onTrafficAnnouncement() is called when a traffic announcement starts and stops.
|
public void onError(int status)
RadioTuner.ERROR_HARDWARE_FAILURE
, RadioTuner.ERROR_SERVER_DIED
,
RadioTuner.ERROR_CANCELLED
, RadioTuner.ERROR_SCAN_TIMEOUT
,
RadioTuner.ERROR_CONFIG
public void onConfigurationChanged(RadioManager.BandConfig config)
RadioManager#openTuner(int, RadioManager.BandConfig, boolean, Callback, Handler)
or RadioTuner.setConfiguration(RadioManager.BandConfig)
public void onProgramInfoChanged(RadioManager.ProgramInfo info)
RadioTuner.step(int, boolean)
, RadioTuner.scan(int, boolean)
,
RadioTuner.tune(int, int)
or when a switching to alternate frequency occurs.
Note that if metadata only are updated, onMetadataChanged(RadioMetadata)
will
be called.public void onMetadataChanged(RadioMetadata metadata)
RadioManager.ProgramInfo
when
onProgramInfoChanged(RadioManager.ProgramInfo)
is called.public void onTrafficAnnouncement(boolean active)
public void onEmergencyAnnouncement(boolean active)
public void onAntennaState(boolean connected)
public void onControlChanged(boolean control)
RadioManager#openTuner(int, RadioManager.BandConfig, boolean, Callback, Handler)
.
If another client opens the same tuner, onControlChanged() will be called with
control set to false
to indicate loss of control.
At this point, RadioTuner APIs other than getters will return
RadioManager.STATUS_INVALID_OPERATION
.
When the other client releases the tuner, onControlChanged() will be called
with control set to true
.