diff options
Diffstat (limited to 'include/ui/InputDispatcher.h')
-rw-r--r-- | include/ui/InputDispatcher.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/include/ui/InputDispatcher.h b/include/ui/InputDispatcher.h index 5f77cba..15a3925 100644 --- a/include/ui/InputDispatcher.h +++ b/include/ui/InputDispatcher.h @@ -219,6 +219,8 @@ struct InputWindow { * motion events to be delivered to them with AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED. */ bool isTrustedOverlay() const; + + bool supportsSplitTouch() const; }; @@ -304,6 +306,10 @@ public: virtual bool interceptKeyBeforeDispatching(const sp<InputChannel>& inputChannel, const KeyEvent* keyEvent, uint32_t policyFlags) = 0; + /* Allows the policy a chance to perform default processing for an unhandled key. */ + virtual bool dispatchUnhandledKey(const sp<InputChannel>& inputChannel, + const KeyEvent* keyEvent, uint32_t policyFlags) = 0; + /* Notifies the policy about switch events. */ virtual void notifySwitch(nsecs_t when, @@ -387,6 +393,14 @@ public: */ virtual void setInputDispatchMode(bool enabled, bool frozen) = 0; + /* Transfers touch focus from the window associated with one channel to the + * window associated with the other channel. + * + * Returns true on success. False if the window did not actually have touch focus. + */ + virtual bool transferTouchFocus(const sp<InputChannel>& fromChannel, + const sp<InputChannel>& toChannel) = 0; + /* Registers or unregister input channels that may be used as targets for input events. * If monitor is true, the channel will receive a copy of all input events. * @@ -443,6 +457,9 @@ public: virtual void setFocusedApplication(const InputApplication* inputApplication); virtual void setInputDispatchMode(bool enabled, bool frozen); + virtual bool transferTouchFocus(const sp<InputChannel>& fromChannel, + const sp<InputChannel>& toChannel); + virtual status_t registerInputChannel(const sp<InputChannel>& inputChannel, bool monitor); virtual status_t unregisterInputChannel(const sp<InputChannel>& inputChannel); @@ -598,6 +615,7 @@ private: sp<InputChannel> inputChannel; sp<InputApplicationHandle> inputApplicationHandle; int32_t userActivityEventType; + bool handled; }; // Generic queue implementation. @@ -744,6 +762,9 @@ private: // Clears the current state. void clear(); + // Copies pointer-related parts of the input state to another instance. + void copyPointerStateTo(InputState& other) const; + private: struct KeyMemento { int32_t deviceId; @@ -927,7 +948,7 @@ private: struct TouchedWindow { const InputWindow* window; int32_t targetFlags; - BitSet32 pointerIds; + BitSet32 pointerIds; // zero unless target flag FLAG_SPLIT is set sp<InputChannel> channel; }; struct TouchState { @@ -1016,7 +1037,8 @@ private: EventEntry* eventEntry, const InputTarget* inputTarget, bool resumeWithAppendedMotionSample); void startDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection); - void finishDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection); + void finishDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, + bool handled); void startNextDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection); void abortBrokenDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection); void drainOutboundQueueLocked(Connection* connection); @@ -1047,7 +1069,7 @@ private: void onDispatchCycleStartedLocked( nsecs_t currentTime, const sp<Connection>& connection); void onDispatchCycleFinishedLocked( - nsecs_t currentTime, const sp<Connection>& connection); + nsecs_t currentTime, const sp<Connection>& connection, bool handled); void onDispatchCycleBrokenLocked( nsecs_t currentTime, const sp<Connection>& connection); void onANRLocked( @@ -1059,7 +1081,9 @@ private: void doNotifyInputChannelBrokenLockedInterruptible(CommandEntry* commandEntry); void doNotifyANRLockedInterruptible(CommandEntry* commandEntry); void doInterceptKeyBeforeDispatchingLockedInterruptible(CommandEntry* commandEntry); + void doDispatchCycleFinishedLockedInterruptible(CommandEntry* commandEntry); void doPokeUserActivityLockedInterruptible(CommandEntry* commandEntry); + void initializeKeyEvent(KeyEvent* event, const KeyEntry* entry); // Statistics gathering. void updateDispatchStatisticsLocked(nsecs_t currentTime, const EventEntry* entry, |