Package: android.hardware.broadcastradio@1.1

types

Properties

Result

typedef @1.0::Result Result

ProgramListResult

enum ProgramListResult: Result
Details
Members
NOT_READY
NOT_STARTED
UNAVAILABLE

ProgramInfoFlags

enum ProgramInfoFlags: uint32_t

Extra flags for program information.

Details
Members
LIVE = 1 << 0
Set when the program is currently playing live stream.This may result in a slightly altered reception parameters, usually targetted at reduced latency.
MUTED = 1 << 1
Radio stream is not playing, ie.due to bad reception conditions or buffering.In this state volume knob MAY be disabled to prevent user increasing volume too much.
TRAFFIC_PROGRAM = 1 << 2
Station broadcasts traffic information regularly, but not necessarily right now.
TRAFFIC_ANNOUNCEMENT = 1 << 3
Station is broadcasting traffic information at the very moment.

Modulation

enum Modulation: uint32_t

Type of modulation.

Used as a value for DRMO_MODULATION IdentifierType.

Details
Members
AM = 1
FM

ProgramType

enum ProgramType: uint32_t

Type of a radio technology.

VENDOR program types must be opaque to the framework.

There are multiple VENDOR program types just to make vendor implementation easier with multiple properitary radio technologies.They are treated the same by the framework.

All other values are reserved for future use.Values not matching any enumerated constant must be ignored.

Details
Members
AM = 1
FM
AM_HD
FM_HD
DAB
DRMO
SXM
VENDOR_START = 1000
VENDOR_END = 1999

IdentifierType

enum IdentifierType: uint32_t

Type of program identifier component.

It MUST match the radio technology for primary ID but does not have to match it for secondary IDs.For example, a satellite program may set AM/FM fallback frequency, if a station broadcasts both via satellite and AM/FM.

VENDOR identifier types must be opaque to the framework.

The value format for each(but VENDOR_PRIMARY)identifier is strictly defined to maintain interoperability between devices made by different vendors.

All other values are reserved for future use.Values not matching any enumerated constant must be ignored.

Details
Members
AMFM_FREQUENCY = 1
RDS_PI
HD_STATION_ID_EXT
64bit compound primary identifier for HD Radio.
Consists of(from the LSB): - 32bit:Station ID number;- 4bit:HD_SUBCHANNEL;- 18bit:AMFM_FREQUENCY.The remaining bits should be set to zeros when writing on the chip side and ignored when read.
HD_SUBCHANNEL
HD Radio subchannel - a value of range 0-7.
The subchannel index is 0-based(where 0 is MPS and 1.. 7 are SPS), as opposed to HD Radio standard(where it's 1-based).
DAB_SIDECC
24bit compound primary identifier for DAB.
Consists of(from the LSB): - 16bit:SId;- 8bit:ECC code.The remaining bits should be set to zeros when writing on the chip side and ignored when read.
DAB_ENSEMBLE
DAB_SCID
DAB_FREQUENCY
DRMO_SERVICE_ID
DRMO_FREQUENCY
DRMO_MODULATION
SXM_SERVICE_ID
SXM_CHANNEL
VENDOR_PRIMARY_START = ProgramType : VENDOR_START
Primary identifier for vendor-specific radio technology.The value format is determined by a vendor.
It must not be used in any other programType than corresponding VENDOR type between VENDOR_START and VENDOR_END(eg.identifier type 1015 must not be used in any program type other than 1015).
VENDOR_PRIMARY_END = ProgramType : VENDOR_END

VendorKeyValue

struct VendorKeyValue {string key; string value}

A key-value pair for vendor-specific information to be passed as-is through Android framework to the front-end application.

Details
Members
key
Key must be prefixed with unique vendor Java-style namespace, eg.'com.somecompany.parameter1'.
value
Value must be passed through the framework without any changes.Format of this string can vary across vendors.

Properties

struct Properties {@ base; bool supportsBackgroundScanning; vec supportedProgramTypes; vec supportedIdentifierTypes; vec vendorInfo}
Details
Members
base
supportsBackgroundScanning
The hardware supports background scanning in general.At the given time it may not be available though, see startBackgroundScan.
supportedProgramTypes
A list of supported ProgramType values.
If a program type is supported by radio module, it means it can tune to ProgramSelector of a given type.
Support for VENDOR program type does not guarantee compatibility, as other module properties(implementor, product, version)must be checked.
supportedIdentifierTypes
A list of supported IdentifierType values.
If an identifier is supported by radio module, it means it can use it for tuning to ProgramSelector with either primary or secondary Identifier of a given type.
Support for VENDOR identifier type does not guarantee compatibility, as other module properties(implementor, product, version)must be checked.
vendorInfo
Vendor-specific information.
It may be used for extra features, not supported by the platform, for example:com.me.preset-slots=6;com.me.ultra-hd-capable=false.

ProgramIdentifier

struct ProgramIdentifier {uint32_t type; uint64_t value}

A single program identifier component, eg.frequency or channel ID.

The uint32_t type field maps to IdentifierType enum.It's not straight, because the enum may be extended in future versions of the HAL.Values out of the enum range must not be used when writing and ignored when reading.

The uint64_t value field holds the value in format described in comments for IdentifierType enum.

Details
Members
type
value

ProgramSelector

struct ProgramSelector {uint32_t programType; ProgramIdentifier primaryId; vec secondaryIds; vec vendorIds}

A set of identifiers necessary to tune to a given station.

This can hold various identifiers, like - AM/FM frequency - HD Radio subchannel - DAB channel info

The uint32_t programType field maps to ProgramType enum.It's not straight, because the enum may be extended in future versions of the HAL.Values out of the enum range must not be used when writing and ignored when reading.

The primary ID uniquely identifies a station and can be used for equality check.The secondary IDs are supplementary and can speed up tuning process, but the primary ID is sufficient(ie.after a full band scan).

Two selectors with different secondary IDs, but the same primary ID are considered equal.In particular, secondary IDs vector may get updated for an entry on the program list(ie.when a better frequency for a given station is found).

The primaryId of a given programType MUST be of a specific type:- AM, FM:RDS_PI if the station broadcasts RDS, AMFM_FREQUENCY otherwise;- AM_HD, FM_HD:HD_STATION_ID_EXT;- DAB:DAB_SIDECC;- DRMO:DRMO_SERVICE_ID;- SXM:SXM_SERVICE_ID;- VENDOR:VENDOR_PRIMARY.

Details
Members
programType
primaryId
secondaryIds
vendorIds
Opaque vendor-specific identifiers, to be passed to front-end without changes.
The order is meaningful, ie.the first element may be defined as frequency, second as the subchannel etc.
The vector is not serialized(either locally or to the cloud), unless it's a VENDOR program type.

ProgramInfo

struct ProgramInfo {@ base; ProgramSelector selector; bitfield flags; vec vendorInfo}

Radio program information.Returned by the HAL with event RADIO_EVENT_TUNED.Contains information on currently tuned channel.

Details
Members
base
selector
flags
vendorInfo
Vendor-specific information.
It may be used for extra features, not supported by the platform, for example:paid-service=true;bitrate=320kbps.