Improved HD radio support in broadcast radio HAL
Added identifier types, program info flags and metadata needed for
HD radio in AIDL broadcast radio HAL. Depracated SXM identifier
types since SXM is not supported.
Bug: 280300929
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: I822b43e6452c308db1259b99b961378c14c8b294
diff --git a/broadcastradio/aidl/Android.bp b/broadcastradio/aidl/Android.bp
index 3f89029..e8bc5eb 100644
--- a/broadcastradio/aidl/Android.bp
+++ b/broadcastradio/aidl/Android.bp
@@ -43,6 +43,6 @@
imports: [],
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl
index fe8489c..b96def3 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl
@@ -37,8 +37,8 @@
android.hardware.broadcastradio.AmFmBandRange[] ranges;
int fmDeemphasis;
int fmRds;
- const int DEEMPHASIS_D50 = (1 << 0);
- const int DEEMPHASIS_D75 = (1 << 1);
- const int RDS = (1 << 0);
- const int RBDS = (1 << 1);
+ const int DEEMPHASIS_D50 = (1 << 0) /* 1 */;
+ const int DEEMPHASIS_D75 = (1 << 1) /* 2 */;
+ const int RDS = (1 << 0) /* 1 */;
+ const int RBDS = (1 << 1) /* 2 */;
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl
index 98af437..d6d33bc 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl
@@ -35,6 +35,9 @@
@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability
enum ConfigFlag {
FORCE_MONO = 1,
+ /**
+ * @deprecated Use {link #FORCE_ANALOG_FM} instead
+ */
FORCE_ANALOG,
FORCE_DIGITAL,
RDS_AF,
@@ -43,4 +46,6 @@
DAB_FM_LINKING,
DAB_DAB_SOFT_LINKING,
DAB_FM_SOFT_LINKING,
+ FORCE_ANALOG_FM,
+ FORCE_ANALOG_AM,
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/HdSubChannel.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/HdSubChannel.aidl
new file mode 100644
index 0000000..dd06134
--- /dev/null
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/HdSubChannel.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.broadcastradio;
+@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability
+enum HdSubChannel {
+ HD1 = 0,
+ HD2 = 1,
+ HD3 = 2,
+ HD4 = 3,
+ HD5 = 4,
+ HD6 = 5,
+ HD7 = 6,
+ HD8 = 7,
+}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl
index 4df272c..ed41af0 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl
@@ -47,6 +47,13 @@
DAB_FREQUENCY_KHZ,
DRMO_SERVICE_ID,
DRMO_FREQUENCY_KHZ,
- SXM_SERVICE_ID = (DRMO_FREQUENCY_KHZ + 2),
+ /**
+ * @deprecated SiriusXM Satellite Radio is not supported.
+ */
+ SXM_SERVICE_ID = (DRMO_FREQUENCY_KHZ + 2) /* 12 */,
+ /**
+ * @deprecated SiriusXM Satellite Radio is not supported.
+ */
SXM_CHANNEL,
+ HD_STATION_LOCATION,
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl
index e02b6b1..b4a1efa 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl
@@ -50,4 +50,12 @@
String dabServiceNameShort;
String dabComponentName;
String dabComponentNameShort;
+ String genre;
+ String commentShortDescription;
+ String commentActualText;
+ String commercial;
+ String[] ufids;
+ String hdStationNameShort;
+ String hdStationNameLong;
+ int hdSubChannelsAvailable;
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl
index b14023a..997cdd7 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl
@@ -42,10 +42,13 @@
int signalQuality;
android.hardware.broadcastradio.Metadata[] metadata;
android.hardware.broadcastradio.VendorKeyValue[] vendorInfo;
- const int FLAG_LIVE = (1 << 0);
- const int FLAG_MUTED = (1 << 1);
- const int FLAG_TRAFFIC_PROGRAM = (1 << 2);
- const int FLAG_TRAFFIC_ANNOUNCEMENT = (1 << 3);
- const int FLAG_TUNABLE = (1 << 4);
- const int FLAG_STEREO = (1 << 5);
+ const int FLAG_LIVE = (1 << 0) /* 1 */;
+ const int FLAG_MUTED = (1 << 1) /* 2 */;
+ const int FLAG_TRAFFIC_PROGRAM = (1 << 2) /* 4 */;
+ const int FLAG_TRAFFIC_ANNOUNCEMENT = (1 << 3) /* 8 */;
+ const int FLAG_TUNABLE = (1 << 4) /* 16 */;
+ const int FLAG_STEREO = (1 << 5) /* 32 */;
+ const int FLAG_SIGNAL_ACQUISITION = (1 << 6) /* 64 */;
+ const int FLAG_HD_SIS_ACQUISITION = (1 << 7) /* 128 */;
+ const int FLAG_HD_AUDIO_ACQUISITION = (1 << 8) /* 256 */;
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl
index 8af74c7..b0fc018 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl
@@ -34,7 +34,7 @@
package android.hardware.broadcastradio;
@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability
enum Result {
- OK,
+ OK = 0,
INTERNAL_ERROR,
INVALID_ARGUMENTS,
INVALID_STATE,
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl
index 11da39c..ddf60e0 100644
--- a/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl
@@ -36,10 +36,12 @@
* Forces the analog playback for the supporting radio technology.
*
* User may disable digital playback for FM HD Radio or hybrid FM/DAB with
- * this option. This is purely user choice, ie. does not reflect digital-
+ * this option. This is purely user choice, i.e. does not reflect digital-
* analog handover state managed from the HAL implementation side.
*
- * Some radio technologies may not support this, ie. DAB.
+ * Some radio technologies may not support this, i.e. DAB.
+ *
+ * @deprecated Use {link #FORCE_ANALOG_FM} instead
*/
FORCE_ANALOG,
@@ -89,4 +91,26 @@
* Enables DAB-FM soft-linking (related content).
*/
DAB_FM_SOFT_LINKING,
+
+ /**
+ * Forces the FM analog playback for the supporting radio technology.
+ *
+ * User may disable FM digital playback for FM HD Radio or hybrid FM/DAB
+ * with this option. This is purely user choice, i.e. does not reflect
+ * digital-analog handover state managed from the HAL implementation side.
+ *
+ * Some radio technologies may not support this, i.e. DAB.
+ */
+ FORCE_ANALOG_FM,
+
+ /**
+ * Forces the AM analog playback for the supporting radio technology.
+ *
+ * User may disable AM digital playback for AM HD Radio or hybrid AM/DAB
+ * with this option. This is purely user choice, i.e. does not reflect
+ * digital-analog handover state managed from the HAL implementation side.
+ *
+ * Some radio technologies may not support this, i.e. DAB.
+ */
+ FORCE_ANALOG_AM,
}
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/HdSubChannel.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/HdSubChannel.aidl
new file mode 100644
index 0000000..46a3e0c
--- /dev/null
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/HdSubChannel.aidl
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.broadcastradio;
+
+/**
+ * Index of HD radio subchannel.
+ */
+@VintfStability
+@Backing(type="int")
+@JavaDerive(equals=true, toString=true)
+enum HdSubChannel {
+ /**
+ * Index of HD radio subchannel 1.
+ *
+ * <p>There are at most 8 HD radio subchannels of 1-based om HD radio standard. It is
+ * converted to 0-based index. 0 is the index of main program service (MPS). 1 to 7
+ * are indexes of additional supplemental program services (SPS).
+ */
+ HD1 = 0,
+ /**
+ * {@see HD1}
+ */
+ HD2 = 1,
+ /**
+ * {@see HD1}
+ */
+ HD3 = 2,
+ /**
+ * {@see HD1}
+ */
+ HD4 = 3,
+ /**
+ * {@see HD1}
+ */
+ HD5 = 4,
+ /**
+ * {@see HD1}
+ */
+ HD6 = 5,
+ /**
+ * {@see HD1}
+ */
+ HD7 = 6,
+ /**
+ * {@see HD1}
+ */
+ HD8 = 7,
+}
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl
index 646c502..4a95a41 100644
--- a/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl
@@ -154,11 +154,42 @@
/**
* 32bit primary identifier for SiriusXM Satellite Radio.
+ *
+ * @deprecated SiriusXM Satellite Radio is not supported.
*/
SXM_SERVICE_ID = DRMO_FREQUENCY_KHZ + 2,
/**
* 0-999 range
+ *
+ * @deprecated SiriusXM Satellite Radio is not supported.
*/
SXM_CHANNEL,
+
+ /**
+ * 64bit additional identifier for HD Radio representing station location.
+ *
+ * Consists of (from the LSB):
+ * - 4 bit: Bits 0:3 of altitude
+ * - 13 bit: Fractional bits of longitude
+ * - 8 bit: Integer bits of longitude
+ * - 1 bit: 0 for east and 1 for west for longitude
+ * - 1 bit: 0, representing latitude
+ * - 5 bit: pad of zeros separating longitude and latitude
+ * - 4 bit: Bits 4:7 of altitude
+ * - 13 bit: Fractional bits of latitude
+ * - 8 bit: Integer bits of latitude
+ * - 1 bit: 0 for north and 1 for south for latitude
+ * - 1 bit: 1, representing latitude
+ * - 5 bit: pad of zeros
+ *
+ * This format is defined in NRSC-5-C document: SY_IDD_1020s.
+ *
+ * Due to Station ID abuse, some HD_STATION_ID_EXT identifiers may be not
+ * globally unique. To provide a best-effort solution, the station’s
+ * broadcast antenna containing the latitude and longitude may be carried
+ * as additional identifier and may be used by the tuner hardware to
+ * double-check tuning.
+ */
+ HD_STATION_LOCATION,
}
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl
index 7769b8c..0ce967f 100644
--- a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl
@@ -116,4 +116,70 @@
* <p>Note: The string must be up to 8 characters long.
*/
String dabComponentNameShort;
+
+ /**
+ * Genre of the current audio piece (string)
+ *
+ * <p>(see NRSC-G200-A and id3v2.3.0 for more info)
+ */
+ String genre;
+
+ /**
+ * Short context description of comment (string)
+ *
+ * <p>Comment could relate to the current audio program content, or it might
+ * be unrelated information that the station chooses to send. It is
+ * composed of short content description and actual text (see NRSC-G200-A
+ * and id3v2.3.0 for more info).
+ */
+ String commentShortDescription;
+
+ /**
+ * Actual text of comment (string)
+ *
+ * @see #commentShortDescription
+ */
+ String commentActualText;
+
+ /**
+ * Commercial (string)
+ *
+ * <p>Commercial is application specific and generally used to facilitate the
+ * sale of products and services (see NRSC-G200-A and id3v2.3.0 for more info).
+ */
+ String commercial;
+
+ /**
+ * HD Unique File Identifiers (Array of strings)
+ *
+ * <p>Unique File Identifier (UFID) can be used to transmit an alphanumeric
+ * identifier of the current content, or of an advertised product or service
+ * (see NRSC-G200-A and id3v2.3.0 for more info).
+ */
+ String[] ufids;
+
+ /**
+ * HD short station name or HD universal short station name
+ *
+ * <p>It can be up to 12 characters (see SY_IDD_1020s for more info).
+ */
+ String hdStationNameShort;
+
+ /**
+ * HD long station name, HD station slogan or HD station message
+ *
+ * <p>(see SY_IDD_1020s for more info)
+ */
+ String hdStationNameLong;
+
+ /**
+ * Bit mask of all HD Radio subchannels available (uint8_t)
+ *
+ * <p>Bit {@link HdSubChannel#HD1} from LSB represents the availability
+ * of HD-1 subchannel (main program service, MPS). Bits
+ * {@link HdSubChannel#HD2} to {@link HdSubChannel#HD8} from LSB represent
+ * HD-2 to HD-8 subchannel (supplemental program services, SPS)
+ * respectively.
+ */
+ int hdSubChannelsAvailable;
}
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl
index 7632c81..d4ccd01 100644
--- a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl
@@ -71,6 +71,23 @@
const int FLAG_STEREO = 1 << 5;
/**
+ * A signal has been acquired if this bit is set.
+ */
+
+ const int FLAG_SIGNAL_ACQUISITION = 1 << 6;
+ /**
+ * An HD Station Information Service (SIS) information is available if this
+ * bit is set.
+ */
+
+ const int FLAG_HD_SIS_ACQUISITION = 1 << 7;
+
+ /**
+ * An HD digital audio is available if this bit is set.
+ */
+ const int FLAG_HD_AUDIO_ACQUISITION = 1 << 8;
+
+ /**
* An identifier used to point at the program (primarily to tune to it).
*
* This field is required - its type field must not be set to
@@ -153,7 +170,8 @@
*
* It can be a combination of {@link #FLAG_LIVE}, {@link #FLAG_MUTED},
* {@link #FLAG_TRAFFIC_PROGRAM}, {@link #FLAG_TRAFFIC_ANNOUNCEMENT},
- * {@link #FLAG_TUNABLE}, and {@link #FLAG_STEREO}.
+ * {@link #FLAG_TUNABLE}, {@link #FLAG_STEREO}, {@link #FLAG_SIGNAL_ACQUISITION},
+ * {@link #FLAG_HD_SIS_ACQUISITION}, and {@link #FLAG_HD_AUDIO_ACQUISITION}.
*/
int infoFlags;
diff --git a/broadcastradio/aidl/default/broadcastradio-default.xml b/broadcastradio/aidl/default/broadcastradio-default.xml
index 1555822..acf35f9 100644
--- a/broadcastradio/aidl/default/broadcastradio-default.xml
+++ b/broadcastradio/aidl/default/broadcastradio-default.xml
@@ -1,6 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.broadcastradio</name>
+ <version>1</version>
<fqname>IBroadcastRadio/amfm</fqname>
<fqname>IBroadcastRadio/dab</fqname>
</hal>
diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml
index 75915e3..77733a8 100644
--- a/compatibility_matrices/compatibility_matrix.9.xml
+++ b/compatibility_matrices/compatibility_matrix.9.xml
@@ -157,6 +157,7 @@
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.broadcastradio</name>
+ <version>1-2</version>
<interface>
<name>IBroadcastRadio</name>
<regex-instance>.*</regex-instance>