• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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 <log/log_radio.h>
18 
19 #include "makeRadioResponseInfo.h"
20 
21 namespace aidl {
22 namespace android {
23 namespace hardware {
24 namespace radio {
25 namespace implementation {
26 
makeRadioResponseInfo(const int32_t serial,const RadioError e)27 RadioResponseInfo makeRadioResponseInfo(const int32_t serial,
28                                         const RadioError e) {
29     return {
30         .type = RadioResponseType::SOLICITED,
31         .serial = serial,
32         .error = e,
33     };
34 }
35 
makeRadioResponseInfo(const int32_t serial)36 RadioResponseInfo makeRadioResponseInfo(const int32_t serial) {
37     return makeRadioResponseInfo(serial, RadioError::NONE);
38 }
39 
makeRadioResponseInfoUnsupported(const int32_t serial,const char * const klass,const char * const method)40 RadioResponseInfo makeRadioResponseInfoUnsupported(const int32_t serial,
41                                                    const char* const klass,
42                                                    const char* const method) {
43     RLOGE("%s::%s is not supported", klass, method);
44     return makeRadioResponseInfo(serial, RadioError::REQUEST_NOT_SUPPORTED);
45 }
46 
47 }  // namespace implementation
48 }  // namespace radio
49 }  // namespace hardware
50 }  // namespace android
51 }  // namespace aidl
52