diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-15 21:51:05 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-15 21:51:05 +0000 |
commit | b7382e332185958050def3e17c5802843992a155 (patch) | |
tree | 8a5d133f1c9c6dc833bfde097a8a033bc25835e0 | |
parent | 4b355ab92e164f955e8992ee5ab447040f98fa4d (diff) | |
parent | e55dec192cc59f58a2883d4a9f694a0de59c9bf1 (diff) | |
download | libhidl-android12-mainline-tzdata3-release.tar.gz |
Snap for 8730993 from e55dec192cc59f58a2883d4a9f694a0de59c9bf1 to mainline-tzdata3-releaseaml_tz3_314012070aml_tz3_314012050aml_tz3_314012010aml_tz3_313110000aml_tz3_312511020aml_tz3_312511010aml_tz3_312410020aml_tz3_312410010android12-mainline-tzdata3-releaseaml_tz3_314012010
Change-Id: Iaae8f33d4bf457a32adfb23ba6431fc028574a87
-rw-r--r-- | Android.bp | 26 | ||||
-rw-r--r-- | OWNERS | 1 | ||||
-rw-r--r-- | adapter/Android.bp | 45 | ||||
-rw-r--r-- | adapter/HidlBinderAdapter.cpp | 237 | ||||
-rw-r--r-- | adapter/include/hidladapter/HidlBinderAdapter.h | 52 | ||||
-rw-r--r-- | base/HidlInternal.cpp | 149 | ||||
-rw-r--r-- | base/include/hidl/Status.h | 8 | ||||
-rw-r--r-- | test_main.cpp | 2 | ||||
-rw-r--r-- | transport/HidlBinderSupport.cpp | 8 | ||||
-rw-r--r-- | transport/HidlPassthroughSupport.cpp | 4 | ||||
-rw-r--r-- | transport/InternalStatic.h | 7 | ||||
-rw-r--r-- | transport/Static.cpp | 8 | ||||
-rw-r--r-- | vintfdata/frozen/6.xml | 116 | ||||
-rw-r--r-- | vintfdata/frozen/7.xml | 100 | ||||
-rw-r--r-- | vintfdata/manifest.xml | 2 |
15 files changed, 533 insertions, 232 deletions
@@ -48,8 +48,6 @@ phony { cc_library_headers { name: "libhidl_gtest_helper", - vendor_available: true, - host_supported: true, export_include_dirs: ["gtest_helper"], } @@ -58,7 +56,6 @@ cc_test { host_supported: true, defaults: ["libhidl-defaults"], gtest: false, - tidy_timeout_srcs: ["test_main.cpp"], srcs: ["test_main.cpp"], test_suites: ["device-tests"], @@ -98,7 +95,7 @@ cc_library { "//apex_available:platform", "com.android.neuralnetworks", "test_com.android.neuralnetworks", - "com.android.bluetooth", + "com.android.bluetooth.updatable", "com.android.media", "com.android.media.swcodec", "com.android.tethering", @@ -111,10 +108,23 @@ cc_library { "libhwbinder-impl-internal", ], min_sdk_version: "29", - afdo: true, - header_abi_checker: { - diff_flags: ["-allow-adding-removing-weak-symbols"], - }, +} + +// Only libhwbinder_benchmark needs to have pgo enabled. When all places +// support having PGO selectively enabled, all places can use libhwbinder. +// +// http://b/77320844 +cc_library { + name: "libhidlbase_pgo", + defaults: [ + "libhidlbase-combined-impl", + "hwbinder_benchmark_pgo", + ], + whole_static_libs: [ + "libhwbinder_pgo-impl-internal", + ], + + visibility: ["//system/libhwbinder:__subpackages__"], } // WARNING: deprecated @@ -1,4 +1,5 @@ smoreland@google.com elsk@google.com maco@google.com +hridya@google.com malchev@google.com diff --git a/adapter/Android.bp b/adapter/Android.bp new file mode 100644 index 0000000..83609ff --- /dev/null +++ b/adapter/Android.bp @@ -0,0 +1,45 @@ +// Copyright (C) 2017 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. + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "system_libhidl_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["system_libhidl_license"], +} + +cc_library { + name: "libhidladapter", + defaults: ["libhidl-defaults"], + vendor_available: true, + product_available: true, + // TODO(b/153609531): remove when no longer needed. + native_bridge_supported: true, + srcs: [ + "HidlBinderAdapter.cpp" + ], + export_include_dirs: ["include"], + shared_libs: [ + "libbase", + "libhidlbase", + "liblog", + "libutils", + ], + export_shared_lib_headers: [ + "libhidlbase", + "libutils", + ], +} diff --git a/adapter/HidlBinderAdapter.cpp b/adapter/HidlBinderAdapter.cpp new file mode 100644 index 0000000..ed6dad1 --- /dev/null +++ b/adapter/HidlBinderAdapter.cpp @@ -0,0 +1,237 @@ +/* + * Copyright (C) 2017 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. + */ + +#include <hidladapter/HidlBinderAdapter.h> + +#include <android-base/logging.h> +#include <android-base/properties.h> +#include <android/hidl/base/1.0/IBase.h> +#include <android/hidl/manager/1.0/IServiceManager.h> +#include <hidl/HidlTransportSupport.h> + +#include <unistd.h> +#include <iostream> +#include <map> +#include <string> + +namespace android { +namespace hardware { +namespace details { + +using android::base::SetProperty; +using android::base::WaitForProperty; + +const static std::string kDeactivateProp = "test.hidl.adapters.deactivated"; + +int usage(const std::string& me) { + std::cerr << "usage: " << me + << " [-p|P] [-n instance-name] interface-name instance-name number-of-threads." + << std::endl; + std::cerr << " -p: stop based on property " << kDeactivateProp << "and reset it." + << std::endl; + std::cerr << " -P: stop based on interface specific property " << kDeactivateProp + << ".<fq-name>.<instance-name>" << std::endl; + std::cerr + << " -n instance-name: register as a different instance name (does not de-register)" + << std::endl; + return EINVAL; +} + +enum class StopMethod { + NONE, + ALL, + SPECIFIC, +}; + +struct Args { + StopMethod stopMethod = StopMethod::NONE; + std::string interface; // e.x. IFoo + std::string instanceName; // e.x. default + int threadNumber; + std::string registerInstanceName; // e.x. default +}; + +bool processArguments(int argc, char** argv, Args* args) { + int c; + while ((c = getopt(argc, argv, "pPn:")) != -1) { + switch (c) { + case 'p': { + args->stopMethod = StopMethod::ALL; + break; + } + case 'P': { + args->stopMethod = StopMethod::SPECIFIC; + break; + } + case 'n': { + args->registerInstanceName = optarg; + break; + } + default: { return false; } + } + } + + argc -= optind; + argv += optind; + + if (argc != 3) { + std::cerr << "ERROR: requires exactly three positional arguments for " + "interface, instance name, and number of threads, but " + << argc << " provided." << std::endl; + return false; + } + + args->interface = argv[0]; + args->instanceName = argv[1]; + args->threadNumber = std::stoi(argv[2]); + + if (args->threadNumber <= 0) { + std::cerr << "ERROR: invalid thread number " << args->threadNumber + << " must be a positive integer." << std::endl; + return false; + } + + if (args->registerInstanceName.empty()) { + args->registerInstanceName = args->instanceName; + } + + return true; +} + +// only applies for -p argument +void waitForAdaptersDeactivated(const std::string& property) { + using std::literals::chrono_literals::operator""s; + + while (!WaitForProperty(property, "true", 30s)) { + // Log this so that when using this option on testing devices, there is + // a clear indication if adapters are not properly stopped + LOG(WARNING) << "Adapter use in progress. Waiting for stop based on 'true' " << property; + } + + SetProperty(property, "false"); +} + +int adapterMain(const std::string& package, int argc, char** argv, + const AdaptersFactory& adapters) { + using android::hardware::configureRpcThreadpool; + using android::hidl::base::V1_0::IBase; + using android::hidl::manager::V1_0::IServiceManager; + + const std::string& me = argc > 0 ? argv[0] : "(error)"; + + Args args; + if (!processArguments(argc, argv, &args)) { + return usage(me); + } + + std::string interfaceName = package + "::" + args.interface; + + auto it = adapters.find(interfaceName); + if (it == adapters.end()) { + std::cerr << "ERROR: could not resolve " << interfaceName << "." << std::endl; + return 1; + } + + std::cout << "Trying to adapt down " << interfaceName << "/" << args.instanceName << " to " + << args.registerInstanceName << std::endl; + + configureRpcThreadpool(args.threadNumber, false /* callerWillJoin */); + + sp<IServiceManager> manager = IServiceManager::getService(); + if (manager == nullptr) { + std::cerr << "ERROR: could not retrieve service manager." << std::endl; + return 1; + } + + sp<IBase> implementation = manager->get(interfaceName, args.instanceName).withDefault(nullptr); + if (implementation == nullptr) { + std::cerr << "ERROR: could not retrieve desired implementation" << std::endl; + return 1; + } + + sp<IBase> adapter = it->second(implementation); + if (adapter == nullptr) { + std::cerr << "ERROR: could not create adapter." << std::endl; + return 1; + } + + bool replaced = manager->add(args.registerInstanceName, adapter).withDefault(false); + if (!replaced) { + std::cerr << "ERROR: could not register the service with the service manager." << std::endl; + return 1; + } + + switch (args.stopMethod) { + case StopMethod::NONE: { + std::cout << "Press any key to disassociate adapter." << std::endl; + getchar(); + break; + }; + case StopMethod::SPECIFIC: { + const std::string property = + kDeactivateProp + "." + interfaceName + "." + args.registerInstanceName; + std::cout << "Set " << property << " to true to deactivate." << std::endl; + waitForAdaptersDeactivated(property); + break; + }; + case StopMethod::ALL: { + std::cout << "Set " << kDeactivateProp << " to true to deactivate." << std::endl; + waitForAdaptersDeactivated(kDeactivateProp); + break; + }; + } + + // automatically unregistered on process exit if it is a new instance name + if (args.registerInstanceName == args.instanceName) { + bool restored = manager->add(args.instanceName, implementation).withDefault(false); + if (!restored) { + std::cerr << "ERROR: could not re-register interface with the service manager." + << std::endl; + return 1; + } + } + + std::cout << "Success." << std::endl; + + return 0; +} + +// If an interface is adapted to 1.0, it can then not be adapted to 1.1 in the same process. +// This poses a problem in the following scenario: +// auto interface = new V1_1::implementation::IFoo; +// hidlObject1_0->foo(interface) // adaptation set at 1.0 +// hidlObject1_1->bar(interface) // adaptation still is 1.0 +// This could be solved by keeping a map of IBase,fqName -> IBase, but then you end up +// with multiple names for the same interface. +sp<IBase> adaptWithDefault(const sp<IBase>& something, + const std::function<sp<IBase>()>& makeDefault) { + static std::map<sp<IBase>, sp<IBase>> sAdapterMap; + + if (something == nullptr) { + return something; + } + + auto it = sAdapterMap.find(something); + if (it == sAdapterMap.end()) { + it = sAdapterMap.insert(it, {something, makeDefault()}); + } + + return it->second; +} + +} // namespace details +} // namespace hardware +} // namespace android diff --git a/adapter/include/hidladapter/HidlBinderAdapter.h b/adapter/include/hidladapter/HidlBinderAdapter.h new file mode 100644 index 0000000..46df554 --- /dev/null +++ b/adapter/include/hidladapter/HidlBinderAdapter.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2017 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. + */ + +#include <android/hidl/base/1.0/IBase.h> +#include <hidl/HidlSupport.h> + +#include <map> + +namespace android { +namespace hardware { + +namespace details { + +using IBase = ::android::hidl::base::V1_0::IBase; + +// AdapterFactory(impl) -> adapter +using AdapterFactory = std::function<sp<IBase>(sp<IBase>)>; +// AdaptersFactory(package@interface)(impl) -> adapter +using AdaptersFactory = std::map<std::string, AdapterFactory>; + +int adapterMain(const std::string& package, int argc, char** argv, const AdaptersFactory& adapters); + +sp<IBase> adaptWithDefault(const sp<IBase>& something, + const std::function<sp<IBase>()>& makeDefault); + +} // namespace details + +template <typename... Adapters> +int adapterMain(const std::string& package, int argc, char** argv) { + return details::adapterMain( + package, argc, argv, + {{Adapters::Pure::descriptor, [](sp<::android::hidl::base::V1_0::IBase> base) { + return details::adaptWithDefault( + base, [&] { return new Adapters(Adapters::Pure::castFrom(base)); }); + }}...}); +} + +} // namespace hardware +} // namespace android
\ No newline at end of file diff --git a/base/HidlInternal.cpp b/base/HidlInternal.cpp index a94f235..e5c8f70 100644 --- a/base/HidlInternal.cpp +++ b/base/HidlInternal.cpp @@ -25,6 +25,26 @@ #include <android-base/properties.h> #include <android-base/stringprintf.h> +#ifdef LIBHIDL_TARGET_DEBUGGABLE +#include <dirent.h> +#include <dlfcn.h> +#include <link.h> +#include <utils/misc.h> +#include <regex> + +extern "C" __attribute__((weak)) void __sanitizer_cov_dump(); + +const char kGcovPrefixEnvVar[] = "GCOV_PREFIX"; +const char kGcovPrefixOverrideEnvVar[] = "GCOV_PREFIX_OVERRIDE"; +const char kGcovPrefixPath[] = "/data/misc/trace/"; +const char kSysPropHalCoverage[] = "hal.coverage.enable"; +#if defined(__LP64__) +const char kSysPropInstrumentationPath[] = "hal.instrumentation.lib.path.64"; +#else +const char kSysPropInstrumentationPath[] = "hal.instrumentation.lib.path.32"; +#endif +#endif // LIBHIDL_TARGET_DEBUGGABLE + namespace android { namespace hardware { namespace details { @@ -50,7 +70,52 @@ std::string getVndkSpHwPath(const char* lib) { HidlInstrumentor::HidlInstrumentor(const std::string& package, const std::string& interface) : mEnableInstrumentation(false), mInstrumentationLibPackage(package), - mInterfaceName(interface) {} + mInterfaceName(interface) { +#ifdef LIBHIDL_TARGET_DEBUGGABLE + configureInstrumentation(false); + if (__sanitizer_cov_dump != nullptr) { + ::android::add_sysprop_change_callback( + []() { + bool enableCoverage = base::GetBoolProperty(kSysPropHalCoverage, false); + if (enableCoverage) { + __sanitizer_cov_dump(); + } + }, + 0); + } + if (base::GetBoolProperty("ro.vts.coverage", false)) { + const char* prefixOverride = getenv(kGcovPrefixOverrideEnvVar); + if (prefixOverride == nullptr || strcmp(prefixOverride, "true") != 0) { + const std::string gcovPath = kGcovPrefixPath + std::to_string(getpid()); + setenv(kGcovPrefixEnvVar, gcovPath.c_str(), true /* overwrite */); + } + ::android::add_sysprop_change_callback( + []() { + const bool enableCoverage = base::GetBoolProperty(kSysPropHalCoverage, false); + if (enableCoverage) { + dl_iterate_phdr( + [](struct dl_phdr_info* info, size_t /* size */, void* /* data */) { + if (strlen(info->dlpi_name) == 0) return 0; + + void* handle = dlopen(info->dlpi_name, RTLD_LAZY); + if (handle == nullptr) { + LOG(INFO) << "coverage dlopen failed: " << dlerror(); + return 0; + } + void (*flush)() = (void (*)())dlsym(handle, "__gcov_flush"); + if (flush == nullptr) { + return 0; + } + flush(); + return 0; + }, + nullptr /* data */); + } + }, + 0 /* priority */); + } +#endif +} HidlInstrumentor::~HidlInstrumentor() {} @@ -72,13 +137,93 @@ void HidlInstrumentor::configureInstrumentation(bool log) { void HidlInstrumentor::registerInstrumentationCallbacks( std::vector<InstrumentationCallback> *instrumentationCallbacks) { - // No-op, historical +#ifdef LIBHIDL_TARGET_DEBUGGABLE + std::vector<std::string> instrumentationLibPaths; + const std::string instrumentationLibPath = base::GetProperty(kSysPropInstrumentationPath, ""); + if (instrumentationLibPath.size() > 0) { + instrumentationLibPaths.push_back(instrumentationLibPath); + } else { + static std::string halLibPathVndkSp = getVndkSpHwPath(); +#ifndef __ANDROID_VNDK__ + instrumentationLibPaths.push_back(HAL_LIBRARY_PATH_SYSTEM); +#endif + instrumentationLibPaths.push_back(halLibPathVndkSp); + instrumentationLibPaths.push_back(HAL_LIBRARY_PATH_VENDOR); + instrumentationLibPaths.push_back(HAL_LIBRARY_PATH_ODM); + } + + for (const auto& path : instrumentationLibPaths) { + DIR *dir = opendir(path.c_str()); + if (dir == nullptr) { + LOG(WARNING) << path << " does not exist. "; + return; + } + + struct dirent *file; + while ((file = readdir(dir)) != nullptr) { + if (!isInstrumentationLib(file)) + continue; + + void *handle = dlopen((path + file->d_name).c_str(), RTLD_NOW); + char *error; + if (handle == nullptr) { + LOG(WARNING) << "couldn't load file: " << file->d_name + << " error: " << dlerror(); + continue; + } + + dlerror(); /* Clear any existing error */ + + using cbFun = void (*)( + const InstrumentationEvent, + const char *, + const char *, + const char *, + const char *, + std::vector<void *> *); + std::string package = mInstrumentationLibPackage; + for (size_t i = 0; i < package.size(); i++) { + if (package[i] == '.') { + package[i] = '_'; + continue; + } + + if (package[i] == '@') { + package[i] = '_'; + package.insert(i + 1, "V"); + continue; + } + } + auto cb = (cbFun)dlsym(handle, ("HIDL_INSTRUMENTATION_FUNCTION_" + + package + "_" + mInterfaceName).c_str()); + if ((error = dlerror()) != nullptr) { + LOG(WARNING) + << "couldn't find symbol: HIDL_INSTRUMENTATION_FUNCTION_" + << package << "_" << mInterfaceName << ", error: " << error; + continue; + } + instrumentationCallbacks->push_back(cb); + LOG(INFO) << "Register instrumentation callback from " + << file->d_name; + } + closedir(dir); + } +#else + // No-op for user builds. (void) instrumentationCallbacks; return; +#endif } bool HidlInstrumentor::isInstrumentationLib(const dirent *file) { +#ifdef LIBHIDL_TARGET_DEBUGGABLE + if (file->d_type != DT_REG) return false; + std::cmatch cm; + std::regex e("^" + mInstrumentationLibPackage + "(.*).profiler.so$"); + if (std::regex_match(file->d_name, cm, e)) return true; +#else (void) file; +#endif return false; } diff --git a/base/include/hidl/Status.h b/base/include/hidl/Status.h index a204af5..74901bb 100644 --- a/base/include/hidl/Status.h +++ b/base/include/hidl/Status.h @@ -235,7 +235,9 @@ public: return mVal; } - T withDefault(T t) const { return isOk() ? mVal : t; } + T withDefault(T t) { + return isOk() ? mVal : t; + } }; template<typename T> class Return<sp<T>> : public details::return_status { @@ -262,7 +264,9 @@ public: return mVal; } - sp<T> withDefault(sp<T> t) const { return isOk() ? mVal : t; } + sp<T> withDefault(sp<T> t) { + return isOk() ? mVal : t; + } }; diff --git a/test_main.cpp b/test_main.cpp index 8681375..5c6c78e 100644 --- a/test_main.cpp +++ b/test_main.cpp @@ -550,7 +550,7 @@ TEST_F(LibHidlTest, ReturnTest) { hidl_string one = "1"; hidl_string two = "2"; - const Return<hidl_string> ret = Return<hidl_string>(Status::fromStatusT(DEAD_OBJECT)); + Return<hidl_string> ret = Return<hidl_string>(Status::fromStatusT(DEAD_OBJECT)); EXPECT_EQ(one, Return<hidl_string>(one).withDefault(two)); EXPECT_EQ(two, ret.withDefault(two)); diff --git a/transport/HidlBinderSupport.cpp b/transport/HidlBinderSupport.cpp index 8b36f1f..b48b460 100644 --- a/transport/HidlBinderSupport.cpp +++ b/transport/HidlBinderSupport.cpp @@ -254,8 +254,12 @@ sp<IBinder> getOrCreateCachedBinder(::android::hidl::base::V1_0::IBase* ifacePtr if (sBnObj == nullptr) { auto func = details::getBnConstructorMap().get(descriptor, nullptr); - LOG_ALWAYS_FATAL_IF(func == nullptr, "%s getBnConstructorMap returned null for %s", - __func__, descriptor.c_str()); + if (!func) { + // TODO(b/69122224): remove this static variable when prebuilts updated + func = details::gBnConstructorMap->get(descriptor, nullptr); + } + LOG_ALWAYS_FATAL_IF(func == nullptr, "%s gBnConstructorMap returned null for %s", __func__, + descriptor.c_str()); sBnObj = sp<IBinder>(func(static_cast<void*>(ifacePtr))); LOG_ALWAYS_FATAL_IF(sBnObj == nullptr, "%s Bn constructor function returned null for %s", diff --git a/transport/HidlPassthroughSupport.cpp b/transport/HidlPassthroughSupport.cpp index e059b4d..6f30b7b 100644 --- a/transport/HidlPassthroughSupport.cpp +++ b/transport/HidlPassthroughSupport.cpp @@ -29,6 +29,10 @@ namespace details { static sp<IBase> tryWrap(const std::string& descriptor, sp<IBase> iface) { auto func = getBsConstructorMap().get(descriptor, nullptr); + if (!func) { + // TODO(b/69122224): remove this when prebuilts don't reference it + func = gBsConstructorMap->get(descriptor, nullptr); + } if (func) { return func(static_cast<void*>(iface.get())); } diff --git a/transport/InternalStatic.h b/transport/InternalStatic.h index a0d1c2d..666b2b6 100644 --- a/transport/InternalStatic.h +++ b/transport/InternalStatic.h @@ -28,6 +28,13 @@ namespace hardware { namespace details { // TODO(b/69122224): remove this once no prebuilts reference it +// deprecated; use getBnConstructorMap instead. +extern DoNotDestruct<BnConstructorMap> gBnConstructorMap; +// TODO(b/69122224): remove this once no prebuilts reference it +// deprecated; use getBsConstructorMap instead. +extern DoNotDestruct<BsConstructorMap> gBsConstructorMap; + +// TODO(b/69122224): remove this once no prebuilts reference it extern DoNotDestruct<ConcurrentMap<wp<::android::hidl::base::V1_0::IBase>, SchedPrio>> gServicePrioMap; // TODO(b/69122224): remove this once no prebuilts reference it diff --git a/transport/Static.cpp b/transport/Static.cpp index fe7c0f0..240d196 100644 --- a/transport/Static.cpp +++ b/transport/Static.cpp @@ -27,6 +27,9 @@ namespace android { namespace hardware { namespace details { +// Deprecated; kept for ABI compatibility. Use getBnConstructorMap. +DoNotDestruct<BnConstructorMap> gBnConstructorMap{}; + DoNotDestruct<ConcurrentMap<const ::android::hidl::base::V1_0::IBase*, wp<::android::hardware::BHwBinder>>> gBnMap{}; @@ -35,6 +38,11 @@ DoNotDestruct<ConcurrentMap<const ::android::hidl::base::V1_0::IBase*, DoNotDestruct<ConcurrentMap<wp<::android::hidl::base::V1_0::IBase>, SchedPrio>> gServicePrioMap{}; DoNotDestruct<ConcurrentMap<wp<::android::hidl::base::V1_0::IBase>, bool>> gServiceSidMap{}; +// Deprecated; kept for ABI compatibility. Use getBsConstructorMap. +DoNotDestruct<BsConstructorMap> gBsConstructorMap{}; + +// For static executables, it is not guaranteed that gBnConstructorMap are initialized before +// used in HAL definition libraries. BnConstructorMap& getBnConstructorMap() { static BnConstructorMap& map = *new BnConstructorMap(); return map; diff --git a/vintfdata/frozen/6.xml b/vintfdata/frozen/6.xml deleted file mode 100644 index eb078c0..0000000 --- a/vintfdata/frozen/6.xml +++ /dev/null @@ -1,116 +0,0 @@ -<compatibility-matrix version="5.0" type="device"> - <!-- - cameraserver is installed for all phones and tablets, but not - auto or TV. - --> - <hal format="hidl" optional="true"> - <name>android.frameworks.cameraservice.service</name> - <version>2.2</version> - <interface> - <name>ICameraService</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.frameworks.displayservice</name> - <version>1.0</version> - <interface> - <name>IDisplayService</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.frameworks.sensorservice</name> - <version>1.0</version> - <interface> - <name>ISensorManager</name> - <instance>default</instance> - </interface> - </hal> - <hal format="aidl" optional="false"> - <name>android.frameworks.stats</name> - <interface> - <name>IStats</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.hardware.media.c2</name> - <version>1.2</version> - <interface> - <name>IComponentStore</name> - <instance>software</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.hidl.allocator</name> - <version>1.0</version> - <interface> - <name>IAllocator</name> - <instance>ashmem</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.hidl.manager</name> - <version>1.2</version> - <interface> - <name>IServiceManager</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.hidl.memory</name> - <version>1.0</version> - <interface> - <name>IMapper</name> - <instance>ashmem</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.hidl.token</name> - <version>1.0</version> - <interface> - <name>ITokenManager</name> - <instance>default</instance> - </interface> - </hal> - <hal format="aidl" optional="false"> - <name>android.system.keystore2</name> - <version>2</version> - <interface> - <name>IKeystoreService</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.system.net.netd</name> - <version>1.1</version> - <interface> - <name>INetd</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.system.suspend</name> - <version>1.0</version> - <interface> - <name>ISystemSuspend</name> - <instance>default</instance> - </interface> - </hal> - <hal format="aidl" optional="false"> - <name>android.system.suspend</name> - <interface> - <name>ISystemSuspend</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.system.wifi.keystore</name> - <version>1.0</version> - <interface> - <name>IKeystore</name> - <instance>default</instance> - </interface> - </hal> -</compatibility-matrix> diff --git a/vintfdata/frozen/7.xml b/vintfdata/frozen/7.xml deleted file mode 100644 index fcfeba7..0000000 --- a/vintfdata/frozen/7.xml +++ /dev/null @@ -1,100 +0,0 @@ -<compatibility-matrix version="5.0" type="device"> - <!-- - cameraserver is installed for all phones and tablets, but not - auto or TV. - --> - <hal format="hidl" optional="true"> - <name>android.frameworks.cameraservice.service</name> - <version>2.2</version> - <interface> - <name>ICameraService</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.frameworks.sensorservice</name> - <version>1.0</version> - <interface> - <name>ISensorManager</name> - <instance>default</instance> - </interface> - </hal> - <hal format="aidl" optional="false"> - <name>android.frameworks.stats</name> - <interface> - <name>IStats</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.hardware.media.c2</name> - <version>1.2</version> - <interface> - <name>IComponentStore</name> - <instance>software</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.hidl.allocator</name> - <version>1.0</version> - <interface> - <name>IAllocator</name> - <instance>ashmem</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.hidl.manager</name> - <version>1.2</version> - <interface> - <name>IServiceManager</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.hidl.memory</name> - <version>1.0</version> - <interface> - <name>IMapper</name> - <instance>ashmem</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.hidl.token</name> - <version>1.0</version> - <interface> - <name>ITokenManager</name> - <instance>default</instance> - </interface> - </hal> - <hal format="aidl" optional="false"> - <name>android.system.keystore2</name> - <version>2</version> - <interface> - <name>IKeystoreService</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.system.net.netd</name> - <version>1.1</version> - <interface> - <name>INetd</name> - <instance>default</instance> - </interface> - </hal> - <hal format="aidl" optional="false"> - <name>android.system.suspend</name> - <interface> - <name>ISystemSuspend</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> - <name>android.system.wifi.keystore</name> - <version>1.0</version> - <interface> - <name>IKeystore</name> - <instance>default</instance> - </interface> - </hal> -</compatibility-matrix> diff --git a/vintfdata/manifest.xml b/vintfdata/manifest.xml index 9d7bfcb..8fd69b9 100644 --- a/vintfdata/manifest.xml +++ b/vintfdata/manifest.xml @@ -26,7 +26,7 @@ <instance>default</instance> </interface> </hal> - <hal max-level="6"> + <hal> <name>android.frameworks.displayservice</name> <transport>hwbinder</transport> <version>1.0</version> |