blob: fcf06155e830399e4d53a6c1ee97467b3b8404f0 [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;
35 Return<void> openSession(const sp<ITunerCallback>& callback, openSession_cb _hidl_cb) override;
36 Return<void> getImage(uint32_t id, getImage_cb _hidl_cb);
37
38 std::reference_wrapper<const VirtualRadio> mVirtualRadio;
39 Properties mProperties;
40
41 private:
42 std::mutex mMut;
43 wp<TunerSession> mSession;
44};
45
46} // namespace implementation
47} // namespace V2_0
48} // namespace broadcastradio
49} // namespace hardware
50} // namespace android
51
52#endif // ANDROID_HARDWARE_BROADCASTRADIO_V2_0_BROADCASTRADIO_H