Loading broadcastradio/2.0/Android.bp +9 −0 Original line number Diff line number Diff line Loading @@ -8,7 +8,9 @@ hidl_interface { }, srcs: [ "types.hal", "IAnnouncementObserver.hal", "IBroadcastRadio.hal", "ICloseHandle.hal", "ITunerCallback.hal", "ITunerSession.hal", ], Loading @@ -16,8 +18,14 @@ hidl_interface { "android.hidl.base@1.0", ], types: [ "AmFmBandRange", "AmFmRegionConfig", "Announcement", "AnnouncementType", "ConfigFlag", "Constants", "DabTableEntry", "Deemphasis", "IdentifierType", "Metadata", "MetadataKey", Loading @@ -28,6 +36,7 @@ hidl_interface { "ProgramListChunk", "ProgramSelector", "Properties", "Rds", "Result", "VendorKeyValue", ], Loading broadcastradio/2.0/IAnnouncementObserver.hal 0 → 100644 +30 −0 Original line number Diff line number Diff line /* Copyright (C) 2017 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@2.0; /** * Callback interface for announcement observer. * * For typical configuration, the observer is a broadcast radio service. */ interface IAnnouncementObserver { /** * Called whenever announcement list has changed. * * @param announcements The complete list of currently active announcements. */ oneway onListUpdated(vec<Announcement> announcements); }; broadcastradio/2.0/IBroadcastRadio.hal +49 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ package android.hardware.broadcastradio@2.0; import IAnnouncementObserver; import ICloseHandle; import ITunerCallback; import ITunerSession; Loading @@ -32,6 +34,28 @@ interface IBroadcastRadio { */ getProperties() generates (Properties properties); /** * Fetches current or possible AM/FM region configuration. * * @param full If true, returns full hardware capabilities. * If false, returns current regional configuration. * @return result OK in case of success. * NOT_SUPPORTED if the tuner doesn't support AM/FM. * @return config Hardware capabilities (full=true) or * current configuration (full=false). */ getAmFmRegionConfig(bool full) generates (Result result, AmFmRegionConfig config); /** * Fetches current DAB region configuration. * * @return result OK in case of success. * NOT_SUPPORTED if the tuner doesn't support DAB. * @return config Current configuration. */ getDabRegionConfig() generates (Result result, vec<DabTableEntry> config); /** * Opens a new tuner session. * Loading Loading @@ -78,4 +102,28 @@ interface IBroadcastRadio { * or a zero-length vector if identifier doesn't exist. */ getImage(uint32_t id) generates (vec<uint8_t> image); /** * Registers announcement observer. * * If there is at least one observer registered, HAL implementation must * notify about announcements even if no sessions are active. * * If the observer dies, the HAL implementation must unregister observer * automatically. * * @param enabled The list of announcement types to watch for. * @param cb The callback interface. * @return result OK in case of success. * NOT_SUPPORTED if the tuner doesn't support announcements. * @return closeHandle A handle to unregister observer, * nullptr if result was not OK. */ registerAnnouncementObserver( vec<AnnouncementType> enabled, IAnnouncementObserver cb ) generates ( Result result, ICloseHandle closeHandle ); }; broadcastradio/2.0/ICloseHandle.hal 0 → 100644 +32 −0 Original line number Diff line number Diff line /* Copyright (C) 2017 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@2.0; /** * Represents a generic close handle to remove a callback that doesn't need * active interface. */ interface ICloseHandle { /** * Closes the handle. * * The call must not fail and must only be issued once. * * After the close call is executed, no other calls to this interface * are allowed. */ close(); }; broadcastradio/2.0/default/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,9 @@ cc_binary { "-Wextra", "-Werror", ], cppflags: [ "-std=c++1z", ], srcs: [ "BroadcastRadio.cpp", "TunerSession.cpp", Loading Loading
broadcastradio/2.0/Android.bp +9 −0 Original line number Diff line number Diff line Loading @@ -8,7 +8,9 @@ hidl_interface { }, srcs: [ "types.hal", "IAnnouncementObserver.hal", "IBroadcastRadio.hal", "ICloseHandle.hal", "ITunerCallback.hal", "ITunerSession.hal", ], Loading @@ -16,8 +18,14 @@ hidl_interface { "android.hidl.base@1.0", ], types: [ "AmFmBandRange", "AmFmRegionConfig", "Announcement", "AnnouncementType", "ConfigFlag", "Constants", "DabTableEntry", "Deemphasis", "IdentifierType", "Metadata", "MetadataKey", Loading @@ -28,6 +36,7 @@ hidl_interface { "ProgramListChunk", "ProgramSelector", "Properties", "Rds", "Result", "VendorKeyValue", ], Loading
broadcastradio/2.0/IAnnouncementObserver.hal 0 → 100644 +30 −0 Original line number Diff line number Diff line /* Copyright (C) 2017 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@2.0; /** * Callback interface for announcement observer. * * For typical configuration, the observer is a broadcast radio service. */ interface IAnnouncementObserver { /** * Called whenever announcement list has changed. * * @param announcements The complete list of currently active announcements. */ oneway onListUpdated(vec<Announcement> announcements); };
broadcastradio/2.0/IBroadcastRadio.hal +49 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ package android.hardware.broadcastradio@2.0; import IAnnouncementObserver; import ICloseHandle; import ITunerCallback; import ITunerSession; Loading @@ -32,6 +34,28 @@ interface IBroadcastRadio { */ getProperties() generates (Properties properties); /** * Fetches current or possible AM/FM region configuration. * * @param full If true, returns full hardware capabilities. * If false, returns current regional configuration. * @return result OK in case of success. * NOT_SUPPORTED if the tuner doesn't support AM/FM. * @return config Hardware capabilities (full=true) or * current configuration (full=false). */ getAmFmRegionConfig(bool full) generates (Result result, AmFmRegionConfig config); /** * Fetches current DAB region configuration. * * @return result OK in case of success. * NOT_SUPPORTED if the tuner doesn't support DAB. * @return config Current configuration. */ getDabRegionConfig() generates (Result result, vec<DabTableEntry> config); /** * Opens a new tuner session. * Loading Loading @@ -78,4 +102,28 @@ interface IBroadcastRadio { * or a zero-length vector if identifier doesn't exist. */ getImage(uint32_t id) generates (vec<uint8_t> image); /** * Registers announcement observer. * * If there is at least one observer registered, HAL implementation must * notify about announcements even if no sessions are active. * * If the observer dies, the HAL implementation must unregister observer * automatically. * * @param enabled The list of announcement types to watch for. * @param cb The callback interface. * @return result OK in case of success. * NOT_SUPPORTED if the tuner doesn't support announcements. * @return closeHandle A handle to unregister observer, * nullptr if result was not OK. */ registerAnnouncementObserver( vec<AnnouncementType> enabled, IAnnouncementObserver cb ) generates ( Result result, ICloseHandle closeHandle ); };
broadcastradio/2.0/ICloseHandle.hal 0 → 100644 +32 −0 Original line number Diff line number Diff line /* Copyright (C) 2017 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@2.0; /** * Represents a generic close handle to remove a callback that doesn't need * active interface. */ interface ICloseHandle { /** * Closes the handle. * * The call must not fail and must only be issued once. * * After the close call is executed, no other calls to this interface * are allowed. */ close(); };
broadcastradio/2.0/default/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,9 @@ cc_binary { "-Wextra", "-Werror", ], cppflags: [ "-std=c++1z", ], srcs: [ "BroadcastRadio.cpp", "TunerSession.cpp", Loading