blob: c1e32c111f597ad9314943676718992051ea6822 [file] [log] [blame]
Tomasz Wasilczyk6301e8f2021-10-18 16:53:40 -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
Tomasz Wasilczyk6902a752021-12-13 17:13:48 -080017#include <libradiocompat/RadioConfigIndication.h>
Tomasz Wasilczyk6301e8f2021-10-18 16:53:40 -070018
19#include "commonStructs.h"
20#include "debug.h"
21#include "structs.h"
22
23#include "collections.h"
24
25#define RADIO_MODULE "ConfigIndication"
26
27namespace android::hardware::radio::compat {
28
29namespace aidl = ::aidl::android::hardware::radio::config;
30
Tomasz Wasilczyk6902a752021-12-13 17:13:48 -080031void RadioConfigIndication::setResponseFunction(
32 std::shared_ptr<aidl::IRadioConfigIndication> callback) {
33 mCallback = callback;
34}
35
36std::shared_ptr<aidl::IRadioConfigIndication> RadioConfigIndication::indicate() {
37 return mCallback.get();
38}
Tomasz Wasilczyk6301e8f2021-10-18 16:53:40 -070039
40Return<void> RadioConfigIndication::simSlotsStatusChanged(
41 V1_0::RadioIndicationType type, const hidl_vec<config::V1_0::SimSlotStatus>& slotStatus) {
42 LOG_CALL << type;
Tomasz Wasilczyk6902a752021-12-13 17:13:48 -080043 indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
Tomasz Wasilczyk6301e8f2021-10-18 16:53:40 -070044 return {};
45}
46
47Return<void> RadioConfigIndication::simSlotsStatusChanged_1_2(
48 V1_0::RadioIndicationType type, const hidl_vec<config::V1_2::SimSlotStatus>& slotStatus) {
49 LOG_CALL << type;
Tomasz Wasilczyk6902a752021-12-13 17:13:48 -080050 indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
Tomasz Wasilczyk6301e8f2021-10-18 16:53:40 -070051 return {};
52}
53
54} // namespace android::hardware::radio::compat