mirror of
https://github.com/openharmony/miscservices_inputmethod.git
synced 2026-07-18 17:24:37 -04:00
@@ -17,7 +17,6 @@
|
||||
#define FM_IMMS_PROJECT_IMCOMMONEVENTMANAGER_H
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include "common_event_subscriber.h"
|
||||
#include "common_event_subscribe_info.h"
|
||||
#include "common_event_data.h"
|
||||
@@ -25,7 +24,6 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
|
||||
class ImCommonEventManager : public RefBase {
|
||||
public:
|
||||
ImCommonEventManager();
|
||||
@@ -36,7 +34,8 @@ public:
|
||||
|
||||
class EventSubscriber : public EventFwk::CommonEventSubscriber {
|
||||
public:
|
||||
EventSubscriber(const EventFwk::CommonEventSubscribeInfo &subscribeInfo) : EventFwk::CommonEventSubscriber(subscribeInfo) {}
|
||||
EventSubscriber(const EventFwk::CommonEventSubscribeInfo &subscribeInfo) :
|
||||
EventFwk::CommonEventSubscriber(subscribeInfo) {}
|
||||
void OnReceiveEvent(const EventFwk::CommonEventData &data);
|
||||
void startUser(int32_t newUserId);
|
||||
};
|
||||
@@ -45,7 +44,6 @@ private:
|
||||
static std::mutex instanceLock_;
|
||||
static sptr<ImCommonEventManager> instance_;
|
||||
};
|
||||
|
||||
} // namespace MiscServices
|
||||
} // namespace OHOS
|
||||
#endif // FM_IMMS_PROJECT_IPLATFORMCALLBACK_H
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
#include "im_common_event_manager.h"
|
||||
#include "common_event_manager.h"
|
||||
#include "common_event_support.h"
|
||||
@@ -32,16 +31,12 @@ namespace MiscServices {
|
||||
/*! Constructor
|
||||
*/
|
||||
ImCommonEventManager::ImCommonEventManager()
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
/*! Destructor
|
||||
*/
|
||||
ImCommonEventManager::~ImCommonEventManager()
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
sptr<ImCommonEventManager> ImCommonEventManager::GetInstance()
|
||||
{
|
||||
@@ -62,18 +57,14 @@ namespace MiscServices {
|
||||
|
||||
EventFwk::CommonEventSubscribeInfo subscriberInfo(matchingSkills);
|
||||
|
||||
// std::shared_ptr<EventSubscriber> subscriber =
|
||||
// std::make_shared<EventSubscriber>(subscriberInfo, event);
|
||||
std::shared_ptr<EventSubscriber> subscriber =
|
||||
std::make_shared<EventSubscriber>(subscriberInfo);
|
||||
|
||||
std::shared_ptr<EventSubscriber> subscriber = std::make_shared<EventSubscriber>(subscriberInfo);
|
||||
if (subscriber == nullptr) {
|
||||
IMSA_HILOGI("ImCommonEventManager::SubscribeEvent subscriber is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!EventFwk::CommonEventManager::SubscribeCommonEvent(subscriber)) {
|
||||
IMSA_HILOGI("ImCommonEventManager::SubscribeEvent fail");
|
||||
IMSA_HILOGI("ImCommonEventManager::SubscribeEvent fail");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -694,7 +694,8 @@ namespace MiscServices {
|
||||
}
|
||||
if (setting == nullptr || setting->GetUserState() != UserState::USER_STATE_UNLOCKED) {
|
||||
IMSA_HILOGE("InputMethodSystemAbility::OnHandleMessage Aborted! userId = %{public}d,", userId);
|
||||
IMSA_HILOGE("InputMethodSystemAbility::OnHandleMessage Aborted! userState = %{public}d,", setting->GetUserState());
|
||||
IMSA_HILOGE("InputMethodSystemAbility::OnHandleMessage Aborted! userState = %{public}d",
|
||||
setting->GetUserState());
|
||||
return ErrorCode::ERROR_USER_NOT_UNLOCKED;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user