Package: android.hardware.broadcastradio@1.0

ITuner

interface ITuner

Methods

setConfiguration

setConfiguration (BandConfig config)
generates (Result result)

Apply current radio band configuration(band, range, channel spacing.. .). Automatically cancels pending scan, step or tune.ITunerCallback.configChange() method MUST be called once the configuration is applied or a failure occurs or after a time out.

Details
Parameters
config
The band configuration to apply.
Generates
result
OK if configuration could be applied NOT_INITIALIZED in case of initialization error.INVALID_ARGUMENTS if configuration requested is invalid

getConfiguration

getConfiguration ()
generates (Result result, BandConfig config)

Retrieve current radio band configuration.

Details
Generates
result
OK if valid configuration is returned, NOT_INITIALIZED in case of initialization error.
config

scan

scan (Direction direction, bool skipSubChannel)
generates (Result result)

Start scanning up to next valid station.Shall be called only when a valid configuration has been applied.Automatically cancels pending scan, step or tune.ITunerCallback.tuneComplete() MUST be called once locked on a station or after a time out or full band scan if no station found.The status should indicate if a valid station is tuned or not.

Details
Parameters
direction
UP or DOWN.
skipSubChannel
valid for HD radio or digital radios only:ignore sub channels(e.g SPS for HD radio).
Generates
result
OK if scan successfully started INVALID_STATE if called out of sequence NOT_INITIALIZED if another error occurs

step

step (Direction direction, bool skipSubChannel)
generates (Result result)

Move one channel spacing up or down.Must be called when a valid configuration has been applied.Automatically cancels pending scan, step or tune.ITunerCallback.tuneComplete() MUST be called once locked on a station or after a time out or full band scan if no station found.The status should indicate if a valid station is tuned or not.

Details
Parameters
direction
UP or DOWN.
skipSubChannel
valid for HD radio or digital radios only:ignore sub channels(e.g SPS for HD radio).
Generates
result
OK if scan successfully started INVALID_STATE if called out of sequence NOT_INITIALIZED if another error occurs

tune

tune (uint32_t channel, uint32_t subChannel)
generates (Result result)

Tune to specified channel.Must be called when a valid configuration has been applied.Automatically cancels pending scan, step or tune.ITunerCallback.tuneComplete() MUST be called once locked on a station or after a time out or full band scan if no station found.The status should indicate if a valid station is tuned or not.

Details
Parameters
channel
Channel to tune to.A frequency in kHz for AM/FM/HD Radio bands.
subChannel
Valid for HD radio or digital radios only(e.g SPS number for HD radio)..
Generates
result
OK if scan successfully started INVALID_ARGUMENTS if invalid arguments are passed INVALID_STATE if called out of sequence NOT_INITIALIZED if another error occurs

cancel

cancel ()
generates (Result result)

Cancel a scan, step or tune operation.Shall be called only while a scan, step or tune operation is pending.ITunerCallback.tuneComplete() MUST NOT be sent by the HAL.

Details
Generates
result
OK if scan successfully started INVALID_STATE if called out of sequence NOT_INITIALIZED if another error occurs

getProgramInformation

getProgramInformation ()
generates (Result result, ProgramInfo info)

Retrieve current station information.

Details
Generates
result
OK if scan successfully started NOT_INITIALIZED if another error occurs
info
Current program information.