Revert "Revert "Remove notifyConfigurationChanged listener and p..."
Revert submission 28384450-revert-28338641-remove_notify_configuration_changed-KXBQXRGFTY
Reason for revert: Builds started passing.
Reverted changes: /q/submissionid:28384450-revert-28338641-remove_notify_configuration_changed-KXBQXRGFTY
Change-Id: I6e9ffd1fbb5cf6edcbc08591e615bc1d1d383ea6
diff --git a/services/inputflinger/reader/InputReader.cpp b/services/inputflinger/reader/InputReader.cpp
index 9e9e816..f0e53b5 100644
--- a/services/inputflinger/reader/InputReader.cpp
+++ b/services/inputflinger/reader/InputReader.cpp
@@ -180,6 +180,9 @@
}
if (oldGeneration != mGeneration) {
+ // Reset global meta state because it depends on connected input devices.
+ updateGlobalMetaStateLocked();
+
inputDevicesChanged = true;
inputDevices = getInputDevicesLocked();
mPendingArgs.emplace_back(
@@ -212,15 +215,6 @@
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);
@@ -256,9 +250,6 @@
case EventHubInterface::DEVICE_REMOVED:
removeDeviceLocked(rawEvent->when, rawEvent->deviceId);
break;
- case EventHubInterface::FINISHED_DEVICE_SCAN:
- handleConfigurationChangedLocked(rawEvent->when);
- break;
default:
ALOG_ASSERT(false); // can't happen
break;
@@ -423,14 +414,6 @@
return ++mNextInputDeviceId;
}
-void InputReader::handleConfigurationChangedLocked(nsecs_t when) {
- // Reset global meta state because it depends on the list of all configured devices.
- updateGlobalMetaStateLocked();
-
- // Enqueue configuration changed.
- mPendingArgs.emplace_back(NotifyConfigurationChangedArgs{mContext.getNextId(), when});
-}
-
void InputReader::refreshConfigurationLocked(ConfigurationChanges changes) {
mPolicy->getReaderConfiguration(&mConfig);
mEventHub->setExcludedDevices(mConfig.excludedDeviceNames);