public class RadioManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RadioManager.AmBandConfig
AM band configuration.
|
static class |
RadioManager.AmBandDescriptor
AM band descriptor.
|
static class |
RadioManager.BandConfig
Radio band configuration.
|
static class |
RadioManager.BandDescriptor
Radio band descriptor: an element in ModuleProperties bands array.
|
static class |
RadioManager.FmBandConfig
FM band configuration.
|
static class |
RadioManager.FmBandDescriptor
FM band descriptor
|
static class |
RadioManager.ModuleProperties
Lists properties, options and radio bands supported by a given broadcast radio module.
|
static class |
RadioManager.ProgramInfo
Radio program information returned by
RadioTuner.getProgramInformation(RadioManager.ProgramInfo[]) |
Modifier and Type | Field and Description |
---|---|
static int |
BAND_AM
AM radio band (LW/MW/SW).
|
static int |
BAND_AM_HD
AM HD radio or DRM band.
|
static int |
BAND_FM
FM radio band.
|
static int |
BAND_FM_HD
FM HD radio or DRM band.
|
static int |
CLASS_AM_FM
Radio module class supporting FM (including HD radio) and AM
|
static int |
CLASS_DT
Radio module class supporting Digital terrestrial radio
|
static int |
CLASS_SAT
Radio module class supporting satellite radio
|
static int |
REGION_ITU_1
Africa, Europe.
|
static int |
REGION_ITU_2
Americas.
|
static int |
REGION_JAPAN
Japan.
|
static int |
REGION_KOREA
Korea.
|
static int |
REGION_OIRT
Russia.
|
static int |
STATUS_BAD_VALUE
Method return status: invalid argument provided
|
static int |
STATUS_DEAD_OBJECT
Method return status: cannot reach service
|
static int |
STATUS_ERROR
Method return status: unspecified error
|
static int |
STATUS_INVALID_OPERATION
Method return status: invalid or out of sequence operation
|
static int |
STATUS_NO_INIT
Method return status: initialization failure
|
static int |
STATUS_OK
Method return status: successful operation
|
static int |
STATUS_PERMISSION_DENIED
Method return status: permission denied
|
static int |
STATUS_TIMED_OUT
Method return status: time out before operation completion
|
Constructor and Description |
---|
RadioManager(Context context) |
Modifier and Type | Method and Description |
---|---|
int |
listModules(List<RadioManager.ModuleProperties> modules)
Returns a list of descriptors for all broadcast radio modules present on the device.
|
RadioTuner |
openTuner(int moduleId,
RadioManager.BandConfig config,
boolean withAudio,
RadioTuner.Callback callback,
Handler handler)
Open an interface to control a tuner on a given broadcast radio module.
|
public static final int STATUS_OK
public static final int STATUS_ERROR
public static final int STATUS_PERMISSION_DENIED
public static final int STATUS_NO_INIT
public static final int STATUS_BAD_VALUE
public static final int STATUS_DEAD_OBJECT
public static final int STATUS_INVALID_OPERATION
public static final int STATUS_TIMED_OUT
public static final int CLASS_AM_FM
public static final int CLASS_SAT
public static final int CLASS_DT
public static final int BAND_AM
RadioManager.BandDescriptor
,
Constant Field Valuespublic static final int BAND_FM
RadioManager.BandDescriptor
,
Constant Field Valuespublic static final int BAND_FM_HD
RadioManager.BandDescriptor
,
Constant Field Valuespublic static final int BAND_AM_HD
RadioManager.BandDescriptor
,
Constant Field Valuespublic static final int REGION_ITU_1
RadioManager.BandDescriptor
,
Constant Field Valuespublic static final int REGION_ITU_2
RadioManager.BandDescriptor
,
Constant Field Valuespublic static final int REGION_OIRT
RadioManager.BandDescriptor
,
Constant Field Valuespublic static final int REGION_JAPAN
RadioManager.BandDescriptor
,
Constant Field Valuespublic static final int REGION_KOREA
RadioManager.BandDescriptor
,
Constant Field Valuespublic RadioManager(Context context)
public int listModules(List<RadioManager.ModuleProperties> modules)
modules
- An List of RadioManager.ModuleProperties
where the list will be returned.STATUS_OK
in case of success, STATUS_ERROR
in case of unspecified error, STATUS_NO_INIT
if the native service cannot be reached, STATUS_BAD_VALUE
if modules is null, STATUS_DEAD_OBJECT
if the binder transaction to the native service fails, public RadioTuner openTuner(int moduleId, RadioManager.BandConfig config, boolean withAudio, RadioTuner.Callback callback, Handler handler)
moduleId
- radio module identifier RadioManager.ModuleProperties.getId()
. Mandatory.config
- desired band and configuration to apply when enabling the hardware module.
optional, can be null.withAudio
- true
to request a tuner with an audio source.
This tuner is intended for live listening or recording or a radio program.
If false
, the tuner can only be used to retrieve program informations.callback
- RadioTuner.Callback
interface. Mandatory.handler
- the Handler on which the callbacks will be received.
Can be null if default handler is OK.RadioTuner
interface in case of success or null in case of error.