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 "RadioModem.h"
18
19 #include <libminradio/debug.h>
20 #include <libminradio/response.h>
21
22 #define RADIO_MODULE "ModemImpl"
23
24 namespace android::hardware::radio::service {
25
26 using ::aidl::android::hardware::radio::RadioTechnology;
27 using ::android::hardware::radio::minimal::noError;
28 using ::ndk::ScopedAStatus;
29 namespace aidl = ::aidl::android::hardware::radio::modem;
30 constexpr auto ok = &ScopedAStatus::ok;
31
RadioModem(std::shared_ptr<minimal::SlotContext> context)32 RadioModem::RadioModem(std::shared_ptr<minimal::SlotContext> context)
33 : minimal::RadioModem(context, {{RadioTechnology::LTE, RadioTechnology::HSPA}}) {}
34
getImei(int32_t serial)35 ScopedAStatus RadioModem::getImei(int32_t serial) {
36 LOG_CALL;
37 aidl::ImeiInfo info{
38 .type = aidl::ImeiInfo::ImeiType::PRIMARY,
39 .imei = "867400022047199",
40 .svn = "01",
41 };
42 respond()->getImeiResponse(noError(serial), info);
43 return ok();
44 }
45
46 } // namespace android::hardware::radio::service
47