From 7df1220c82357ad1deef11ba68362ce474dc25de Mon Sep 17 00:00:00 2001 From: rwx1283129 Date: Wed, 1 Nov 2023 04:35:57 +0000 Subject: [PATCH 1/2] Initial quarantine in macro mode Signed-off-by: rwx1283129 Change-Id: I1e4dc3964b25a9b01936d7533904c6534f039e7b --- miscdevice.gni | 8 ++++++++ services/miscdevice_service/BUILD.gn | 16 ++++++++++++++-- .../adapter/src/compatible_connection.cpp | 2 ++ .../adapter/src/compatible_light_connection.cpp | 2 ++ .../interface/src/light_hdi_connection.cpp | 4 ++++ .../interface/src/vibrator_hdi_connection.cpp | 4 ++++ 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/miscdevice.gni b/miscdevice.gni index a7f6ed3..550ea19 100644 --- a/miscdevice.gni +++ b/miscdevice.gni @@ -37,3 +37,11 @@ if (!defined(global_parts_info) || } else { hdf_drivers_interface_light = false } + +if(build_variant == "eng) { + miscdevice_default_defines += [ "BUILD_VARIANT_ENG" ] + miscdevice_build_eng = true; +} +else { + miscdevice_build_eng = false; +} diff --git a/services/miscdevice_service/BUILD.gn b/services/miscdevice_service/BUILD.gn index 789b4f2..4c2b4a6 100644 --- a/services/miscdevice_service/BUILD.gn +++ b/services/miscdevice_service/BUILD.gn @@ -16,8 +16,6 @@ import("./../../miscdevice.gni") ohos_shared_library("libmiscdevice_service") { sources = [ - "hdi_connection/adapter/src/compatible_connection.cpp", - "hdi_connection/adapter/src/compatible_light_connection.cpp", "hdi_connection/adapter/src/hdi_connection.cpp", "hdi_connection/interface/src/light_hdi_connection.cpp", "hdi_connection/interface/src/vibrator_hdi_connection.cpp", @@ -38,6 +36,13 @@ ohos_shared_library("libmiscdevice_service") { "//third_party/cJSON", ] + if(miscdevice_build_eng) { + sources += [ + "hdi_connection/adapter/src/compatible_connection.cpp", + "hdi_connection/adapter/src/compatible_light_connection.cpp", + ] + } + cflags = [ "-Wno-error=inconsistent-missing-override" ] deps = [ "$SUBSYSTEM_DIR/utils:libmiscdevice_utils" ] @@ -100,6 +105,13 @@ ohos_shared_library("libmiscdevice_service_static") { "//third_party/cJSON", ] + if(miscdevice_build_eng) { + sources += [ + "hdi_connection/adapter/src/compatible_connection.cpp", + "hdi_connection/adapter/src/compatible_light_connection.cpp", + ] + } + cflags = [ "-Wno-error=inconsistent-missing-override" ] deps = [ "$SUBSYSTEM_DIR/utils:libmiscdevice_utils" ] diff --git a/services/miscdevice_service/hdi_connection/adapter/src/compatible_connection.cpp b/services/miscdevice_service/hdi_connection/adapter/src/compatible_connection.cpp index 2dc8854..3233b34 100644 --- a/services/miscdevice_service/hdi_connection/adapter/src/compatible_connection.cpp +++ b/services/miscdevice_service/hdi_connection/adapter/src/compatible_connection.cpp @@ -12,7 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#ifdef BUILD_VARIANT_ENG #include "compatible_connection.h" +#endif #include #include diff --git a/services/miscdevice_service/hdi_connection/adapter/src/compatible_light_connection.cpp b/services/miscdevice_service/hdi_connection/adapter/src/compatible_light_connection.cpp index 226884c..ddab426 100644 --- a/services/miscdevice_service/hdi_connection/adapter/src/compatible_light_connection.cpp +++ b/services/miscdevice_service/hdi_connection/adapter/src/compatible_light_connection.cpp @@ -12,7 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#ifdef BUILD_VARIANT_ENG #include "compatible_light_connection.h" +#endif #include #include diff --git a/services/miscdevice_service/hdi_connection/interface/src/light_hdi_connection.cpp b/services/miscdevice_service/hdi_connection/interface/src/light_hdi_connection.cpp index 50767c0..4b73074 100644 --- a/services/miscdevice_service/hdi_connection/interface/src/light_hdi_connection.cpp +++ b/services/miscdevice_service/hdi_connection/interface/src/light_hdi_connection.cpp @@ -16,7 +16,9 @@ #include +#ifdef BUILD_VARIANT_ENG #include "compatible_light_connection.h" +#endif #ifdef HDF_DRIVERS_INTERFACE_LIGHT #include "hdi_light_connection.h" #endif // HDF_DRIVERS_INTERFACE_LIGHT @@ -41,8 +43,10 @@ int32_t LightHdiConnection::ConnectHdi() return ERR_OK; } #endif // HDF_DRIVERS_INTERFACE_LIGHT +#ifdef BUILD_VARIANT_ENG iLightHdiConnection_ = std::make_unique(); return ConnectHdiService(); +#endif } int32_t LightHdiConnection::ConnectHdiService() diff --git a/services/miscdevice_service/hdi_connection/interface/src/vibrator_hdi_connection.cpp b/services/miscdevice_service/hdi_connection/interface/src/vibrator_hdi_connection.cpp index 8090b65..aebfd70 100644 --- a/services/miscdevice_service/hdi_connection/interface/src/vibrator_hdi_connection.cpp +++ b/services/miscdevice_service/hdi_connection/interface/src/vibrator_hdi_connection.cpp @@ -16,7 +16,9 @@ #include "hitrace_meter.h" +#ifdef BUILD_VARIANT_ENG #include "compatible_connection.h" +#endif #include "hdi_connection.h" #include "sensors_errors.h" @@ -34,8 +36,10 @@ int32_t VibratorHdiConnection::ConnectHdi() int32_t ret = iVibratorHdiConnection_->ConnectHdi(); if (ret != ERR_OK) { MISC_HILOGE("Hdi direct failed"); +#ifdef BUILD_VARIANT_ENG iVibratorHdiConnection_ = std::make_unique(); ret = iVibratorHdiConnection_->ConnectHdi(); +#endif } if (ret != ERR_OK) { MISC_HILOGE("Hdi connection failed"); -- Gitee From 95cad45feb6c6307e1b31d83848a9fd3c9d70954 Mon Sep 17 00:00:00 2001 From: rwx1283129 Date: Wed, 1 Nov 2023 06:41:10 +0000 Subject: [PATCH 2/2] add a signal Signed-off-by: rwx1283129 --- miscdevice.gni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miscdevice.gni b/miscdevice.gni index 550ea19..12489d6 100644 --- a/miscdevice.gni +++ b/miscdevice.gni @@ -38,7 +38,7 @@ if (!defined(global_parts_info) || hdf_drivers_interface_light = false } -if(build_variant == "eng) { +if(build_variant == "eng") { miscdevice_default_defines += [ "BUILD_VARIANT_ENG" ] miscdevice_build_eng = true; } -- Gitee