1 /*
2  * Copyright (C) 2018 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 #pragma once
18 
19 #include <stddef.h>
20 #include <sys/socket.h>
21 #include <sys/types.h>
22 
23 #include <string>
24 
25 #include <android-base/properties.h>
26 
27 // android/api-level.h
28 #define __ANDROID_API_P__ 28
29 #define __ANDROID_API_Q__ 29
30 #define __ANDROID_API_R__ 30
31 
32 // sys/system_properties.h
33 #define PROP_VALUE_MAX 92
34 
35 namespace android {
36 namespace init {
37 
38 // property_service.h
CanReadProperty(const std::string &,const std::string &)39 inline bool CanReadProperty(const std::string&, const std::string&) {
40     return true;
41 }
42 
43 // reboot_utils.h
SetFatalRebootTarget()44 inline void SetFatalRebootTarget() {}
InitFatalReboot(int signal_number)45 inline void __attribute__((noreturn)) InitFatalReboot(int signal_number) {
46     abort();
47 }
48 
49 // selabel.h
SelabelInitialize()50 inline void SelabelInitialize() {}
SelabelLookupFileContext(const std::string &,int,std::string *)51 inline bool SelabelLookupFileContext(const std::string&, int, std::string*) {
52     return false;
53 }
54 
55 // selinux.h
SelinuxGetVendorAndroidVersion()56 inline int SelinuxGetVendorAndroidVersion() {
57     return 10000;
58 }
59 
60 }  // namespace init
61 }  // namespace android
62