diff options
Diffstat (limited to 'services/inputflinger/InputReader.cpp')
-rw-r--r-- | services/inputflinger/InputReader.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp index 1cbf78eb43..d59f274ab0 100644 --- a/services/inputflinger/InputReader.cpp +++ b/services/inputflinger/InputReader.cpp @@ -1141,13 +1141,24 @@ void InputDevice::configure(nsecs_t when, const InputReaderConfiguration* config } } - setEnabled(enabled, when); + if (changes) { + // For first-time configuration, only allow device to be disabled after mappers have + // finished configuring. This is because we need to read some of the properties from + // the device's open fd. + setEnabled(enabled, when); + } } for (InputMapper* mapper : mMappers) { mapper->configure(when, config, changes); mSources |= mapper->getSources(); } + + // If a device is just plugged but it might be disabled, we need to update some info like + // axis range of touch from each InputMapper first, then disable it. + if (!changes) { + setEnabled(config->disabledDevices.find(mId) == config->disabledDevices.end(), when); + } } } |