blob: a680e562abe4acea6dfe7a494c61f16fad89e3f7 [file] [log] [blame]
Tomasz Wasilczyk07161692021-11-02 12:14:52 -07001/*
2 * Copyright (C) 2021 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
17#include <libradiocompat/RadioIndication.h>
18
19#include "commonStructs.h"
20#include "debug.h"
21#include "structs.h"
22
23#include "collections.h"
24
25#define RADIO_MODULE "DataIndication"
26
27namespace android::hardware::radio::compat {
28
29namespace aidl = ::aidl::android::hardware::radio::data;
30
31void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioDataIndication> dataCb) {
32 CHECK(dataCb);
33 mDataCb = dataCb;
34}
35
36Return<void> RadioIndication::dataCallListChanged(V1_0::RadioIndicationType type,
37 const hidl_vec<V1_0::SetupDataCallResult>&) {
38 LOG_CALL << type;
39 LOG(ERROR) << "IRadio HAL 1.0 not supported";
40 return {};
41}
42
43Return<void> RadioIndication::dataCallListChanged_1_4(V1_0::RadioIndicationType type,
44 const hidl_vec<V1_4::SetupDataCallResult>&) {
45 LOG_CALL << type;
46 LOG(ERROR) << "IRadio HAL 1.4 not supported";
47 return {};
48}
49
50Return<void> RadioIndication::dataCallListChanged_1_5(
51 V1_0::RadioIndicationType type, const hidl_vec<V1_5::SetupDataCallResult>& dcList) {
52 LOG_CALL << type;
53 CHECK_CB(mDataCb);
54 mDataCb->dataCallListChanged(toAidl(type), toAidl(dcList));
55 return {};
56}
57
58Return<void> RadioIndication::dataCallListChanged_1_6(
59 V1_0::RadioIndicationType type, const hidl_vec<V1_6::SetupDataCallResult>& dcList) {
60 LOG_CALL << type;
61 CHECK_CB(mDataCb);
62 mDataCb->dataCallListChanged(toAidl(type), toAidl(dcList));
63 return {};
64}
65
66Return<void> RadioIndication::keepaliveStatus(V1_0::RadioIndicationType type,
67 const V1_1::KeepaliveStatus& status) {
68 LOG_CALL << type;
69 CHECK_CB(mDataCb);
70 mDataCb->keepaliveStatus(toAidl(type), toAidl(status));
71 return {};
72}
73
74Return<void> RadioIndication::pcoData(V1_0::RadioIndicationType type,
75 const V1_0::PcoDataInfo& pco) {
76 LOG_CALL << type;
77 CHECK_CB(mDataCb);
78 mDataCb->pcoData(toAidl(type), toAidl(pco));
79 return {};
80}
81
82Return<void> RadioIndication::unthrottleApn(V1_0::RadioIndicationType type,
83 const hidl_string& apn) {
84 LOG_CALL << type;
85 CHECK_CB(mDataCb);
Sarah Chine98dd0e2021-12-09 00:33:37 -080086 mDataCb->unthrottleApn(toAidl(type), mContext->getDataProfile(apn));
Tomasz Wasilczyk07161692021-11-02 12:14:52 -070087 return {};
88}
89
90} // namespace android::hardware::radio::compat