Tomasz Wasilczyk | 06100b3 | 2017-12-04 09:53:32 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #ifndef ANDROID_HARDWARE_BROADCASTRADIO_V2_0_BROADCASTRADIO_H |
| 17 | #define ANDROID_HARDWARE_BROADCASTRADIO_V2_0_BROADCASTRADIO_H |
| 18 | |
| 19 | #include "TunerSession.h" |
| 20 | |
| 21 | #include <android/hardware/broadcastradio/2.0/IBroadcastRadio.h> |
| 22 | #include <android/hardware/broadcastradio/2.0/types.h> |
| 23 | |
| 24 | namespace android { |
| 25 | namespace hardware { |
| 26 | namespace broadcastradio { |
| 27 | namespace V2_0 { |
| 28 | namespace implementation { |
| 29 | |
| 30 | struct BroadcastRadio : public IBroadcastRadio { |
| 31 | BroadcastRadio(const VirtualRadio& virtualRadio); |
| 32 | |
| 33 | // V2_0::IBroadcastRadio methods |
| 34 | Return<void> getProperties(getProperties_cb _hidl_cb) override; |
Tomasz Wasilczyk | 8b70ee4 | 2017-12-21 11:51:29 -0800 | [diff] [blame] | 35 | Return<void> getAmFmRegionConfig(bool full, getAmFmRegionConfig_cb _hidl_cb); |
| 36 | Return<void> getDabRegionConfig(getDabRegionConfig_cb _hidl_cb); |
Tomasz Wasilczyk | 06100b3 | 2017-12-04 09:53:32 -0800 | [diff] [blame] | 37 | Return<void> openSession(const sp<ITunerCallback>& callback, openSession_cb _hidl_cb) override; |
| 38 | Return<void> getImage(uint32_t id, getImage_cb _hidl_cb); |
Tomasz Wasilczyk | 6a9f856 | 2017-12-27 09:46:43 -0800 | [diff] [blame] | 39 | Return<void> registerAnnouncementObserver(const hidl_vec<AnnouncementType>& enabled, |
| 40 | const sp<IAnnouncementObserver>& cb, |
| 41 | registerAnnouncementObserver_cb _hidl_cb); |
Tomasz Wasilczyk | 06100b3 | 2017-12-04 09:53:32 -0800 | [diff] [blame] | 42 | |
| 43 | std::reference_wrapper<const VirtualRadio> mVirtualRadio; |
| 44 | Properties mProperties; |
| 45 | |
Tomasz Wasilczyk | 8b70ee4 | 2017-12-21 11:51:29 -0800 | [diff] [blame] | 46 | AmFmRegionConfig getAmFmConfig() const; |
| 47 | |
Tomasz Wasilczyk | 06100b3 | 2017-12-04 09:53:32 -0800 | [diff] [blame] | 48 | private: |
Tomasz Wasilczyk | 8b70ee4 | 2017-12-21 11:51:29 -0800 | [diff] [blame] | 49 | mutable std::mutex mMut; |
| 50 | AmFmRegionConfig mAmFmConfig; |
Tomasz Wasilczyk | 06100b3 | 2017-12-04 09:53:32 -0800 | [diff] [blame] | 51 | wp<TunerSession> mSession; |
| 52 | }; |
| 53 | |
| 54 | } // namespace implementation |
| 55 | } // namespace V2_0 |
| 56 | } // namespace broadcastradio |
| 57 | } // namespace hardware |
| 58 | } // namespace android |
| 59 | |
| 60 | #endif // ANDROID_HARDWARE_BROADCASTRADIO_V2_0_BROADCASTRADIO_H |