mirror of
https://gitee.com/openharmony/accessibility
synced 2024-11-22 22:39:56 +00:00
无障碍服务行为打点
Signed-off-by: l30011477 <lixun26@huawei.com>
This commit is contained in:
parent
fb28c92db2
commit
b819cbb17d
@ -28,7 +28,8 @@
|
||||
"rom": "2000KB",
|
||||
"ram": "10000KB",
|
||||
"hisysevent_config": [
|
||||
"//foundation/barrierfree/accessibility/hisysevent.yaml"
|
||||
"//foundation/barrierfree/accessibility/hisysevent.yaml",
|
||||
"//foundation/barrierfree/accessibility/hisysevent_ue.yaml"
|
||||
],
|
||||
"deps": {
|
||||
"components": [
|
||||
|
50
hisysevent_ue.yaml
Normal file
50
hisysevent_ue.yaml
Normal file
@ -0,0 +1,50 @@
|
||||
# Copyright (c) 2024 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
|
||||
#
|
||||
# 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.
|
||||
|
||||
#####################################################
|
||||
# below is the format of defining event #
|
||||
#####################################################
|
||||
#domain: domain name. [Only one domain name can be defined at the top]
|
||||
#
|
||||
#author: the author name who defined this event.
|
||||
#date: the date when this event was defined, format is YYYY-MM-DD.
|
||||
#logged: source file which refer to this event.
|
||||
#usage: the usage of this event.
|
||||
#//Define event name and event properties.
|
||||
#@EVENT_NAME: the event definition part begin.
|
||||
# // __BASE is used for defining the basic info of the event.
|
||||
# // "type" optional values are: FAULT, STATISTICS, SECURITY, BEHAVIOR.
|
||||
# // "level" optional values are: CRITICAL, MINOR.
|
||||
# // "tag" set tags with may used by subscriber of this event, multiple tags divided by space.
|
||||
# // "desc" full description of this event.
|
||||
# @PARAMETER: {type: parameter type, arrsize: array length(optional), desc: parameter description}.
|
||||
# // follow the __BASE block, each line defines a parameter of this event.
|
||||
# // "type" optional values are: INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT, DOUBLE, STRING.
|
||||
# // "arrsize" of the parameter is an array, set a non-zero value.
|
||||
# // "desc" full description of this parameter.
|
||||
|
||||
#####################################################
|
||||
# Example of some hiviewdfx events definition #
|
||||
#####################################################
|
||||
|
||||
domain: ACCESSIBILITY_UE
|
||||
|
||||
ENABLE_SHORTKEY_ABILITY_SINGLE:
|
||||
__BASE: {type: BEHAVIOR, level: CRITICAL, desc: enable single ability targets}
|
||||
MSG_NAME: {type: STRING, desc: enable single targets name}
|
||||
MSG_VALUE: {type: STRING, desc: enable single targets value}
|
||||
|
||||
ZOOM_GESTURE_ACTION:
|
||||
__BASE: {type: BEHAVIOR, level: CRITICAL, desc: on zoom gesture state}
|
||||
MSG_NAME: {type: STRING, desc: on zoom gesture state name}
|
||||
MSG_VALUE: {type: STRING, desc: on zoom gesture state value}
|
@ -61,6 +61,8 @@ public:
|
||||
static void VectorToString(const std::vector<std::string> &vectorVal, std::string &stringOut);
|
||||
static void StringToVector(const std::string &stringIn, std::vector<std::string> &vectorResult);
|
||||
static int32_t GetUserIdByCallingUid();
|
||||
static void RecordEnableShortkeyAbilityEvent(const std::string &name);
|
||||
static void RecordOnZoomGestureEvent(const std::string &state);
|
||||
|
||||
private:
|
||||
static std::string TransferUnavailableEventToString(A11yUnavailableEvent type);
|
||||
|
@ -785,6 +785,7 @@ void AccessibilityZoomGesture::OnZoom(int32_t anchorX, int32_t anchorY)
|
||||
float y = anchorPointY_ / screenHeight_;
|
||||
scaleRatio_ = DEFAULT_SCALE;
|
||||
AccessibilityDisplayManager &displayMgr = Singleton<AccessibilityDisplayManager>::GetInstance();
|
||||
Utils::RecordOnZoomGestureEvent("on");
|
||||
displayMgr.SetDisplayScale(screenId_, scaleRatio_, scaleRatio_, x, y);
|
||||
#else
|
||||
HILOG_INFO("not support zoom");
|
||||
@ -798,6 +799,7 @@ void AccessibilityZoomGesture::OffZoom()
|
||||
#ifdef OHOS_BUILD_ENABLE_DISPLAY_MANAGER
|
||||
AccessibilityDisplayManager &displayMgr = Singleton<AccessibilityDisplayManager>::GetInstance();
|
||||
uint64_t currentScreen = displayMgr.GetDefaultDisplayId();
|
||||
Utils::RecordOnZoomGestureEvent("off");
|
||||
displayMgr.SetDisplayScale(currentScreen, NORMAL_SCALE, NORMAL_SCALE, DEFAULT_ANCHOR, DEFAULT_ANCHOR);
|
||||
#else
|
||||
HILOG_INFO("not support zoom");
|
||||
|
@ -2468,6 +2468,7 @@ void AccessibleAbilityManagerService::OnShortKeyProcess()
|
||||
if (shortkeyMultiTarget.size() == 0) {
|
||||
EnableShortKeyTargetAbility();
|
||||
} else if (shortkeyMultiTarget.size() == 1) {
|
||||
Utils::RecordEnableShortkeyAbilityEvent(shortkeyMultiTarget[0]);
|
||||
EnableShortKeyTargetAbility(shortkeyMultiTarget[0]);
|
||||
} else {
|
||||
// dialog
|
||||
|
@ -365,6 +365,38 @@ void Utils::RecordStartingA11yEvent(const std::string &name)
|
||||
#endif //OHOS_BUILD_ENABLE_HISYSEVENT
|
||||
}
|
||||
|
||||
void Utils::RecordEnableShortkeyAbilityEvent(const std::string &name)
|
||||
{
|
||||
std::string MSG_NAME = "enable single targets";
|
||||
HILOG_DEBUG("starting RecordEnableShortkeyAbilityEvent enable single targets: %{public}s", name.c_str());
|
||||
#ifdef OHOS_BUILD_ENABLE_HISYSEVENT
|
||||
int32_t ret = HiSysEventWrite(
|
||||
OHOS::HiviewDFX::HiSysEvent::Domain::ACCESSIBILITY_UE,
|
||||
"ENABLE_SHORTKEY_ABILITY_SINGLE",
|
||||
OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR,
|
||||
"MSG_NAME", MSG_NAME, "MSG_VALUE", name);
|
||||
if (ret != 0) {
|
||||
HILOG_ERROR("Write HiSysEvent RecordEnableShortkeyAbilityEvent error, ret:%{public}d", ret);
|
||||
}
|
||||
#endif //OHOS_BUILD_ENABLE_HISYSEVENT
|
||||
}
|
||||
|
||||
void Utils::RecordOnZoomGestureEvent(const std::string &state)
|
||||
{
|
||||
std::string MSG_NAME = "on zoom gesture state";
|
||||
HILOG_DEBUG("starting RecordOnZoomGestureEvent on zoom gesture state: %{public}s", state.c_str());
|
||||
#ifdef OHOS_BUILD_ENABLE_HISYSEVENT
|
||||
int32_t ret = HiSysEventWrite(
|
||||
OHOS::HiviewDFX::HiSysEvent::Domain::ACCESSIBILITY_UE,
|
||||
"ZOOM_GESTURE_ACTION",
|
||||
OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR,
|
||||
"MSG_NAME", MSG_NAME, "MSG_VALUE", state);
|
||||
if (ret != 0) {
|
||||
HILOG_ERROR("Write HiSysEvent RecordOnZoomGestureEvent error, ret:%{public}d", ret);
|
||||
}
|
||||
#endif //OHOS_BUILD_ENABLE_HISYSEVENT
|
||||
}
|
||||
|
||||
void Utils::VectorToString(const std::vector<std::string> &vectorVal, std::string &stringOut)
|
||||
{
|
||||
HILOG_DEBUG();
|
||||
|
Loading…
Reference in New Issue
Block a user