mirror of
https://gitee.com/openharmony/accessibility
synced 2024-11-27 09:01:34 +00:00
修改accessibility非法依赖
Signed-off-by: jinqi6 <jinqi6@huawei.com>
This commit is contained in:
parent
34a7b1d1ff
commit
7f28298437
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "napi_accessibility_utils.h"
|
||||
#include "napi_accessibility_config_observer.h"
|
||||
#include "accessibility_utils.h"
|
||||
#include "accessibility_config_observer.h"
|
||||
|
||||
#include <uv.h>
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "napi_accessibility_utils.h"
|
||||
#include "accessibility_utils.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <iomanip>
|
||||
@ -24,7 +24,6 @@
|
||||
#include "hilog_wrapper.h"
|
||||
#include "napi/native_api.h"
|
||||
#include "napi/native_node_api.h"
|
||||
#include "napi_accessibility_event_info.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AccessibilityNapi {
|
@ -35,6 +35,7 @@ config("accessibilityconfig_public_config") {
|
||||
|
||||
acfwk_src = [
|
||||
"${acfwk_path}/src/accessibility_config_impl.cpp",
|
||||
"${acfwk_path}/src/accessibility_config_observer.cpp",
|
||||
"${acfwk_path}/src/accessibility_config.cpp",
|
||||
]
|
||||
|
||||
@ -59,6 +60,7 @@ ohos_shared_library("accessibilityconfig") {
|
||||
"init:libbeget_proxy",
|
||||
"init:libbegetutil",
|
||||
"ipc:ipc_core",
|
||||
"napi:ace_napi",
|
||||
"samgr:samgr_proxy",
|
||||
]
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <memory>
|
||||
#include "accessibility_caption.h"
|
||||
#include "accessibility_singleton.h"
|
||||
#include "accessibility_def.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AccessibilityConfig {
|
||||
@ -41,13 +42,6 @@ enum CONFIG_ID : int32_t {
|
||||
CONFIG_ID_MAX,
|
||||
};
|
||||
|
||||
enum DALTONIZATION_TYPE : uint32_t {
|
||||
Normal = 0,
|
||||
Protanomaly,
|
||||
Deuteranomaly,
|
||||
Tritanomaly,
|
||||
};
|
||||
|
||||
struct ConfigValue {
|
||||
bool highContrastText;
|
||||
bool invertColor;
|
||||
|
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef NAPI_ACCESSIBILITY_CONFIG_OBSERVER_H
|
||||
#define NAPI_ACCESSIBILITY_CONFIG_OBSERVER_H
|
||||
#ifndef ACCESSIBILITY_CONFIG_OBSERVER_H
|
||||
#define ACCESSIBILITY_CONFIG_OBSERVER_H
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
@ -57,4 +57,4 @@ private:
|
||||
std::mutex mutex_;
|
||||
std::vector<std::shared_ptr<NAccessibilityConfigObserver>> observers_ = {};
|
||||
};
|
||||
#endif // NAPI_ACCESSIBILITY_CONFIG_OBSERVER_H
|
||||
#endif // ACCESSIBILITY_CONFIG_OBSERVER_H
|
@ -39,11 +39,11 @@ accessibility_common_src = [
|
||||
"${accessibility_common_path}/src/accessibility_event_info.cpp",
|
||||
"${accessibility_common_path}/src/accessibility_window_info.cpp",
|
||||
"${accessibility_common_path}/src/accessibility_gesture_inject_path.cpp",
|
||||
"${accessibility_common_path}/src/accessibility_utils.cpp",
|
||||
]
|
||||
|
||||
ohos_shared_library("accessibility_common") {
|
||||
sources = accessibility_common_src
|
||||
version_script = "libaccessibility_common.map"
|
||||
configs = [
|
||||
":accessibility_common_private_config",
|
||||
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
|
||||
@ -53,7 +53,11 @@ ohos_shared_library("accessibility_common") {
|
||||
|
||||
install_enable = true
|
||||
|
||||
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
|
||||
external_deps = [
|
||||
"hiviewdfx_hilog_native:libhilog",
|
||||
"input:libmmi-client",
|
||||
"napi:ace_napi",
|
||||
]
|
||||
|
||||
subsystem_name = "barrierfree"
|
||||
part_name = "accessibility"
|
||||
|
@ -16,8 +16,25 @@
|
||||
#ifndef ACCESSIBILITY_DEFINE_H
|
||||
#define ACCESSIBILITY_DEFINE_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "accessibility_constants.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AccessibilityConfig {
|
||||
|
||||
enum DALTONIZATION_TYPE : uint32_t {
|
||||
Normal = 0,
|
||||
Protanomaly,
|
||||
Deuteranomaly,
|
||||
Tritanomaly,
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace OHOS {
|
||||
namespace Accessibility {
|
||||
enum RetError : int32_t {
|
||||
@ -256,6 +273,99 @@ enum AccessibilityWindowType : int32_t {
|
||||
TYPE_SPLIT_SCREEN_DIVIDER = 0x00000008,
|
||||
TYPE_SYSTEM = 0x00000010,
|
||||
};
|
||||
|
||||
} // namespace Accessibility
|
||||
} // namespace OHOS
|
||||
|
||||
constexpr size_t CALLBACK_SIZE = 1;
|
||||
constexpr size_t ARGS_SIZE_ZERO = 0;
|
||||
constexpr size_t ARGS_SIZE_ONE = 1;
|
||||
constexpr size_t ARGS_SIZE_TWO = 2;
|
||||
constexpr size_t ARGS_SIZE_THREE = 3;
|
||||
constexpr size_t ARGS_SIZE_FOUR = 4;
|
||||
constexpr int32_t DEFAULT_INT32 = 0;
|
||||
constexpr int32_t PARAM0 = 0;
|
||||
constexpr int32_t PARAM1 = 1;
|
||||
constexpr int32_t PARAM2 = 2;
|
||||
constexpr int32_t CODE_SUCCESS = 0;
|
||||
constexpr int32_t CODE_FAILED = -1;
|
||||
constexpr int32_t CHAE_BUFFER_MAX = 1024;
|
||||
const std::string ERROR_MESSAGE_PARAMETER_ERROR = "Input parameter error";
|
||||
const std::string ERROR_MESSAGE_NO_PERMISSION = "Permission denied";
|
||||
const std::string ERROR_MESSAGE_NOT_SYSTEM_APP = "Not system App";
|
||||
const std::string ERROR_MESSAGE_NO_RIGHT = "Do not have accessibility right for this operation";
|
||||
const std::string ERROR_MESSAGE_SYSTEM_ABNORMALITY = "System abnormality";
|
||||
const std::string ERROR_MESSAGE_PROPERTY_NOT_EXIST = "This property does not exist";
|
||||
const std::string ERROR_MESSAGE_ACTION_NOT_SUPPORT = "This action is not supported";
|
||||
const std::string ERROR_MESSAGE_INVALID_BUNDLE_NAME_OR_ABILITY_NAME = "Invalid bundle name or ability name";
|
||||
const std::string ERROR_MESSAGE_TARGET_ABILITY_ALREADY_ENABLED = "Target ability already enabled";
|
||||
|
||||
enum class NAccessibilityErrorCode : int32_t {
|
||||
ACCESSIBILITY_OK = 0,
|
||||
ACCESSIBILITY_ERROR_NO_PERMISSION = 201,
|
||||
ACCESSIBILITY_ERROR_NOT_SYSTEM_APP = 202,
|
||||
ACCESSIBILITY_ERROR_INVALID_PARAM = 401,
|
||||
ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY = 9300000,
|
||||
ACCESSIBILITY_ERROR_ERROR_EXTENSION_NAME = 9300001,
|
||||
ACCESSIBILITY_ERROR_TARGET_ABILITY_ALREADY_ENABLED = 9300002,
|
||||
ACCESSIBILITY_ERROR_NO_RIGHT = 9300003,
|
||||
ACCESSIBILITY_ERROR_PROPERTY_NOT_EXIST = 9300004,
|
||||
ACCESSIBILITY_ERROR_ACTION_NOT_SUPPORT = 9300005,
|
||||
};
|
||||
|
||||
struct NAccessibilityErrMsg {
|
||||
NAccessibilityErrorCode errCode;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
const std::map<OHOS::Accessibility::RetError, NAccessibilityErrMsg> ACCESSIBILITY_JS_TO_ERROR_CODE_MAP {
|
||||
{OHOS::Accessibility::RetError::RET_OK,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_OK, ""}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_FAILED,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_INVALID_PARAM,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_INVALID_PARAM, ERROR_MESSAGE_PARAMETER_ERROR}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NULLPTR,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_IPC_FAILED,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_SAMGR,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_PERMISSION,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_NO_PERMISSION, ERROR_MESSAGE_NO_PERMISSION}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_TIME_OUT,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_REGISTER_EXIST,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_REGISTER,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_CONNECTION_EXIST,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_TARGET_ABILITY_ALREADY_ENABLED,
|
||||
ERROR_MESSAGE_TARGET_ABILITY_ALREADY_ENABLED}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_CONNECTION,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_WINDOW_CONNECTION,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_CAPABILITY,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_NO_RIGHT, ERROR_MESSAGE_NO_RIGHT}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_INVALID_ELEMENT_INFO_FROM_ACE,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_PERFORM_ACTION_FAILED_BY_ACE,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_INJECTOR,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NOT_INSTALLED,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_ERROR_EXTENSION_NAME,
|
||||
ERROR_MESSAGE_INVALID_BUNDLE_NAME_OR_ABILITY_NAME}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NOT_ENABLED,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_ERROR_EXTENSION_NAME,
|
||||
ERROR_MESSAGE_INVALID_BUNDLE_NAME_OR_ABILITY_NAME}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_PROPERTY_NOT_EXIST,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_PROPERTY_NOT_EXIST, ERROR_MESSAGE_PROPERTY_NOT_EXIST}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_ACTION_NOT_SUPPORT,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_ACTION_NOT_SUPPORT, ERROR_MESSAGE_ACTION_NOT_SUPPORT}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NOT_SYSTEM_APP,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_NOT_SYSTEM_APP, ERROR_MESSAGE_NOT_SYSTEM_APP}},
|
||||
};
|
||||
|
||||
#endif // ACCESSIBILITY_DEFINE_H
|
@ -13,13 +13,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef NAPI_ACCESSIBILITY_UTILS_H
|
||||
#define NAPI_ACCESSIBILITY_UTILS_H
|
||||
#ifndef ACCESSIBILITY_UTILS_H
|
||||
#define ACCESSIBILITY_UTILS_H
|
||||
|
||||
#include <map>
|
||||
#include "accessibility_ability_info.h"
|
||||
#include "accessibility_caption.h"
|
||||
#include "accessibility_config.h"
|
||||
#include "accessibility_element_info.h"
|
||||
#include "accessibility_event_info.h"
|
||||
#include "accessibility_gesture_inject_path.h"
|
||||
@ -27,7 +26,7 @@
|
||||
#include "key_event.h"
|
||||
#include "napi/native_api.h"
|
||||
#include "napi/native_node_api.h"
|
||||
#include "napi_accessibility_def.h"
|
||||
#include "accessibility_def.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AccessibilityNapi {
|
||||
@ -111,4 +110,4 @@ struct CaptionCallbackInfo: public AccessibilityCallbackInfo {
|
||||
};
|
||||
} // namespace AccessibilityNapi
|
||||
} // OHOS
|
||||
#endif // NAPI_ACCESSIBILITY_UTILS_H
|
||||
#endif // ACCESSIBILITY_UTILS_H
|
@ -27,10 +27,8 @@ ohos_shared_library("accessibility") {
|
||||
]
|
||||
|
||||
sources = [
|
||||
"./src/napi_accessibility_config_observer.cpp",
|
||||
"./src/napi_accessibility_event_info.cpp",
|
||||
"./src/napi_accessibility_system_ability_client.cpp",
|
||||
"./src/napi_accessibility_utils.cpp",
|
||||
"./src/native_module.cpp",
|
||||
]
|
||||
|
||||
|
@ -19,8 +19,8 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include "napi_accessibility_utils.h"
|
||||
#include "napi_accessibility_config_observer.h"
|
||||
#include "accessibility_utils.h"
|
||||
#include "accessibility_config_observer.h"
|
||||
#include "napi/native_api.h"
|
||||
#include "napi/native_node_api.h"
|
||||
#include "accessibility_config.h"
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <uv.h>
|
||||
#include "hilog_wrapper.h"
|
||||
#include "ipc_skeleton.h"
|
||||
#include "napi_accessibility_utils.h"
|
||||
#include "accessibility_utils.h"
|
||||
#include "tokenid_kit.h"
|
||||
|
||||
using namespace OHOS;
|
||||
|
@ -16,7 +16,7 @@
|
||||
#ifndef NAPI_ACCESSIBILITY_ELEMENT_H
|
||||
#define NAPI_ACCESSIBILITY_ELEMENT_H
|
||||
|
||||
#include "napi_accessibility_def.h"
|
||||
#include "accessibility_def.h"
|
||||
#include "accessibility_event_info.h"
|
||||
#include "accessibility_window_info.h"
|
||||
#include "napi/native_api.h"
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include <vector>
|
||||
#include "accessible_ability_client.h"
|
||||
#include "hilog_wrapper.h"
|
||||
#include "napi_accessibility_utils.h"
|
||||
#include "accessibility_utils.h"
|
||||
|
||||
using namespace OHOS;
|
||||
using namespace OHOS::Accessibility;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "js_runtime_utils.h"
|
||||
#include "napi_accessibility_event_info.h"
|
||||
#include "napi_accessibility_extension_context.h"
|
||||
#include "napi_accessibility_utils.h"
|
||||
#include "accessibility_utils.h"
|
||||
#include "napi/native_api.h"
|
||||
#include "napi/native_node_api.h"
|
||||
#include "napi_accessibility_element.h"
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "js_runtime_utils.h"
|
||||
#include "hilog_wrapper.h"
|
||||
#include "napi_accessibility_element.h"
|
||||
#include "napi_accessibility_utils.h"
|
||||
#include "accessibility_utils.h"
|
||||
#include "native_engine/native_value.h"
|
||||
|
||||
using namespace OHOS::AbilityRuntime;
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
#include "napi_accessibility_gesture_path.h"
|
||||
#include "napi_accessibility_def.h"
|
||||
#include "accessibility_def.h"
|
||||
#include "hilog_wrapper.h"
|
||||
|
||||
using namespace OHOS;
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
#include "napi_accessibility_gesture_point.h"
|
||||
#include "napi_accessibility_def.h"
|
||||
#include "accessibility_def.h"
|
||||
#include "hilog_wrapper.h"
|
||||
|
||||
using namespace OHOS;
|
||||
|
@ -1,115 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
|
||||
#ifndef NAPI_ACCESSIBILITY_DEF_H
|
||||
#define NAPI_ACCESSIBILITY_DEF_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "accessibility_def.h"
|
||||
|
||||
constexpr size_t CALLBACK_SIZE = 1;
|
||||
constexpr size_t ARGS_SIZE_ZERO = 0;
|
||||
constexpr size_t ARGS_SIZE_ONE = 1;
|
||||
constexpr size_t ARGS_SIZE_TWO = 2;
|
||||
constexpr size_t ARGS_SIZE_THREE = 3;
|
||||
constexpr size_t ARGS_SIZE_FOUR = 4;
|
||||
constexpr int32_t DEFAULT_INT32 = 0;
|
||||
constexpr int32_t PARAM0 = 0;
|
||||
constexpr int32_t PARAM1 = 1;
|
||||
constexpr int32_t PARAM2 = 2;
|
||||
constexpr int32_t CODE_SUCCESS = 0;
|
||||
constexpr int32_t CODE_FAILED = -1;
|
||||
constexpr int32_t CHAE_BUFFER_MAX = 1024;
|
||||
const std::string ERROR_MESSAGE_PARAMETER_ERROR = "Input parameter error";
|
||||
const std::string ERROR_MESSAGE_NO_PERMISSION = "Permission denied";
|
||||
const std::string ERROR_MESSAGE_NOT_SYSTEM_APP = "Not system App";
|
||||
const std::string ERROR_MESSAGE_NO_RIGHT = "Do not have accessibility right for this operation";
|
||||
const std::string ERROR_MESSAGE_SYSTEM_ABNORMALITY = "System abnormality";
|
||||
const std::string ERROR_MESSAGE_PROPERTY_NOT_EXIST = "This property does not exist";
|
||||
const std::string ERROR_MESSAGE_ACTION_NOT_SUPPORT = "This action is not supported";
|
||||
const std::string ERROR_MESSAGE_INVALID_BUNDLE_NAME_OR_ABILITY_NAME = "Invalid bundle name or ability name";
|
||||
const std::string ERROR_MESSAGE_TARGET_ABILITY_ALREADY_ENABLED = "Target ability already enabled";
|
||||
|
||||
enum class NAccessibilityErrorCode : int32_t {
|
||||
ACCESSIBILITY_OK = 0,
|
||||
ACCESSIBILITY_ERROR_NO_PERMISSION = 201,
|
||||
ACCESSIBILITY_ERROR_NOT_SYSTEM_APP = 202,
|
||||
ACCESSIBILITY_ERROR_INVALID_PARAM = 401,
|
||||
ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY = 9300000,
|
||||
ACCESSIBILITY_ERROR_ERROR_EXTENSION_NAME = 9300001,
|
||||
ACCESSIBILITY_ERROR_TARGET_ABILITY_ALREADY_ENABLED = 9300002,
|
||||
ACCESSIBILITY_ERROR_NO_RIGHT = 9300003,
|
||||
ACCESSIBILITY_ERROR_PROPERTY_NOT_EXIST = 9300004,
|
||||
ACCESSIBILITY_ERROR_ACTION_NOT_SUPPORT = 9300005,
|
||||
};
|
||||
|
||||
struct NAccessibilityErrMsg {
|
||||
NAccessibilityErrorCode errCode;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
const std::map<OHOS::Accessibility::RetError, NAccessibilityErrMsg> ACCESSIBILITY_JS_TO_ERROR_CODE_MAP {
|
||||
{OHOS::Accessibility::RetError::RET_OK,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_OK, ""}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_FAILED,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_INVALID_PARAM,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_INVALID_PARAM, ERROR_MESSAGE_PARAMETER_ERROR}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NULLPTR,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_IPC_FAILED,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_SAMGR,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_PERMISSION,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_NO_PERMISSION, ERROR_MESSAGE_NO_PERMISSION}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_TIME_OUT,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_REGISTER_EXIST,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_REGISTER,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_CONNECTION_EXIST,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_TARGET_ABILITY_ALREADY_ENABLED,
|
||||
ERROR_MESSAGE_TARGET_ABILITY_ALREADY_ENABLED}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_CONNECTION,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_WINDOW_CONNECTION,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_CAPABILITY,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_NO_RIGHT, ERROR_MESSAGE_NO_RIGHT}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_INVALID_ELEMENT_INFO_FROM_ACE,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_PERFORM_ACTION_FAILED_BY_ACE,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NO_INJECTOR,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY, ERROR_MESSAGE_SYSTEM_ABNORMALITY}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NOT_INSTALLED,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_ERROR_EXTENSION_NAME,
|
||||
ERROR_MESSAGE_INVALID_BUNDLE_NAME_OR_ABILITY_NAME}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NOT_ENABLED,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_ERROR_EXTENSION_NAME,
|
||||
ERROR_MESSAGE_INVALID_BUNDLE_NAME_OR_ABILITY_NAME}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_PROPERTY_NOT_EXIST,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_PROPERTY_NOT_EXIST, ERROR_MESSAGE_PROPERTY_NOT_EXIST}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_ACTION_NOT_SUPPORT,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_ACTION_NOT_SUPPORT, ERROR_MESSAGE_ACTION_NOT_SUPPORT}},
|
||||
{OHOS::Accessibility::RetError::RET_ERR_NOT_SYSTEM_APP,
|
||||
{NAccessibilityErrorCode::ACCESSIBILITY_ERROR_NOT_SYSTEM_APP, ERROR_MESSAGE_NOT_SYSTEM_APP}},
|
||||
};
|
||||
#endif // NAPI_ACCESSIBILITY_DEF_H
|
@ -24,8 +24,8 @@
|
||||
#include "accessibility_system_ability_client.h"
|
||||
#include "accessibility_state_event.h"
|
||||
#include "accessibility_ability_info.h"
|
||||
#include "napi_accessibility_utils.h"
|
||||
#include "napi_accessibility_config_observer.h"
|
||||
#include "accessibility_utils.h"
|
||||
#include "accessibility_config_observer.h"
|
||||
|
||||
const uint32_t START_WORK_ARGS_SIZE = 2;
|
||||
struct StateListener {
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include "napi_accessibility_event_info.h"
|
||||
#include "hilog_wrapper.h"
|
||||
#include "napi_accessibility_utils.h"
|
||||
#include "accessibility_utils.h"
|
||||
|
||||
using namespace OHOS;
|
||||
using namespace OHOS::Accessibility;
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <uv.h>
|
||||
#include "accessibility_state_event.h"
|
||||
#include "hilog_wrapper.h"
|
||||
#include "napi_accessibility_utils.h"
|
||||
#include "accessibility_utils.h"
|
||||
|
||||
using namespace OHOS;
|
||||
using namespace OHOS::Accessibility;
|
||||
|
Loading…
Reference in New Issue
Block a user