From ac83e9060832559c1d91464bea9360a1711bfbd6 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 27 Apr 2022 13:06:35 -0700 Subject: Freeze framework manifest for S. Generated by: system/libhidl/vintfdata/freeze.sh 6 ... then manually editing the following: - android.frameworks.cameraservice.service is set to optional for other verticals. Summary of changes comparing to 5.xml - schedulerservice@1.0 - HIDL stats@1.0 + AIDL stats@1 - media.c2@1.1 + media.c2@1.2 + keystore2@2 + AIDL system.suspend Test: TH Bug: 203103997 Change-Id: I93cccbefb0fb45fcfbf181ac03a41e30d77abab1 Merged-In: I93cccbefb0fb45fcfbf181ac03a41e30d77abab1 --- vintfdata/frozen/6.xml | 112 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 vintfdata/frozen/6.xml diff --git a/vintfdata/frozen/6.xml b/vintfdata/frozen/6.xml new file mode 100644 index 0000000..14ace95 --- /dev/null +++ b/vintfdata/frozen/6.xml @@ -0,0 +1,112 @@ + + + android.frameworks.cameraservice.service + 2.2 + + ICameraService + default + + + + android.frameworks.displayservice + 1.0 + + IDisplayService + default + + + + android.frameworks.sensorservice + 1.0 + + ISensorManager + default + + + + android.frameworks.stats + + IStats + default + + + + android.hardware.media.c2 + 1.2 + + IComponentStore + software + + + + android.hidl.allocator + 1.0 + + IAllocator + ashmem + + + + android.hidl.manager + 1.2 + + IServiceManager + default + + + + android.hidl.memory + 1.0 + + IMapper + ashmem + + + + android.hidl.token + 1.0 + + ITokenManager + default + + + + android.system.keystore2 + 2 + + IKeystoreService + default + + + + android.system.net.netd + 1.1 + + INetd + default + + + + android.system.suspend + 1.0 + + ISystemSuspend + default + + + + android.system.suspend + + ISystemSuspend + default + + + + android.system.wifi.keystore + 1.0 + + IKeystore + default + + + -- cgit v1.2.3 From 7c806dbc3a63680e88018a76336c833524a74293 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 28 Apr 2022 11:28:39 -0700 Subject: Fix frozen framework manifest for S. cameraservice needs to be optional for other verticals. Test: lunch r11 && m check-vintf-all Bug: 203103997 Fixes: 230682426 Change-Id: Idef5b8e9fffc9cd2bac413a355ba2a1382728558 Merged-In: Idef5b8e9fffc9cd2bac413a355ba2a1382728558 --- vintfdata/frozen/6.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vintfdata/frozen/6.xml b/vintfdata/frozen/6.xml index 14ace95..eb078c0 100644 --- a/vintfdata/frozen/6.xml +++ b/vintfdata/frozen/6.xml @@ -1,5 +1,9 @@ - + + android.frameworks.cameraservice.service 2.2 -- cgit v1.2.3 From 8b089250a74426561e7fb777a05e97f57a15574c Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 27 Apr 2022 13:06:35 -0700 Subject: Freeze framework manifest for T. Generated by: system/libhidl/vintfdata/freeze.sh 7 ... then manually editing the following: - android.frameworks.cameraservice.service is set to optional for other verticals. Changes comparing to 6.xml: - displayservice@1.0 - HIDL system.suspend@1.0 Test: TH Bug: 203103997 Change-Id: Ia9678bae9679d3d952cadebfdecdb6a800b2dc14 Merged-In: Ia9678bae9679d3d952cadebfdecdb6a800b2dc14 --- vintfdata/frozen/7.xml | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 vintfdata/frozen/7.xml diff --git a/vintfdata/frozen/7.xml b/vintfdata/frozen/7.xml new file mode 100644 index 0000000..fcfeba7 --- /dev/null +++ b/vintfdata/frozen/7.xml @@ -0,0 +1,100 @@ + + + + android.frameworks.cameraservice.service + 2.2 + + ICameraService + default + + + + android.frameworks.sensorservice + 1.0 + + ISensorManager + default + + + + android.frameworks.stats + + IStats + default + + + + android.hardware.media.c2 + 1.2 + + IComponentStore + software + + + + android.hidl.allocator + 1.0 + + IAllocator + ashmem + + + + android.hidl.manager + 1.2 + + IServiceManager + default + + + + android.hidl.memory + 1.0 + + IMapper + ashmem + + + + android.hidl.token + 1.0 + + ITokenManager + default + + + + android.system.keystore2 + 2 + + IKeystoreService + default + + + + android.system.net.netd + 1.1 + + INetd + default + + + + android.system.suspend + + ISystemSuspend + default + + + + android.system.wifi.keystore + 1.0 + + IKeystore + default + + + -- cgit v1.2.3 From 6ce6dae673cc571eb05fcff2243b301148f7f618 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 28 Apr 2022 11:28:39 -0700 Subject: Fix frozen framework manifest for S. cameraservice needs to be optional for other verticals. Test: lunch r11 && m check-vintf-all Bug: 203103997 Fixes: 230682426 Change-Id: Idef5b8e9fffc9cd2bac413a355ba2a1382728558 Merged-In: Idef5b8e9fffc9cd2bac413a355ba2a1382728558 (cherry picked from commit e8df41e5e280628ca4ab504961d6eea9d643261f) --- vintfdata/frozen/6.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vintfdata/frozen/6.xml b/vintfdata/frozen/6.xml index 14ace95..eb078c0 100644 --- a/vintfdata/frozen/6.xml +++ b/vintfdata/frozen/6.xml @@ -1,5 +1,9 @@ - + + android.frameworks.cameraservice.service 2.2 -- cgit v1.2.3 From e1973ce31a37a74bcae1b0f45905dba02c059e81 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Fri, 15 Apr 2022 20:54:03 +0000 Subject: Add a fake hwservicemanager for running w/o hwservicemanager If hwservicemanager is not installed on a device, we can return this fake hwservicemanager instance when clients ask for it. This instance doesn't do anything when used, but allows client code to remain the same to support devices that still have hwservicemanager installed. Bug: 218588089 Test: boot cuttlefish with and without hwservicemanager Change-Id: Ie8efbaad0e6b1d399f54ffb73a8a58334afe535f --- transport/ServiceManagement.cpp | 116 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp index c638279..5d1979f 100644 --- a/transport/ServiceManagement.cpp +++ b/transport/ServiceManagement.cpp @@ -59,6 +59,7 @@ using IServiceManager1_0 = android::hidl::manager::V1_0::IServiceManager; using IServiceManager1_1 = android::hidl::manager::V1_1::IServiceManager; using IServiceManager1_2 = android::hidl::manager::V1_2::IServiceManager; using ::android::hidl::manager::V1_0::IServiceNotification; +using ::android::hidl::manager::V1_2::IClientCallback; namespace android { namespace hardware { @@ -201,6 +202,109 @@ sp defaultServiceManager() { sp defaultServiceManager1_1() { return defaultServiceManager1_2(); } +static bool isServiceManager(const hidl_string& fqName) { + return fqName == IServiceManager1_0::descriptor || fqName == IServiceManager1_1::descriptor || + fqName == IServiceManager1_2::descriptor; +} +static bool isHwServiceManagerInstalled() { + return access("/system/bin/hwservicemanager", F_OK) == 0; +} + +/* + * A replacement for hwservicemanager when it is not installed on a device. + * + * Clients in the framework need to continue supporting HIDL services through + * hwservicemanager for upgrading devices. Being unable to get an instance of + * hardware service manager is a hard error, so this implementation is returned + * to be able service the requests and tell clients there are no services + * registered. + */ +struct NoHwServiceManager : public IServiceManager1_2 { + Return> get(const hidl_string& fqName, const hidl_string&) override { + sp ret = nullptr; + + if (isServiceManager(fqName)) { + ret = defaultServiceManager1_2(); + } + return ret; + } + + Return add(const hidl_string& name, const sp& /* service */) override { + LOG(INFO) << "Cannot add " << name << " without hwservicemanager"; + return false; + } + + Return getTransport(const hidl_string& fqName, const hidl_string& name) { + LOG(INFO) << "Trying to get transport of " << fqName << "/" << name + << " without hwservicemanager"; + return Transport::PASSTHROUGH; + } + + Return list(list_cb _hidl_cb) override { + _hidl_cb({}); + LOG(INFO) << "Cannot list all services without hwservicemanager"; + return Void(); + } + Return listByInterface(const hidl_string& fqName, listByInterface_cb _hidl_cb) override { + _hidl_cb({}); + LOG(INFO) << "Cannot list service " << fqName << " without hwservicemanager"; + return Void(); + } + + Return registerForNotifications(const hidl_string& fqName, const hidl_string& name, + const sp& /* callback */) override { + LOG(INFO) << "Cannot register for notifications for " << fqName << "/" << name + << " without hwservicemanager"; + return false; + } + + Return debugDump(debugDump_cb _hidl_cb) override { + _hidl_cb({}); + return Void(); + } + + Return registerPassthroughClient(const hidl_string& fqName, + const hidl_string& name) override { + LOG(INFO) << "This process is a client of " << fqName << "/" << name + << " passthrough HAL, but it won't show up in lshal because hwservicemanager is " + "not installed"; + return Void(); + } + + Return unregisterForNotifications( + const hidl_string& fqName, const hidl_string& name, + const sp& /* callback */) override { + LOG(INFO) << "Cannot unregister for notifications for " << fqName << "/" << name + << " without hwservicemanager"; + return false; + } + Return registerClientCallback(const hidl_string& fqName, const hidl_string& name, + const sp&, const sp&) { + LOG(INFO) << "Cannot add client callback for " << fqName << "/" << name + << " without hwservicemanager"; + return false; + } + Return unregisterClientCallback(const sp&, const sp&) { + LOG(INFO) << "Cannot unregister client callbacks without hwservicemanager"; + return false; + } + Return addWithChain(const hidl_string& fqName, const sp&, + const hidl_vec&) { + LOG(INFO) << "Cannot add " << fqName << " with chain without hwservicemanager"; + return false; + } + Return listManifestByInterface(const hidl_string& fqName, listManifestByInterface_cb) { + LOG(INFO) << "Cannot list manifest for " << fqName << " without hwservicemanager"; + return Void(); + } + Return tryUnregister(const hidl_string& fqName, const hidl_string& name, + const sp&) { + LOG(INFO) << "Cannot unregister service " << fqName << "/" << name + << " without hwservicemanager"; + return false; + } +}; + sp defaultServiceManager1_2() { using android::hidl::manager::V1_2::BnHwServiceManager; using android::hidl::manager::V1_2::BpHwServiceManager; @@ -214,6 +318,12 @@ sp defaultServiceManager1_2() { return gDefaultServiceManager; } + if (!isHwServiceManagerInstalled()) { + // hwservicemanager is not available on this device. + gDefaultServiceManager = sp::make(); + return gDefaultServiceManager; + } + if (access("/dev/hwbinder", F_OK|R_OK|W_OK) != 0) { // HwBinder not available on this device or not accessible to // this process. @@ -410,6 +520,12 @@ struct PassthroughServiceManager : IServiceManager1_1 { Return> get(const hidl_string& fqName, const hidl_string& name) override { sp ret = nullptr; + // This is required to run without hwservicemanager while we have + // passthrough HIDL services. Once the passthrough HIDL services have + // been removed, the PassthroughServiceManager will no longer be needed. + if (!isHwServiceManagerInstalled() && isServiceManager(fqName)) { + return defaultServiceManager1_2(); + } openLibs(fqName, [&](void* handle, const std::string &lib, const std::string &sym) { IBase* (*generator)(const char* name); -- cgit v1.2.3 From 121674bda25e41f1c793e6a74d816d3fa2ad664d Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Wed, 11 May 2022 21:14:26 +0000 Subject: Deprecate INetd for devices after version 7 INetd AIDL is introduced for use in version 8 Test: TH Bug: 205764585 Change-Id: I23912f0df666bb3ae748fdfe900b434d221e4f7c --- vintfdata/manifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vintfdata/manifest.xml b/vintfdata/manifest.xml index 9d7bfcb..c38a2a2 100644 --- a/vintfdata/manifest.xml +++ b/vintfdata/manifest.xml @@ -58,7 +58,7 @@ default - + android.system.net.netd hwbinder 1.1 -- cgit v1.2.3 From 2b686fcd97ec8650069657086ef186bb7a386b84 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Wed, 1 Jun 2022 23:47:43 +0000 Subject: Check size of grantors before indexing into the vec It's possible that the MQDescriptor was created with no grantors or an incorrect amount. Test: atest hidl_test Bug: 233680266 Change-Id: Id0c69dbc5827202f834e0f6f1a9bf39395e8b597 --- base/include/hidl/MQDescriptor.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base/include/hidl/MQDescriptor.h b/base/include/hidl/MQDescriptor.h index 0429444..38ac325 100644 --- a/base/include/hidl/MQDescriptor.h +++ b/base/include/hidl/MQDescriptor.h @@ -181,7 +181,11 @@ MQDescriptor::~MQDescriptor() { template size_t MQDescriptor::getSize() const { - return static_cast(mGrantors[details::DATAPTRPOS].extent); + if (mGrantors.size() > details::DATAPTRPOS) { + return static_cast(mGrantors[details::DATAPTRPOS].extent); + } else { + return 0; + } } template -- cgit v1.2.3 From 4acdab765889164c3a792c8c15e6e20022de62a1 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 9 Aug 2022 16:27:46 +0000 Subject: libhidl: check ro.debuggable less We were always checking this when retrieving services, but we don't need to (we can check it only when treble testing override is on). There are a few things we could consider in this codebase: - checking debuggability when the testing override is initially set (and warning then) VS now when it is read - avoiding duplicated calls to isDebuggable in isTrebleTestingOverride and getRawServiceInternal. - removing 'kEnforceVintfManifest' since it is always true now. However, given that we're deprecating HIDL and in the interest of keeping changes simple, focusing on other things instead of these improvements. Bug: 193912100 Test: boot Change-Id: I6df328dead00c05dcbd8eedf63fc24a8d6141871 --- transport/ServiceManagement.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp index 5d1979f..f3ee611 100644 --- a/transport/ServiceManagement.cpp +++ b/transport/ServiceManagement.cpp @@ -175,12 +175,15 @@ static bool isDebuggable() { } static inline bool isTrebleTestingOverride() { + // return false early so we don't need to check the debuggable property + if (!*getTrebleTestingOverridePtr()) return false; + if (kEnforceVintfManifest && !isDebuggable()) { // don't allow testing override in production return false; } - return *getTrebleTestingOverridePtr(); + return true; } static void onRegistrationImpl(const std::string& descriptor, const std::string& instanceName) { -- cgit v1.2.3 From fc94fbce8ba2796d236bc5b050cb747ac304d82a Mon Sep 17 00:00:00 2001 From: William Escande Date: Mon, 22 Aug 2022 11:28:01 -0700 Subject: [Bluetooth apex] Use new apex name The Bluetooth apex name is now called com.android.btservices Bug: 243054261 Test: Build Change-Id: I41ba1a5510951dc7bafb9dc72de6b7e29bf646fb --- Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Android.bp b/Android.bp index 2b9e80f..670ee39 100644 --- a/Android.bp +++ b/Android.bp @@ -98,7 +98,7 @@ cc_library { "//apex_available:platform", "com.android.neuralnetworks", "test_com.android.neuralnetworks", - "com.android.bluetooth", + "com.android.btservices", "com.android.media", "com.android.media.swcodec", "com.android.tethering", -- cgit v1.2.3 From 6ac1197a063b356af3f2f704ee80a32550d1d4f4 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Fri, 14 Oct 2022 16:31:24 +0000 Subject: When freezing framework manifests, use aosp_arm64 target We want to use GSI targets because they will contain the expected framework manifests in order to remain backwards compatibile. New launching devices may choose to remove some of the services like hwservicemanager. Test: NA Bug: 218588089 Change-Id: Iae4abb43a8c4a2e535ff961418fa4139506792cd --- vintfdata/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vintfdata/README.md b/vintfdata/README.md index cfc1da7..6116757 100644 --- a/vintfdata/README.md +++ b/vintfdata/README.md @@ -70,7 +70,7 @@ determine the current level. Execute the following, replacing the argument with the level to freeze: ```shell script -lunch cf_x86_phone-userdebug # or any generic target +lunch aosp_arm64 LEVEL=5 ./freeze.sh ${LEVEL} ``` -- cgit v1.2.3 From 2359251f0e0569c88811058e36901182877b49dd Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Fri, 7 Oct 2022 17:52:12 +0000 Subject: Remove hidl.token and hidl.manager from the manifest file These are moved into the manifest fragment for hwservicemanager, the processes that provides these interface implementations. Test: Boot Cuttlefish with and without hwservicemanager installed Bug: 218588089 Change-Id: I7c19c709740bdd4774ea5d5e2acd3bbd5d8f786a --- vintfdata/manifest.xml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/vintfdata/manifest.xml b/vintfdata/manifest.xml index c38a2a2..f200d0f 100644 --- a/vintfdata/manifest.xml +++ b/vintfdata/manifest.xml @@ -1,13 +1,4 @@ - - android.hidl.manager - hwbinder - 1.2 - - IServiceManager - default - - android.hidl.memory passthrough @@ -17,15 +8,6 @@ ashmem - - android.hidl.token - hwbinder - 1.0 - - ITokenManager - default - - android.frameworks.displayservice hwbinder -- cgit v1.2.3 From 32121aecfd506f64efd7512def4691b7850b59e1 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Fri, 7 Oct 2022 17:59:08 +0000 Subject: Make hidl.manager optional in default device matrix It is no longer required with Android U, so change the default device compatibility matrix to reflect that. Test: boot cuttlefish with and without hwservicemanager Bug: 218588089 Change-Id: I43d918e9531034f7b28fbe592563e268e7d3988a --- vintfdata/device_compatibility_matrix.default.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vintfdata/device_compatibility_matrix.default.xml b/vintfdata/device_compatibility_matrix.default.xml index eaa513e..70d23e2 100644 --- a/vintfdata/device_compatibility_matrix.default.xml +++ b/vintfdata/device_compatibility_matrix.default.xml @@ -1,5 +1,5 @@ - + android.hidl.manager 1.0 -- cgit v1.2.3 From 3b6a233eba04571ea6178d0c49e126b099de1b30 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 9 Aug 2022 16:27:46 +0000 Subject: libhidl: check ro.debuggable less We were always checking this when retrieving services, but we don't need to (we can check it only when treble testing override is on). There are a few things we could consider in this codebase: - checking debuggability when the testing override is initially set (and warning then) VS now when it is read - avoiding duplicated calls to isDebuggable in isTrebleTestingOverride and getRawServiceInternal. - removing 'kEnforceVintfManifest' since it is always true now. However, given that we're deprecating HIDL and in the interest of keeping changes simple, focusing on other things instead of these improvements. Ignore-AOSP-First: cherry-pick for tm-qpr-dev Bug: 193912100 Test: boot Change-Id: I6df328dead00c05dcbd8eedf63fc24a8d6141871 Merged-In: I6df328dead00c05dcbd8eedf63fc24a8d6141871 --- transport/ServiceManagement.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp index c638279..0640eef 100644 --- a/transport/ServiceManagement.cpp +++ b/transport/ServiceManagement.cpp @@ -174,12 +174,15 @@ static bool isDebuggable() { } static inline bool isTrebleTestingOverride() { + // return false early so we don't need to check the debuggable property + if (!*getTrebleTestingOverridePtr()) return false; + if (kEnforceVintfManifest && !isDebuggable()) { // don't allow testing override in production return false; } - return *getTrebleTestingOverridePtr(); + return true; } static void onRegistrationImpl(const std::string& descriptor, const std::string& instanceName) { -- cgit v1.2.3 From c1bc6f14ce5ba8531aecefa28a36e3a2e2b4981e Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Mon, 14 Nov 2022 17:31:08 +0000 Subject: Add format="hidl" to HIDL services in the framework manifest More explicit now that we also have AIDL versions. Bug: na Test: m Change-Id: I47b323c74192dc7c6617463653837e393781068d --- vintfdata/manifest.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vintfdata/manifest.xml b/vintfdata/manifest.xml index f200d0f..1e84668 100644 --- a/vintfdata/manifest.xml +++ b/vintfdata/manifest.xml @@ -1,5 +1,5 @@ - + android.hidl.memory passthrough 1.0 @@ -8,7 +8,7 @@ ashmem - + android.frameworks.displayservice hwbinder 1.0 @@ -22,7 +22,7 @@ `ioprio `. For more information, see system/core/init/README.md --> - + android.frameworks.schedulerservice hwbinder 1.0 @@ -31,7 +31,7 @@ default - + android.frameworks.sensorservice hwbinder 1.0 @@ -40,7 +40,7 @@ default - + android.system.net.netd hwbinder 1.1 @@ -49,7 +49,7 @@ default - + android.system.wifi.keystore hwbinder 1.0 -- cgit v1.2.3 From d61959c604847c6972c9d5fdef897e3fdf588809 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Mon, 7 Nov 2022 20:53:03 +0000 Subject: Add the new AIDL sensorservice to the framework manifest Test: boot cuttlefish and verify registration Bug: 205764765 Change-Id: I10b2ae0f77f067046e8930d9ba35c1f75103ddd3 --- vintfdata/manifest.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vintfdata/manifest.xml b/vintfdata/manifest.xml index 1e84668..b3d84aa 100644 --- a/vintfdata/manifest.xml +++ b/vintfdata/manifest.xml @@ -31,6 +31,11 @@ default + + android.frameworks.sensorservice + 1 + ISensorManager/default + android.frameworks.sensorservice hwbinder -- cgit v1.2.3 From 6aa5899aaa61e7470aae4f19f722d7d0cf252310 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Wed, 11 Jan 2023 21:57:36 +0000 Subject: Deprecate HIDL android.system.wifi.keystore interface This functionality is replaced by new methods added to android.hardware.wifi.supplicant. Test: None Bug: 205764502 Change-Id: Ib1dc238c7a0609bccafec0b9fd7e90b48396d6ac --- vintfdata/manifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vintfdata/manifest.xml b/vintfdata/manifest.xml index b3d84aa..b93205c 100644 --- a/vintfdata/manifest.xml +++ b/vintfdata/manifest.xml @@ -54,7 +54,7 @@ default - + android.system.wifi.keystore hwbinder 1.0 -- cgit v1.2.3 From 1a2b57cdcfa221a1aeccedd1d91fcb9f9f52f8df Mon Sep 17 00:00:00 2001 From: jimmy zhang Date: Thu, 23 Feb 2023 09:42:11 +0800 Subject: vts_ibase_test: check transport to support hardware sku To support hardware SKU, manufacturer may custom hardware sku vintf to /odm/etc/vintf/manifest_${ro.boot.hardware.sku}.xml, and then enable/disable hal service in rc file via hardware properties, e.g. update "/vendor/etc/init/android.hardware.camera.provider@2.4-external-service.rc" don't start vendor.camera-provider-2-4-ext if current SKU doesn't support USB camera. if a hal service is diabled in the current hardware SKU, vts_ibase_test will fail and alert "service is not running". so update vts_ibase_test to check transport from manifest, Don't assert if the interface that service declared is not in manifest. Bug ID: b/269974148 Test: vts -m vts_ibase_test Test: vts -m vts_treble_vintf_vendor_test Change-Id: I1f4ae300e78e063d1597fe24b49e78778c88b141 --- .../base/1.0/vts/functional/vts_ibase_test.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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> gDeclaredServiceHalMap; std::mutex gDeclaredServiceHalMapMutex; -void GetHal(const std::string& service, const FqInstance& instance) { +void GetHal(const sp &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 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 service_interfaces_map = android::init::GetOnDeviceServiceInterfacesMap(); ASSERT_RESULT_OK(service_interfaces_map); + auto service_manager = ::android::hardware::defaultServiceManager(); std::map> 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); } } -- cgit v1.2.3 From 490212445a98eb17b04c995a10eff02d5d557bf7 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 24 Feb 2023 02:07:29 +0000 Subject: vts_ibase_test: static libhidl-gen-utils standard solution for lib not installed on device by default anymore. Fixes: 270497432 Test: builds Change-Id: I5542c5a585a6f00ee8b945619b0ba9193b10fc34 --- transport/base/1.0/vts/functional/Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/base/1.0/vts/functional/Android.bp b/transport/base/1.0/vts/functional/Android.bp index f25aaaa..a2a3484 100644 --- a/transport/base/1.0/vts/functional/Android.bp +++ b/transport/base/1.0/vts/functional/Android.bp @@ -37,9 +37,9 @@ cc_test { "liblog", "libutils", "libprotobuf-cpp-lite", - "libhidl-gen-utils", ], static_libs: [ + "libhidl-gen-utils", "libinit_test_utils", ], test_suites: [ -- cgit v1.2.3 From b8180e8fc8e55cc4f1c610015c9da3f325eefd26 Mon Sep 17 00:00:00 2001 From: Benjamin Lerman Date: Fri, 3 Mar 2023 17:51:49 +0100 Subject: Add missing header std::function is defined in Change-Id: I5cb0bb79e1062a38c88df591d52007aa8b968081 --- base/include/hidl/TaskRunner.h | 1 + 1 file changed, 1 insertion(+) 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 #include #include -- cgit v1.2.3 From 9e50a1e3a798706a75caed27876c468fd62e2c2b Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Thu, 23 Mar 2023 21:05:59 +0000 Subject: TEST_MAPPING += vts_ibase_test This change was autogenerated by the command: ./map_tests.py -w -d $AT/system/libhidl Bug: N/A Test: N/A Change-Id: I22b0b34ee8efb233f023b4f9159f2a4c7f21914c --- TEST_MAPPING | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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" } ] } - -- cgit v1.2.3 From 48fb928597abc5e50b830e18767ad520340f9a7e Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Wed, 26 Apr 2023 23:10:30 +0000 Subject: Generate a level 8 (UDC) frozen device matrix Generated with the following cmd: $ANDROID_BUILD_TOP/system/libhidl/vintfdata/freeze.sh 8 Test: m check-vintf-all Bug: 279810211 Change-Id: I1dfab8350c3004ebe5dd6eee768357ab5901f80f --- vintfdata/frozen/8.xml | 101 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 vintfdata/frozen/8.xml 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 @@ + + + android.frameworks.cameraservice.service + + ICameraService + default + + + + android.frameworks.location.altitude + + IAltitudeService + default + + + + android.frameworks.sensorservice + + ISensorManager + default + + + + android.frameworks.sensorservice + 1.0 + + ISensorManager + default + + + + android.frameworks.stats + 2 + + IStats + default + + + + android.hardware.media.c2 + 1.2 + + IComponentStore + software + + + + android.hidl.allocator + 1.0 + + IAllocator + ashmem + + + + android.hidl.manager + 1.2 + + IServiceManager + default + + + + android.hidl.memory + 1.0 + + IMapper + ashmem + + + + android.hidl.token + 1.0 + + ITokenManager + default + + + + android.system.keystore2 + 3 + + IKeystoreService + default + + + + android.system.net.netd + + INetd + default + + + + android.system.suspend + + ISystemSuspend + default + + + -- cgit v1.2.3