summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-05-26 10:26:44 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-05-26 10:26:44 +0000
commitcac4411a9565732861de7401bbcb40b1061b18be (patch)
tree08fcfc91f5c566e90c6eb0085797c70d0441e11f
parent6d271eb9186627da92b61a93f743d8d33fb507f7 (diff)
parent48fb928597abc5e50b830e18767ad520340f9a7e (diff)
downloadlibhidl-cac4411a9565732861de7401bbcb40b1061b18be.tar.gz
Snap for 10209341 from 48fb928597abc5e50b830e18767ad520340f9a7e to mainline-healthfitness-release
Change-Id: I068405bd653040f8991e82c79ae03b93d7032c9f
-rw-r--r--TEST_MAPPING4
-rw-r--r--base/include/hidl/TaskRunner.h1
-rw-r--r--transport/base/1.0/vts/functional/vts_ibase_test.cpp22
-rw-r--r--vintfdata/frozen/8.xml101
4 files changed, 125 insertions, 3 deletions
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 22c9d36..733e1b7 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -11,7 +11,9 @@
},
{
"name": "hidl_lazy_test"
+ },
+ {
+ "name": "vts_ibase_test"
}
]
}
-
diff --git a/base/include/hidl/TaskRunner.h b/base/include/hidl/TaskRunner.h
index 6a79ebf..f3ea92f 100644
--- a/base/include/hidl/TaskRunner.h
+++ b/base/include/hidl/TaskRunner.h
@@ -16,6 +16,7 @@
#ifndef ANDROID_HIDL_TASK_RUNNER_H
#define ANDROID_HIDL_TASK_RUNNER_H
+#include <functional>
#include <memory>
#include <thread>
diff --git a/transport/base/1.0/vts/functional/vts_ibase_test.cpp b/transport/base/1.0/vts/functional/vts_ibase_test.cpp
index 6372631..96125d0 100644
--- a/transport/base/1.0/vts/functional/vts_ibase_test.cpp
+++ b/transport/base/1.0/vts/functional/vts_ibase_test.cpp
@@ -81,7 +81,7 @@ pid_t GetServiceDebugPid(const std::string& service) {
std::map<std::string, std::vector<Hal>> gDeclaredServiceHalMap;
std::mutex gDeclaredServiceHalMapMutex;
-void GetHal(const std::string& service, const FqInstance& instance) {
+void GetHal(const sp<IServiceManager> &manager, const std::string& service, const FqInstance& instance) {
if (instance.getFqName().string() == IBase::descriptor) {
return;
}
@@ -89,6 +89,23 @@ void GetHal(const std::string& service, const FqInstance& instance) {
sp<IBase> hal = android::hardware::details::getRawServiceInternal(
instance.getFqName().string(), instance.getInstance(), true /*retry*/,
false /*getStub*/);
+
+ // Check transport of manifest to support hardware SKU:
+ // Don't add service to gDeclaredServiceHalMap if hal instance is null and
+ // the transport of the declared interface is not present in manifest. Because
+ // manufacturer may disable this hal service in the current hardware SKU,
+ // but enable it in the other hardware SKU.
+ if (hal == nullptr && manager != nullptr) {
+ auto transport = manager->getTransport(instance.getFqName().string(),
+ instance.getInstance());
+ if(transport == IServiceManager::Transport::EMPTY){
+ LOG(WARNING)
+ << "Ignore, because Service '" << service << "' is not running,"
+ << " its interface '" << instance.string() << "' is not present in manifest.";
+ return;
+ }
+ }
+
// Add to gDeclaredServiceHalMap if getRawServiceInternal() returns (even if
// the returned HAL is null). getRawServiceInternal() won't return if the
// HAL is in the VINTF but unable to start.
@@ -235,6 +252,7 @@ TEST_F(VtsHalBaseV1_0TargetTest, ServiceProvidesAndDeclaresTheSameInterfaces) {
const Result<ServiceInterfacesMap> service_interfaces_map =
android::init::GetOnDeviceServiceInterfacesMap();
ASSERT_RESULT_OK(service_interfaces_map);
+ auto service_manager = ::android::hardware::defaultServiceManager();
std::map<std::string, std::set<FqInstance>> hidl_interfaces_map;
@@ -253,7 +271,7 @@ TEST_F(VtsHalBaseV1_0TargetTest, ServiceProvidesAndDeclaresTheSameInterfaces) {
ASSERT_TRUE(fqInstance.setTo(interface))
<< "Unable to parse interface: '" << interface << "'";
- std::thread(GetHal, service, fqInstance).detach();
+ std::thread(GetHal, service_manager, service, fqInstance).detach();
hidl_interfaces_map[service].insert(fqInstance);
}
}
diff --git a/vintfdata/frozen/8.xml b/vintfdata/frozen/8.xml
new file mode 100644
index 0000000..db34f63
--- /dev/null
+++ b/vintfdata/frozen/8.xml
@@ -0,0 +1,101 @@
+<compatibility-matrix version="7.0" type="device">
+ <hal format="aidl" optional="false">
+ <name>android.frameworks.cameraservice.service</name>
+ <interface>
+ <name>ICameraService</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="false">
+ <name>android.frameworks.location.altitude</name>
+ <interface>
+ <name>IAltitudeService</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="false">
+ <name>android.frameworks.sensorservice</name>
+ <interface>
+ <name>ISensorManager</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>
+ <version>2</version>
+ <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>3</version>
+ <interface>
+ <name>IKeystoreService</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="false">
+ <name>android.system.net.netd</name>
+ <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>
+</compatibility-matrix>