xref: /aosp_15_r20/system/libhwbinder/include/hwbinder/HidlSupport.h (revision 77b80299c8bdfeca3ae6d0ce27ae1ad3db289be3)
1*77b80299SAndroid Build Coastguard Worker /*
2*77b80299SAndroid Build Coastguard Worker  * Copyright (C) 2024 The Android Open Source Project
3*77b80299SAndroid Build Coastguard Worker  *
4*77b80299SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*77b80299SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*77b80299SAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*77b80299SAndroid Build Coastguard Worker  *
8*77b80299SAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
9*77b80299SAndroid Build Coastguard Worker  *
10*77b80299SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*77b80299SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*77b80299SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*77b80299SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*77b80299SAndroid Build Coastguard Worker  * limitations under the License.
15*77b80299SAndroid Build Coastguard Worker  */
16*77b80299SAndroid Build Coastguard Worker 
17*77b80299SAndroid Build Coastguard Worker #pragma once
18*77b80299SAndroid Build Coastguard Worker #include <stdint.h>
19*77b80299SAndroid Build Coastguard Worker #include <sys/cdefs.h>
20*77b80299SAndroid Build Coastguard Worker #include <sys/types.h>
21*77b80299SAndroid Build Coastguard Worker 
22*77b80299SAndroid Build Coastguard Worker // WARNING: this code is part of libhwbinder, a fork of libbinder. Generally,
23*77b80299SAndroid Build Coastguard Worker // this means that it is only relevant to HIDL. Any AIDL- or libbinder-specific
24*77b80299SAndroid Build Coastguard Worker // code should not try to use these things.
25*77b80299SAndroid Build Coastguard Worker namespace android::hardware {
26*77b80299SAndroid Build Coastguard Worker // Return whether or not hwbinder is supported on this device based on the existence
27*77b80299SAndroid Build Coastguard Worker // of hwservicemanager.
28*77b80299SAndroid Build Coastguard Worker //
29*77b80299SAndroid Build Coastguard Worker // If the service is installed on the device, this method blocks and waits for
30*77b80299SAndroid Build Coastguard Worker // hwservicemanager to be either ready or disabled.
31*77b80299SAndroid Build Coastguard Worker //
32*77b80299SAndroid Build Coastguard Worker // This function will block during early init while hwservicemanager is
33*77b80299SAndroid Build Coastguard Worker // starting. If hwbinder is supported on the device, it waill wait until
34*77b80299SAndroid Build Coastguard Worker // the hwservicemanager.ready property is set to true. If hwbinder is not supported
35*77b80299SAndroid Build Coastguard Worker // but hwservicemanager is still installed on the device, it will wait
36*77b80299SAndroid Build Coastguard Worker // until hwservicemanager.enabled is set to false.
37*77b80299SAndroid Build Coastguard Worker //
38*77b80299SAndroid Build Coastguard Worker // return - false if the service isn't installed on the device
39*77b80299SAndroid Build Coastguard Worker //          false if the service is installed, but disabled
40*77b80299SAndroid Build Coastguard Worker //          true if the service is ready
41*77b80299SAndroid Build Coastguard Worker bool isHwbinderSupportedBlocking();
42*77b80299SAndroid Build Coastguard Worker } // namespace android::hardware
43*77b80299SAndroid Build Coastguard Worker 
44