mirror of
https://gitee.com/openharmony/msdp_device_status
synced 2024-11-23 15:40:16 +00:00
alarm fix
Signed-off-by: lwx1285820 <lishaoxiong10@huawei.com>
This commit is contained in:
parent
8e2498559b
commit
aeeb5745f9
@ -1310,6 +1310,7 @@ HWTEST_F(InteractionManagerTest, InteractionManagerTest_StartDrag_Mouse, TestSiz
|
||||
std::make_shared<UnitTestStartDragListener>(callback));
|
||||
ASSERT_EQ(ret, RET_OK);
|
||||
ret = InteractionManager::GetInstance()->SetDragWindowVisible(true);
|
||||
InteractionManager::GetInstance()->SetDragWindowScreenId(TOUCH_POINTER_ID, TOUCH_POINTER_ID);
|
||||
EXPECT_EQ(ret, RET_OK);
|
||||
SimulateMovePointerEvent({ DRAG_SRC_X, DRAG_SRC_Y }, { DRAG_DST_X, DRAG_DST_Y },
|
||||
MMI::PointerEvent::SOURCE_TYPE_MOUSE, MOUSE_POINTER_ID, true);
|
||||
|
@ -60,11 +60,11 @@ void CooperateFree::OnLeaveState(Context &context)
|
||||
|
||||
void CooperateFree::SetPointerVisible(Context &context)
|
||||
{
|
||||
CHKPV(env_);
|
||||
bool hasLocalPointerDevice = env_->GetDeviceManager().HasLocalPointerDevice();
|
||||
bool visible = !context.NeedHideCursor() && hasLocalPointerDevice;
|
||||
FI_HILOGI("Set pointer visible:%{public}s, HasLocalPointerDevice:%{public}s",
|
||||
visible ? "true" : "false", hasLocalPointerDevice ? "true" : "false");
|
||||
CHKPV(env_);
|
||||
env_->GetInput().SetPointerVisibility(visible, PRIORITY);
|
||||
}
|
||||
|
||||
|
@ -58,11 +58,11 @@ void CooperateOut::OnLeaveState(Context &context)
|
||||
|
||||
void CooperateOut::SetPointerVisible(Context &context)
|
||||
{
|
||||
CHKPV(env_);
|
||||
bool hasLocalPointerDevice = env_->GetDeviceManager().HasLocalPointerDevice();
|
||||
bool visible = !context.NeedHideCursor() && hasLocalPointerDevice;
|
||||
FI_HILOGI("Set pointer visible:%{public}s, HasLocalPointerDevice:%{public}s",
|
||||
visible ? "true" : "false", hasLocalPointerDevice ? "true" : "false");
|
||||
CHKPV(env_);
|
||||
env_->GetInput().SetPointerVisibility(visible, PRIORITY);
|
||||
}
|
||||
|
||||
|
@ -197,12 +197,16 @@ int32_t DragManager::StartDrag(const DragData &dragData, int32_t pid)
|
||||
}
|
||||
std::string packageName = std::string();
|
||||
CHKPR(context_, RET_ERR);
|
||||
dragOutSession_ = context_->GetSocketSessionManager().FindSessionByPid(pid);
|
||||
if (dragOutSession_ != nullptr) {
|
||||
if (pid == -1) {
|
||||
packageName = "Cross-device drag";
|
||||
} else {
|
||||
context_->GetSocketSessionManager().AddSessionDeletedCallback(pid,
|
||||
[this](SocketSessionPtr session) { this->OnSessionLost(session); });
|
||||
dragOutSession_ = context_->GetSocketSessionManager().FindSessionByPid(pid);
|
||||
if (dragOutSession_ != nullptr) {
|
||||
packageName = dragOutSession_->GetProgramName();
|
||||
}
|
||||
}
|
||||
packageName = (pid == -1) ? "Cross-device drag" : dragOutSession_->GetProgramName();
|
||||
PrintDragData(dragData, packageName);
|
||||
if (InitDataManager(dragData) != RET_OK) {
|
||||
FI_HILOGE("Failed to init data manager");
|
||||
|
@ -66,9 +66,7 @@ void DragVSyncStation::StopVSyncRequest()
|
||||
handler_->RemoveAllFileDescriptorListeners();
|
||||
handler_ = nullptr;
|
||||
}
|
||||
if (receiver_ != nullptr) {
|
||||
receiver_ = nullptr;
|
||||
}
|
||||
receiver_ = nullptr;
|
||||
vSyncPeriod_ = 0;
|
||||
if (mmiHandleTid_ > 0) {
|
||||
OHOS::QOS::ResetQosForOtherThread(mmiHandleTid_);
|
||||
@ -157,7 +155,7 @@ void DragVSyncStation::OnVSyncInner(uint64_t nanoTimestamp)
|
||||
std::lock_guard<std::mutex> lock(mtx_);
|
||||
vSyncCallbacks.swap(vSyncCallbacks_);
|
||||
}
|
||||
for (auto &callback : vSyncCallbacks) {
|
||||
for (auto const &callback : vSyncCallbacks) {
|
||||
if (callback.second != nullptr) {
|
||||
(*callback.second)(nanoTimestamp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user