Loading services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,8 @@ private: void notifyDropWindow(const sp<IBinder>&, float x, float y) override {} bool isPerDisplayTouchModeEnabled() override { return false; } InputDispatcherConfiguration mConfig; }; Loading services/inputflinger/dispatcher/InputDispatcher.cpp +8 −6 Original line number Diff line number Diff line Loading @@ -553,7 +553,8 @@ InputDispatcher::InputDispatcher(const sp<InputDispatcherPolicyInterface>& polic mWindowTokenWithPointerCapture(nullptr), mStaleEventTimeout(staleEventTimeout), mLatencyAggregator(), mLatencyTracker(&mLatencyAggregator) { mLatencyTracker(&mLatencyAggregator), kPerDisplayTouchModeEnabled(mPolicy->isPerDisplayTouchModeEnabled()) { mLooper = new Looper(false); mReporter = createInputReporter(); Loading Loading @@ -4987,8 +4988,8 @@ void InputDispatcher::setInputFilterEnabled(bool enabled) { mLooper->wake(); } bool InputDispatcher::setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission) { bool InputDispatcher::setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission, int32_t displayId) { bool needWake = false; { std::scoped_lock lock(mLock); Loading @@ -4997,8 +4998,9 @@ bool InputDispatcher::setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, } if (DEBUG_TOUCH_MODE) { ALOGD("Request to change touch mode from %s to %s (calling pid=%d, uid=%d, " "hasPermission=%s)", toString(mInTouchMode), toString(inTouchMode), pid, uid, toString(hasPermission)); "hasPermission=%s, target displayId=%d, perDisplayTouchModeEnabled=%s)", toString(mInTouchMode), toString(inTouchMode), pid, uid, toString(hasPermission), displayId, toString(kPerDisplayTouchModeEnabled)); } if (!hasPermission) { if (!focusedWindowIsOwnedByLocked(pid, uid) && Loading @@ -5010,7 +5012,7 @@ bool InputDispatcher::setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, } } // TODO(b/198499018): Store touch mode per display. // TODO(b/198499018): Store touch mode per display (kPerDisplayTouchModeEnabled) mInTouchMode = inTouchMode; auto entry = std::make_unique<TouchModeEntry>(mIdGenerator.nextId(), now(), inTouchMode); Loading services/inputflinger/dispatcher/InputDispatcher.h +5 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,8 @@ public: void setFocusedDisplay(int32_t displayId) override; void setInputDispatchMode(bool enabled, bool frozen) override; void setInputFilterEnabled(bool enabled) override; bool setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission) override; bool setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission, int32_t displayId) override; void setMaximumObscuringOpacityForTouch(float opacity) override; bool transferTouchFocus(const sp<IBinder>& fromToken, const sp<IBinder>& toToken, Loading Loading @@ -685,6 +686,9 @@ private: bool focusedWindowIsOwnedByLocked(int32_t pid, int32_t uid) REQUIRES(mLock); bool recentWindowsAreOwnedByLocked(int32_t pid, int32_t uid) REQUIRES(mLock); // Per display touch mode enabled const bool kPerDisplayTouchModeEnabled; sp<InputReporterInterface> mReporter; }; Loading services/inputflinger/dispatcher/include/InputDispatcherInterface.h +2 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,8 @@ public: * * Returns true when changing touch mode state. */ virtual bool setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission) = 0; virtual bool setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission, int32_t displayId) = 0; /** * Sets the maximum allowed obscuring opacity by UID to propagate touches. Loading services/inputflinger/dispatcher/include/InputDispatcherPolicyInterface.h +3 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,9 @@ public: /* Notifies the policy that the drag window has moved over to another window */ virtual void notifyDropWindow(const sp<IBinder>& token, float x, float y) = 0; /* If touch mode is enabled per display or global */ virtual bool isPerDisplayTouchModeEnabled() = 0; }; } // namespace android Loading Loading
services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,8 @@ private: void notifyDropWindow(const sp<IBinder>&, float x, float y) override {} bool isPerDisplayTouchModeEnabled() override { return false; } InputDispatcherConfiguration mConfig; }; Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +8 −6 Original line number Diff line number Diff line Loading @@ -553,7 +553,8 @@ InputDispatcher::InputDispatcher(const sp<InputDispatcherPolicyInterface>& polic mWindowTokenWithPointerCapture(nullptr), mStaleEventTimeout(staleEventTimeout), mLatencyAggregator(), mLatencyTracker(&mLatencyAggregator) { mLatencyTracker(&mLatencyAggregator), kPerDisplayTouchModeEnabled(mPolicy->isPerDisplayTouchModeEnabled()) { mLooper = new Looper(false); mReporter = createInputReporter(); Loading Loading @@ -4987,8 +4988,8 @@ void InputDispatcher::setInputFilterEnabled(bool enabled) { mLooper->wake(); } bool InputDispatcher::setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission) { bool InputDispatcher::setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission, int32_t displayId) { bool needWake = false; { std::scoped_lock lock(mLock); Loading @@ -4997,8 +4998,9 @@ bool InputDispatcher::setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, } if (DEBUG_TOUCH_MODE) { ALOGD("Request to change touch mode from %s to %s (calling pid=%d, uid=%d, " "hasPermission=%s)", toString(mInTouchMode), toString(inTouchMode), pid, uid, toString(hasPermission)); "hasPermission=%s, target displayId=%d, perDisplayTouchModeEnabled=%s)", toString(mInTouchMode), toString(inTouchMode), pid, uid, toString(hasPermission), displayId, toString(kPerDisplayTouchModeEnabled)); } if (!hasPermission) { if (!focusedWindowIsOwnedByLocked(pid, uid) && Loading @@ -5010,7 +5012,7 @@ bool InputDispatcher::setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, } } // TODO(b/198499018): Store touch mode per display. // TODO(b/198499018): Store touch mode per display (kPerDisplayTouchModeEnabled) mInTouchMode = inTouchMode; auto entry = std::make_unique<TouchModeEntry>(mIdGenerator.nextId(), now(), inTouchMode); Loading
services/inputflinger/dispatcher/InputDispatcher.h +5 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,8 @@ public: void setFocusedDisplay(int32_t displayId) override; void setInputDispatchMode(bool enabled, bool frozen) override; void setInputFilterEnabled(bool enabled) override; bool setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission) override; bool setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission, int32_t displayId) override; void setMaximumObscuringOpacityForTouch(float opacity) override; bool transferTouchFocus(const sp<IBinder>& fromToken, const sp<IBinder>& toToken, Loading Loading @@ -685,6 +686,9 @@ private: bool focusedWindowIsOwnedByLocked(int32_t pid, int32_t uid) REQUIRES(mLock); bool recentWindowsAreOwnedByLocked(int32_t pid, int32_t uid) REQUIRES(mLock); // Per display touch mode enabled const bool kPerDisplayTouchModeEnabled; sp<InputReporterInterface> mReporter; }; Loading
services/inputflinger/dispatcher/include/InputDispatcherInterface.h +2 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,8 @@ public: * * Returns true when changing touch mode state. */ virtual bool setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission) = 0; virtual bool setInTouchMode(bool inTouchMode, int32_t pid, int32_t uid, bool hasPermission, int32_t displayId) = 0; /** * Sets the maximum allowed obscuring opacity by UID to propagate touches. Loading
services/inputflinger/dispatcher/include/InputDispatcherPolicyInterface.h +3 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,9 @@ public: /* Notifies the policy that the drag window has moved over to another window */ virtual void notifyDropWindow(const sp<IBinder>& token, float x, float y) = 0; /* If touch mode is enabled per display or global */ virtual bool isPerDisplayTouchModeEnabled() = 0; }; } // namespace android Loading