From 89503346dce3686d97d43933d9a6a55960059cdc Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Wed, 19 Feb 2025 09:26:52 +0800 Subject: [PATCH] Modified branch differences Signed-off-by: li-yaoyao777 --- frameworks/capi/BUILD.gn | 1 + hisysevent.yaml | 9 +++++++-- .../src/vibration_priority_manager.cpp | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/frameworks/capi/BUILD.gn b/frameworks/capi/BUILD.gn index dcb005b..3aa365b 100644 --- a/frameworks/capi/BUILD.gn +++ b/frameworks/capi/BUILD.gn @@ -35,6 +35,7 @@ ohos_shared_library("ohvibrator") { external_deps = [ "hilog:libhilog" ] + cflags_cc = [ "-fstack-protector-strong" ] relative_install_dir = "ndk" part_name = "miscdevice" subsystem_name = "sensors" diff --git a/hisysevent.yaml b/hisysevent.yaml index 0ecb9ec..9e63130 100644 --- a/hisysevent.yaml +++ b/hisysevent.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 Huawei Device Co., Ltd. # 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 @@ -36,4 +36,9 @@ VIBRATOR_HDF_SERVICE_EXCEPTION: MISC_SERVICE_EXCEPTION: __BASE: {type: FAULT, level: MINOR, desc: sensor service exception} PKG_NAME: {type: STRING, desc: package name} - ERROR_CODE: {type: INT32, desc: error code} \ No newline at end of file + ERROR_CODE: {type: INT32, desc: error code} + +SWITCHES_TOGGLE: + __BASE: {type: BEHAVIOR, level: CRITICAL, desc: Switching, preserve: true} + SWITCH_TYPE: {type: STRING, desc: Switch Type} + STATUS: {type: INT32, desc: Switch status} \ No newline at end of file diff --git a/services/miscdevice_service/src/vibration_priority_manager.cpp b/services/miscdevice_service/src/vibration_priority_manager.cpp index 5aa98db..c3914fd 100644 --- a/services/miscdevice_service/src/vibration_priority_manager.cpp +++ b/services/miscdevice_service/src/vibration_priority_manager.cpp @@ -19,6 +19,7 @@ #include "accesstoken_kit.h" #include "bundle_mgr_client.h" +#include "hisysevent.h" #include "ipc_skeleton.h" #include "iservice_registry.h" #include "os_account_manager.h" @@ -33,6 +34,7 @@ namespace OHOS { namespace Sensors { +using namespace OHOS::HiviewDFX; namespace { const std::string SETTING_COLUMN_KEYWORD = "KEYWORD"; const std::string SETTING_COLUMN_VALUE = "VALUE"; @@ -74,12 +76,16 @@ bool VibrationPriorityManager::Init() MISC_HILOGE("Get feedback failed"); } miscFeedback_ = feedback; + HiSysEventWrite(HiSysEvent::Domain::MISCDEVICE, "SWITCHES_TOGGLE", + HiSysEvent::EventType::BEHAVIOR, "SWITCH_TYPE", "feedback", "STATUS", feedback); MISC_HILOGI("feedback:%{public}d", feedback); int32_t ringerMode = miscAudioRingerMode_; if (GetIntValue(SETTING_RINGER_MODE_KEY, ringerMode) != ERR_OK) { MISC_HILOGE("Get ringerMode failed"); } miscAudioRingerMode_ = ringerMode; + HiSysEventWrite(HiSysEvent::Domain::MISCDEVICE, "SWITCHES_TOGGLE", + HiSysEvent::EventType::BEHAVIOR, "SWITCH_TYPE", "ringerMode", "STATUS", ringerMode); MISC_HILOGI("ringerMode:%{public}d", ringerMode); }; auto observer_ = CreateObserver(updateFunc); -- Gitee