Loading services/inputflinger/dispatcher/InputDispatcher.cpp +0 −6 Original line number Diff line number Diff line Loading @@ -1652,12 +1652,6 @@ bool InputDispatcher::dispatchConfigurationChangedLocked(nsecs_t currentTime, // Reset key repeating in case a keyboard device was added or removed or something. resetKeyRepeatLocked(); // Enqueue a command to run outside the lock to tell the policy that the configuration changed. auto command = [this, eventTime = entry.eventTime]() REQUIRES(mLock) { scoped_unlock unlock(mLock); mPolicy.notifyConfigurationChanged(eventTime); }; postCommandLocked(std::move(command)); return true; } Loading services/inputflinger/dispatcher/include/InputDispatcherPolicyInterface.h +0 −3 Original line number Diff line number Diff line Loading @@ -43,9 +43,6 @@ public: InputDispatcherPolicyInterface() = default; virtual ~InputDispatcherPolicyInterface() = default; /* Notifies the system that a configuration change has occurred. */ virtual void notifyConfigurationChanged(nsecs_t when) = 0; /* Notifies the system that an application does not have a focused window. */ virtual void notifyNoFocusedWindowAnr( Loading services/inputflinger/include/InputReaderBase.h +3 −0 Original line number Diff line number Diff line Loading @@ -454,6 +454,9 @@ public: */ virtual void notifyInputDevicesChanged(const std::vector<InputDeviceInfo>& inputDevices) = 0; /* Notifies the system that a configuration change has occurred. */ virtual void notifyConfigurationChanged(nsecs_t when) = 0; /* Gets the keyboard layout for a particular input device. */ virtual std::shared_ptr<KeyCharacterMap> getKeyboardLayoutOverlay( const InputDeviceIdentifier& identifier, Loading services/inputflinger/reader/InputReader.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -212,6 +212,15 @@ void InputReader::loopOnce() { mPolicy->notifyInputDevicesChanged(inputDevices); } // Notify the policy of configuration change. This must be after policy is notified about input // device changes so that policy can fetch newly added input devices on configuration change. for (const auto& args : notifyArgs) { const auto* configArgs = std::get_if<NotifyConfigurationChangedArgs>(&args); if (configArgs != nullptr) { mPolicy->notifyConfigurationChanged(configArgs->eventTime); } } // Notify the policy of the start of every new stylus gesture. for (const auto& args : notifyArgs) { const auto* motionArgs = std::get_if<NotifyMotionArgs>(&args); Loading services/inputflinger/tests/FakeInputDispatcherPolicy.cpp +0 −12 Original line number Diff line number Diff line Loading @@ -54,13 +54,6 @@ void FakeInputDispatcherPolicy::assertFilterInputEventWasNotCalled() { ASSERT_EQ(nullptr, mFilteredEvent); } void FakeInputDispatcherPolicy::assertNotifyConfigurationChangedWasCalled(nsecs_t when) { std::scoped_lock lock(mLock); ASSERT_TRUE(mConfigurationChangedTime) << "Timed out waiting for configuration changed call"; ASSERT_EQ(*mConfigurationChangedTime, when); mConfigurationChangedTime = std::nullopt; } void FakeInputDispatcherPolicy::assertNotifySwitchWasCalled(const NotifySwitchArgs& args) { std::scoped_lock lock(mLock); ASSERT_TRUE(mLastNotifySwitch); Loading Loading @@ -342,11 +335,6 @@ std::optional<T> FakeInputDispatcherPolicy::getItemFromStorageLockedInterruptibl return std::make_optional(item); } void FakeInputDispatcherPolicy::notifyConfigurationChanged(nsecs_t when) { std::scoped_lock lock(mLock); mConfigurationChangedTime = when; } void FakeInputDispatcherPolicy::notifyWindowUnresponsive(const sp<IBinder>& connectionToken, std::optional<gui::Pid> pid, const std::string&) { Loading Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +0 −6 Original line number Diff line number Diff line Loading @@ -1652,12 +1652,6 @@ bool InputDispatcher::dispatchConfigurationChangedLocked(nsecs_t currentTime, // Reset key repeating in case a keyboard device was added or removed or something. resetKeyRepeatLocked(); // Enqueue a command to run outside the lock to tell the policy that the configuration changed. auto command = [this, eventTime = entry.eventTime]() REQUIRES(mLock) { scoped_unlock unlock(mLock); mPolicy.notifyConfigurationChanged(eventTime); }; postCommandLocked(std::move(command)); return true; } Loading
services/inputflinger/dispatcher/include/InputDispatcherPolicyInterface.h +0 −3 Original line number Diff line number Diff line Loading @@ -43,9 +43,6 @@ public: InputDispatcherPolicyInterface() = default; virtual ~InputDispatcherPolicyInterface() = default; /* Notifies the system that a configuration change has occurred. */ virtual void notifyConfigurationChanged(nsecs_t when) = 0; /* Notifies the system that an application does not have a focused window. */ virtual void notifyNoFocusedWindowAnr( Loading
services/inputflinger/include/InputReaderBase.h +3 −0 Original line number Diff line number Diff line Loading @@ -454,6 +454,9 @@ public: */ virtual void notifyInputDevicesChanged(const std::vector<InputDeviceInfo>& inputDevices) = 0; /* Notifies the system that a configuration change has occurred. */ virtual void notifyConfigurationChanged(nsecs_t when) = 0; /* Gets the keyboard layout for a particular input device. */ virtual std::shared_ptr<KeyCharacterMap> getKeyboardLayoutOverlay( const InputDeviceIdentifier& identifier, Loading
services/inputflinger/reader/InputReader.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -212,6 +212,15 @@ void InputReader::loopOnce() { mPolicy->notifyInputDevicesChanged(inputDevices); } // Notify the policy of configuration change. This must be after policy is notified about input // device changes so that policy can fetch newly added input devices on configuration change. for (const auto& args : notifyArgs) { const auto* configArgs = std::get_if<NotifyConfigurationChangedArgs>(&args); if (configArgs != nullptr) { mPolicy->notifyConfigurationChanged(configArgs->eventTime); } } // Notify the policy of the start of every new stylus gesture. for (const auto& args : notifyArgs) { const auto* motionArgs = std::get_if<NotifyMotionArgs>(&args); Loading
services/inputflinger/tests/FakeInputDispatcherPolicy.cpp +0 −12 Original line number Diff line number Diff line Loading @@ -54,13 +54,6 @@ void FakeInputDispatcherPolicy::assertFilterInputEventWasNotCalled() { ASSERT_EQ(nullptr, mFilteredEvent); } void FakeInputDispatcherPolicy::assertNotifyConfigurationChangedWasCalled(nsecs_t when) { std::scoped_lock lock(mLock); ASSERT_TRUE(mConfigurationChangedTime) << "Timed out waiting for configuration changed call"; ASSERT_EQ(*mConfigurationChangedTime, when); mConfigurationChangedTime = std::nullopt; } void FakeInputDispatcherPolicy::assertNotifySwitchWasCalled(const NotifySwitchArgs& args) { std::scoped_lock lock(mLock); ASSERT_TRUE(mLastNotifySwitch); Loading Loading @@ -342,11 +335,6 @@ std::optional<T> FakeInputDispatcherPolicy::getItemFromStorageLockedInterruptibl return std::make_optional(item); } void FakeInputDispatcherPolicy::notifyConfigurationChanged(nsecs_t when) { std::scoped_lock lock(mLock); mConfigurationChangedTime = when; } void FakeInputDispatcherPolicy::notifyWindowUnresponsive(const sp<IBinder>& connectionToken, std::optional<gui::Pid> pid, const std::string&) { Loading