mirror of
https://gitee.com/openharmony/msdp_device_status
synced 2024-11-27 09:41:43 +00:00
xiping
Signed-off-by: yang123 <yangyanling13@huawei.com>
This commit is contained in:
parent
b7ed244001
commit
c07f438c4e
@ -63,7 +63,8 @@
|
||||
"memmgr",
|
||||
"os_account",
|
||||
"libxml2",
|
||||
"wifi"
|
||||
"wifi",
|
||||
"power_manager"
|
||||
],
|
||||
"third_party": [
|
||||
"libuv",
|
||||
|
@ -79,6 +79,7 @@ ohos_shared_library("intention_cooperate") {
|
||||
"image_framework:image_native",
|
||||
"input:libmmi-client",
|
||||
"ipc:ipc_single",
|
||||
"power_manager:powermgr_client",
|
||||
"samgr:samgr_proxy",
|
||||
"wifi:wifi_sdk",
|
||||
"window_manager:libdm",
|
||||
|
@ -46,6 +46,7 @@ private:
|
||||
void TurnOffChannelScan();
|
||||
void TurnOnChannelScan();
|
||||
int32_t SetWifiScene(unsigned int scene);
|
||||
void RefreshActivity();
|
||||
|
||||
IContext *env_ { nullptr };
|
||||
int32_t interceptorId_ { -1 };
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "cooperate_context.h"
|
||||
#include "devicestatus_define.h"
|
||||
#include "display_manager.h"
|
||||
#include "power_mgr_client.h"
|
||||
#include "input_event_transmission/input_event_serialization.h"
|
||||
#include "utility.h"
|
||||
#include "kits/c/wifi_hid2d.h"
|
||||
@ -100,6 +101,7 @@ void InputEventInterceptor::OnPointerEvent(std::shared_ptr<MMI::PointerEvent> po
|
||||
if (scanState_) {
|
||||
TurnOffChannelScan();
|
||||
}
|
||||
RefreshActivity();
|
||||
if ((pointerEventTimer_ > 0) && (env_->GetTimerManager().IsExist(pointerEventTimer_))) {
|
||||
env_->GetTimerManager().RemoveTimer(pointerEventTimer_);
|
||||
pointerEventTimer_ = -1;
|
||||
@ -151,6 +153,7 @@ void InputEventInterceptor::OnNotifyCrossDrag(std::shared_ptr<MMI::PointerEvent>
|
||||
void InputEventInterceptor::OnKeyEvent(std::shared_ptr<MMI::KeyEvent> keyEvent)
|
||||
{
|
||||
CHKPV(keyEvent);
|
||||
RefreshActivity();
|
||||
if (filterKeys_.find(keyEvent->GetKeyCode()) != filterKeys_.end()) {
|
||||
keyEvent->AddFlag(MMI::AxisEvent::EVENT_FLAG_NO_INTERCEPT);
|
||||
env_->GetInput().SimulateInputEvent(keyEvent);
|
||||
@ -223,6 +226,16 @@ void InputEventInterceptor::ReportPointerEvent(std::shared_ptr<MMI::PointerEvent
|
||||
FI_HILOGE("Failed to send event via channel, error:%{public}d", ret);
|
||||
}
|
||||
}
|
||||
|
||||
void InputEventInterceptor::RefreshActivity()
|
||||
{
|
||||
bool ret = PowerMgrClient::GetInstance().RefreshActivity(
|
||||
OHOS::powerMgr::UserActivityType::USER_ACTIVITY_TYPE_TOUCH);
|
||||
if (ret != true) {
|
||||
FI_HILOGE("RefreshActivity Failed");
|
||||
}
|
||||
return;
|
||||
}
|
||||
} // namespace Cooperate
|
||||
} // namespace DeviceStatus
|
||||
} // namespace Msdp
|
||||
|
Loading…
Reference in New Issue
Block a user