18 #ifndef MIR_EVENT_FILTER_DISPATCHER_POLICY_H_
19 #define MIR_EVENT_FILTER_DISPATCHER_POLICY_H_
23 #include <InputDispatcher.h>
30 namespace droidinput = android;
40 class EventFilterDispatcherPolicy :
public droidinput::InputDispatcherPolicyInterface
43 EventFilterDispatcherPolicy(std::shared_ptr<EventFilter>
const& event_filter,
bool key_repeat_enabled);
44 virtual ~EventFilterDispatcherPolicy() {}
46 void notifyConfigurationChanged(
nsecs_t when);
47 nsecs_t notifyANR(droidinput::sp<droidinput::InputApplicationHandle>
const& inputApplicationHandle,
48 droidinput::sp<droidinput::InputWindowHandle>
const& inputWindowHandle);
49 void notifyInputChannelBroken(droidinput::sp<droidinput::InputWindowHandle>
const& inputWindowHandle);
50 bool filterInputEvent(
const droidinput::InputEvent* input_event,
51 uint32_t policy_flags);
52 void interceptKeyBeforeQueueing(
const droidinput::KeyEvent* key_event,
53 uint32_t& policy_flags);
54 void getDispatcherConfiguration(droidinput::InputDispatcherConfiguration* outConfig);
55 bool isKeyRepeatEnabled();
56 void interceptMotionBeforeQueueing(
nsecs_t when, uint32_t& policyFlags);
58 nsecs_t interceptKeyBeforeDispatching(droidinput::sp<droidinput::InputWindowHandle>
const& inputWindowHandle,
59 droidinput::KeyEvent
const* keyEvent, uint32_t policyFlags);
61 bool dispatchUnhandledKey(droidinput::sp<droidinput::InputWindowHandle>
const& inputWindowHandle,
62 droidinput::KeyEvent
const* keyEvent, uint32_t policyFlags,
63 droidinput::KeyEvent* outFallbackKeyEvent);
65 void notifySwitch(
nsecs_t when, int32_t switchCode, int32_t switchValue, uint32_t policyFlags);
66 void pokeUserActivity(
nsecs_t eventTime, int32_t eventType);
67 bool checkInjectEventsPermissionNonReentrant(int32_t injectorPid, int32_t injectorUid);
70 EventFilterDispatcherPolicy(
const EventFilterDispatcherPolicy&) =
delete;
71 EventFilterDispatcherPolicy& operator=(
const EventFilterDispatcherPolicy&) =
delete;
73 std::shared_ptr<EventFilter> event_filter;
74 bool key_repeat_enabled;
81 #endif // MIR_DUMMY_INPUT_DISPATCHER_POLICY_H_