告警清理

Signed-off-by: wangjin_123 <wangjin193@huawei.com>
This commit is contained in:
wangjin_123 2024-01-30 14:07:15 +08:00
parent c4909e47d4
commit e57cc44d2b
6 changed files with 25 additions and 22 deletions

View File

@ -24,7 +24,7 @@ namespace Accessibility {
class AccessibilityAbilityInfoParcel : public AccessibilityAbilityInfo, public Parcelable {
public:
AccessibilityAbilityInfoParcel() = default;
AccessibilityAbilityInfoParcel(const AccessibilityAbilityInfo &accessibilityAbilityInfo);
explicit AccessibilityAbilityInfoParcel(const AccessibilityAbilityInfo &accessibilityAbilityInfo);
/**
* @brief read this sequenceable object from a Parcel.

View File

@ -35,7 +35,7 @@ public:
* @brief Construct
* @param action The object of AccessibleAction
*/
AccessibleActionParcel(const AccessibleAction &action);
explicit AccessibleActionParcel(const AccessibleAction &action);
/**
* @brief Used for IPC communication
@ -74,7 +74,7 @@ public:
* @brief Construct
* @param rangeInfo The object of RangeInfo.
*/
RangeInfoParcel(const RangeInfo &rangeInfo);
explicit RangeInfoParcel(const RangeInfo &rangeInfo);
/**
* @brief Used for IPC communication
@ -115,7 +115,7 @@ public:
* @since 3
* @sysCap Accessibility
*/
GridInfoParcel(const GridInfo &gridInfo);
explicit GridInfoParcel(const GridInfo &gridInfo);
/**
* @brief Used for IPC communication
@ -199,7 +199,7 @@ public:
* @since 3
* @sysCap Accessibility
*/
RectParcel(const Rect &rect);
explicit RectParcel(const Rect &rect);
/**
* @brief Used for IPC communication

View File

@ -36,7 +36,7 @@ public:
* @since 3
* @sysCap Accessibility
*/
AccessibilityEventInfoParcel(const AccessibilityEventInfo &eventInfo);
explicit AccessibilityEventInfoParcel(const AccessibilityEventInfo &eventInfo);
/**
* @brief Used for IPC communication

View File

@ -24,7 +24,7 @@ namespace Accessibility {
class AccessibilityWindowInfoParcel : public AccessibilityWindowInfo, public Parcelable {
public:
AccessibilityWindowInfoParcel() = default;
AccessibilityWindowInfoParcel(const AccessibilityWindowInfo &accessibilityWindowInfo);
explicit AccessibilityWindowInfoParcel(const AccessibilityWindowInfo &accessibilityWindowInfo);
/**
* @brief Used for IPC communication.

View File

@ -25,6 +25,17 @@
const uint32_t CONFIG_START_WORK_ARGS_SIZE = 2;
namespace OHOS {
namespace Accessibility {
napi_handle_scope TmpOpenScope(napi_env env)
{
napi_handle_scope scope = nullptr;
NAPI_CALL(env, napi_open_handle_scope(env, &scope));
return scope;
}
}
}
struct NAccessibilityConfigObserver {
public:
NAccessibilityConfigObserver(napi_env env, napi_ref callback, OHOS::AccessibilityConfig::CONFIG_ID id)
@ -68,5 +79,4 @@ private:
std::mutex mutex_;
std::vector<std::shared_ptr<NAccessibilityConfigObserver>> observers_ = {};
};
napi_handle_scope TmpOpenScope(napi_env env);
#endif // ACCESSIBILITY_CONFIG_OBSERVER_H

View File

@ -105,7 +105,7 @@ int NAccessibilityConfigObserver::NotifyStateChanged(uv_work_t *work)
napi_close_handle_scope(callbackInfo->env_, scope);
};
std::unique_ptr<napi_handle_scope__, decltype(closeScope)> scopes(
TmpOpenScope(callbackInfo->env_), closeScope);
OHOS::Accessibility::(callbackInfo->env_), closeScope);
napi_value jsEvent;
napi_create_object(callbackInfo->env_, &jsEvent);
napi_get_boolean(callbackInfo->env_, callbackInfo->state_, &jsEvent);
@ -139,7 +139,7 @@ int NAccessibilityConfigObserver::NotifyPropertyChanged(uv_work_t *work)
napi_close_handle_scope(callbackInfo->env_, scope);
};
std::unique_ptr<napi_handle_scope__, decltype(closeScope)> scopes(
TmpOpenScope(callbackInfo->env_), closeScope);
OHOS::Accessibility::TmpOpenScope(callbackInfo->env_), closeScope);
napi_value jsEvent;
napi_create_object(callbackInfo->env_, &jsEvent);
ConvertCaptionPropertyToJS(callbackInfo->env_, jsEvent, callbackInfo->caption_);
@ -173,7 +173,7 @@ int NAccessibilityConfigObserver::NotifyStringChanged(uv_work_t *work)
napi_close_handle_scope(callbackInfo->env_, scope);
};
std::unique_ptr<napi_handle_scope__, decltype(closeScope)> scopes(
TmpOpenScope(callbackInfo->env_), closeScope);
OHOS::Accessibility::TmpOpenScope(callbackInfo->env_), closeScope);
napi_value jsEvent;
napi_create_string_utf8(callbackInfo->env_, callbackInfo->stringValue_.c_str(),
callbackInfo->stringValue_.length(), &jsEvent);
@ -208,7 +208,7 @@ int NAccessibilityConfigObserver::NotifyStringVectorChanged(uv_work_t *work)
napi_close_handle_scope(callbackInfo->env_, scope);
};
std::unique_ptr<napi_handle_scope__, decltype(closeScope)> scopes(
TmpOpenScope(callbackInfo->env_), closeScope);
OHOS::Accessibility::TmpOpenScope(callbackInfo->env_), closeScope);
napi_value jsEvent;
napi_create_array(callbackInfo->env_, &jsEvent);
ConvertStringVecToJS(callbackInfo->env_, jsEvent, callbackInfo->stringVector_);
@ -247,7 +247,7 @@ int NAccessibilityConfigObserver::NotifyIntChanged(uv_work_t *work)
napi_close_handle_scope(callbackInfo->env_, scope);
};
std::unique_ptr<napi_handle_scope__, decltype(closeScope)> scopes(
TmpOpenScope(callbackInfo->env_), closeScope);
OHOS::Accessibility::TmpOpenScope(callbackInfo->env_), closeScope);
napi_value jsEvent;
napi_create_int32(callbackInfo->env_, callbackInfo->int32Value_, &jsEvent);
@ -283,7 +283,7 @@ int NAccessibilityConfigObserver::NotifyUintChanged(uv_work_t *work)
napi_close_handle_scope(callbackInfo->env_, scope);
};
std::unique_ptr<napi_handle_scope__, decltype(closeScope)> scopes(
TmpOpenScope(callbackInfo->env_), closeScope);
OHOS::Accessibility::TmpOpenScope(callbackInfo->env_), closeScope);
napi_value jsEvent;
napi_create_uint32(callbackInfo->env_, callbackInfo->uint32Value_, &jsEvent);
@ -319,7 +319,7 @@ int NAccessibilityConfigObserver::NotifyFloatChanged(uv_work_t *work)
napi_close_handle_scope(callbackInfo->env_, scope);
};
std::unique_ptr<napi_handle_scope__, decltype(closeScope)> scopes(
TmpOpenScope(callbackInfo->env_), closeScope);
OHOS::Accessibility::TmpOpenScope(callbackInfo->env_), closeScope);
napi_value jsEvent;
napi_create_double(callbackInfo->env_, double(callbackInfo->floatValue_), &jsEvent);
@ -624,10 +624,3 @@ void NAccessibilityConfigObserverImpl::UnsubscribeObservers(OHOS::AccessibilityC
}
}
}
napi_handle_scope TmpOpenScope(napi_env env)
{
napi_handle_scope scope = nullptr;
NAPI_CALL(env, napi_open_handle_scope(env, &scope));
return scope;
}