1 /*
2 * Copyright (C) 2024 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 "RadioConfig.h"
18
19 #include <aidl/android/hardware/radio/sim/CardStatus.h>
20 #include <libminradio/debug.h>
21 #include <libminradio/response.h>
22
23 #define RADIO_MODULE "ConfigImpl"
24
25 namespace android::hardware::radio::service {
26
27 using ::android::hardware::radio::minimal::noError;
28 using ::ndk::ScopedAStatus;
29 namespace aidl = ::aidl::android::hardware::radio::config;
30 namespace aidlSim = ::aidl::android::hardware::radio::sim;
31 constexpr auto ok = &ScopedAStatus::ok;
32
getSimSlotsStatus(int32_t serial)33 ScopedAStatus RadioConfig::getSimSlotsStatus(int32_t serial) {
34 LOG_CALL;
35 aidl::SimSlotStatus simslot1Status{
36 .cardState = aidlSim::CardStatus::STATE_PRESENT,
37 .atr = "",
38 .eid = "eUICC-simslot1",
39 .portInfo = {{
40 .iccId = "12345678901234567890",
41 .logicalSlotId = 0,
42 .portActive = true,
43 }},
44 };
45 respond()->getSimSlotsStatusResponse(noError(serial), {simslot1Status});
46 return ok();
47 }
48
49 } // namespace android::hardware::radio::service
50