From 8fc34c4a4dd6505f7e7571e434291c830025a4b6 Mon Sep 17 00:00:00 2001 From: William Escande Date: Mon, 13 Nov 2023 16:17:11 -0800 Subject: Sysprop: wrap usage because of Floss Test: m Bluetooth | No-op change Bug: 310741104 Change-Id: I95d113e90ba710d687722f846f52011950bf3f5d --- sysprop/Android.bp | 11 +++++++ .../exported_include/android_bluetooth_sysprop.h | 35 ++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 sysprop/exported_include/android_bluetooth_sysprop.h (limited to 'sysprop') diff --git a/sysprop/Android.bp b/sysprop/Android.bp index 4f848817f2..76750c9220 100644 --- a/sysprop/Android.bp +++ b/sysprop/Android.bp @@ -20,3 +20,14 @@ sysprop_library { }, apex_available: ["com.android.btservices"], } + +cc_library_static { + name: "libcom.android.sysprop.bluetooth.wrapped", + host_supported: true, + whole_static_libs: ["libcom.android.sysprop.bluetooth"], + export_include_dirs: ["exported_include"], + export_static_lib_headers: ["libcom.android.sysprop.bluetooth"], + visibility: ["//packages/modules/Bluetooth/system:__subpackages__"], + apex_available: ["com.android.btservices"], + min_sdk_version: "Tiramisu", +} diff --git a/sysprop/exported_include/android_bluetooth_sysprop.h b/sysprop/exported_include/android_bluetooth_sysprop.h new file mode 100644 index 0000000000..3a3ccda8fe --- /dev/null +++ b/sysprop/exported_include/android_bluetooth_sysprop.h @@ -0,0 +1,35 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#ifndef TARGET_FLOSS + +#include +#include +#include +#include +#include +#include + +#define GET_SYSPROP(namespace, prop, default) \ + android::sysprop::bluetooth::namespace ::prop().value_or(default) + +#else + +#define GET_SYSPROP(namespace, prop, default) default + +#endif -- cgit v1.2.3-59-g8ed1b