blob: 8c14d9e6627e5cbcbb0cc4345f54a8faf14c8daf [file] [log] [blame]
Tomasz Wasilczyk06100b32017-12-04 09:53:32 -08001/*
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
24namespace android {
25namespace hardware {
26namespace broadcastradio {
27namespace V2_0 {
28namespace implementation {
29
30struct BroadcastRadio : public IBroadcastRadio {
31 BroadcastRadio(const VirtualRadio& virtualRadio);
32
33 // V2_0::IBroadcastRadio methods
34 Return<void> getProperties(getProperties_cb _hidl_cb) override;
Tomasz Wasilczyk8b70ee42017-12-21 11:51:29 -080035 Return<void> getAmFmRegionConfig(bool full, getAmFmRegionConfig_cb _hidl_cb);
36 Return<void> getDabRegionConfig(getDabRegionConfig_cb _hidl_cb);
Tomasz Wasilczyk06100b32017-12-04 09:53:32 -080037 Return<void> openSession(const sp<ITunerCallback>& callback, openSession_cb _hidl_cb) override;
38 Return<void> getImage(uint32_t id, getImage_cb _hidl_cb);
Tomasz Wasilczyk0d5ef5d2018-01-10 10:58:20 -080039 Return<void> registerAnnouncementListener(const hidl_vec<AnnouncementType>& enabled,
40 const sp<IAnnouncementListener>& listener,
41 registerAnnouncementListener_cb _hidl_cb);
Tomasz Wasilczyk06100b32017-12-04 09:53:32 -080042
43 std::reference_wrapper<const VirtualRadio> mVirtualRadio;
44 Properties mProperties;
45
Tomasz Wasilczyk8b70ee42017-12-21 11:51:29 -080046 AmFmRegionConfig getAmFmConfig() const;
47
Tomasz Wasilczyk06100b32017-12-04 09:53:32 -080048 private:
Tomasz Wasilczyk8b70ee42017-12-21 11:51:29 -080049 mutable std::mutex mMut;
50 AmFmRegionConfig mAmFmConfig;
Tomasz Wasilczyk06100b32017-12-04 09:53:32 -080051 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