Signed-off-by: pengyanggit yangpeng177@huawei.com

Signed-off-by: pengyanggit <yangpeng177@huawei.com>
Change-Id: I703b9a753c18a4bf2a2343dc8c567de4c9fc1105
This commit is contained in:
pengyanggit 2024-07-25 20:04:13 +08:00
parent ad8032a9f7
commit 4ba98c855a
12 changed files with 8 additions and 15 deletions

View File

@ -69,7 +69,6 @@ public:
napi_deferred deferred { nullptr };
CallbackData data;
};
template <typename T>
static void DeletePtr(T &ptr)
{

View File

@ -798,7 +798,6 @@ void JsEventTarget::EmitMouseLocationEvent(uv_work_t *work, int32_t status)
FI_HILOGE("Emit mouse location event, check data is nullptr");
return;
}
sptr<JsUtil::MouseCallbackInfo> temp(static_cast<JsUtil::MouseCallbackInfo *>(work->data));
JsUtil::DeletePtr<uv_work_t*>(work);
temp->DecStrongRef(nullptr);

View File

@ -56,13 +56,11 @@ public:
static std::string GetLocalNetworkId();
};
void MouseLocationListenerTest::SetUpTestCase() {}
void MouseLocationListenerTest::SetUp()
{
const int32_t permsNum = 3;
const char *perms[] = {DM_SERVICE_ACCESS_NEWPERMISSION.c_str(), DM_SERVICE_ACCESS_PERMISSION.c_str(),
COOPERATE_ACCESS_PERMISSION.c_str()};
NativeTokenInfoParams infoInstance = {

View File

@ -31,7 +31,6 @@
namespace OHOS {
namespace Msdp {
namespace DeviceStatus {
namespace {
const std::string THREAD_NAME { "os_ClientEventHandler" };
} // namespace

View File

@ -33,7 +33,6 @@ namespace Msdp {
namespace DeviceStatus {
namespace Cooperate {
namespace {
const std::string COOPERATE_SWITCH { "currentStatus" };
const std::string THREAD_NAME { "os_Cooperate_EventHandler" };
constexpr double PERCENT { 100.0 };
} // namespace

View File

@ -207,7 +207,7 @@ int32_t CooperateServer::GetParam(CallingContext &context, uint32_t id, MessageP
ICooperate* cooperate = context_->GetPluginManager().LoadCooperate();
CHKPR(cooperate, RET_ERR);
auto enterStamp = std::chrono::steady_clock::now();
auto checkParcelValid = [&enterStamp] () {
auto checkParcelValid = [enterStamp] () {
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now() - enterStamp).count();
return duration < SYNC_TASK_TIMEOUT_DURATION;

View File

@ -58,7 +58,7 @@ public:
int32_t GetDragSummary(ITunnelClient &tunnel, std::map<std::string, int64_t> &summary,
bool isJsCaller = false);
int32_t GetDragState(ITunnelClient &tunnel, DragState &dragState);
int32_t EnterTextEditorArea(ITunnelClient &tunnel, bool enable);
int32_t EnableUpperCenterMode(ITunnelClient &tunnel, bool enable);
int32_t GetDragAction(ITunnelClient &tunnel, DragAction &dragAction);
int32_t GetExtraInfo(ITunnelClient &tunnel, std::string &extraInfo);
int32_t AddPrivilege(ITunnelClient &tunnel);

View File

@ -445,7 +445,7 @@ int32_t IntentionManager::GetDragSummary(std::map<std::string, int64_t> &summary
int32_t IntentionManager::EnterTextEditorArea(bool enable)
{
CALL_DEBUG_ENTER;
return drag_.EnterTextEditorArea(*tunnel_, enable);
return drag_.EnableUpperCenterMode(*tunnel_, enable);
}
int32_t IntentionManager::AddPrivilege()

View File

@ -130,7 +130,6 @@ void SocketSessionManager::Dispatch(const struct epoll_event &ev)
DispatchOne();
} else if ((ev.events & (EPOLLHUP | EPOLLERR)) != 0) {
FI_HILOGE("Epoll hangup:%{public}s", ::strerror(errno));
/// TODO: Add error handling here.
}
}

View File

@ -1701,7 +1701,6 @@ void DragDrawing::SetDecodeOptions(Media::DecodeOptions &decodeOpts)
FI_HILOGD("leave");
}
void DragDrawing::ParserDragShadowInfo(cJSON* filterInfoParser, FilterInfo &filterInfo)
{
CHKPV(filterInfoParser);
@ -1740,7 +1739,7 @@ void DragDrawing::ParserDragShadowInfo(cJSON* filterInfoParser, FilterInfo &filt
filterInfo.elevation = static_cast<float>(elevation->valuedouble);
}
} else {
cJSON *shadowCorner = cJSON_GetObjectItemCaseSensitive(filterInfoParser, "shadow_corner");
cJSON *shadowCorner = cJSON_GetObjectItemCaseSensitive(filterInfoParser, "shadow_corner");
if (cJSON_IsNumber(shadowCorner)) {
filterInfo.shadowCorner = static_cast<float>(shadowCorner->valuedouble);
}
@ -2878,10 +2877,10 @@ void DrawPixelMapModifier::Draw(Rosen::RSDrawingContext &context) const
void DrawMouseIconModifier::Draw(Rosen::RSDrawingContext &context) const
{
FI_HILOGD("enter");
std::shared_ptr<Media::PixelMap> pixelMap;
std::shared_ptr<Media::PixelMap> pixelMap = std::make_shared<Media::PixelMap>();
int32_t ret = MMI::InputManager::GetInstance()->GetPointerSnapshot(&pixelMap);
if (ret != RET_OK) {
FI_HILOGW("Get pointer snapshot failed, ret:%{public}d", ret);
FI_HILOGE("Get pointer snapshot failed, ret:%{public}d", ret);
pixelMap = DrawFromSVG();
}
CHKPV(pixelMap);

View File

@ -176,6 +176,8 @@ HWTEST_F(DragDataManagerTest, DragDataManagerTest003, TestSize.Level0)
int32_t targetPid = IPCSkeleton::GetCallingPid();
DRAG_DATA_MGR.SetTargetPid(targetPid);
EXPECT_TRUE(targetPid == DRAG_DATA_MGR.GetTargetPid());
float dragOriginDpi = DRAG_DATA_MGR.GetDragOriginDpi();
EXPECT_TRUE(dragOriginDpi == 0.0f);
}
/**

View File

@ -58,4 +58,3 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
} // namespace DeviceStatus
} // namespace Msdp
} // namespace OHOS