Add a preference panel for mouse speed.
Bug: 4124987 Change-Id: I3ce175d268a1d043cf5878481261b1049a15a149
This commit is contained in:
@ -38,6 +38,7 @@
|
||||
|
||||
#include "InputReader.h"
|
||||
|
||||
#include <cutils/atomic.h>
|
||||
#include <cutils/log.h>
|
||||
#include <ui/Keyboard.h>
|
||||
#include <ui/VirtualKeyMap.h>
|
||||
@ -219,10 +220,9 @@ InputReader::InputReader(const sp<EventHubInterface>& eventHub,
|
||||
const sp<InputReaderPolicyInterface>& policy,
|
||||
const sp<InputDispatcherInterface>& dispatcher) :
|
||||
mEventHub(eventHub), mPolicy(policy), mDispatcher(dispatcher),
|
||||
mGlobalMetaState(0), mDisableVirtualKeysTimeout(LLONG_MIN), mNextTimeout(LLONG_MAX) {
|
||||
mPolicy->getReaderConfiguration(&mConfig);
|
||||
|
||||
configureExcludedDevices();
|
||||
mGlobalMetaState(0), mDisableVirtualKeysTimeout(LLONG_MIN), mNextTimeout(LLONG_MAX),
|
||||
mRefreshConfiguration(0) {
|
||||
configure(true /*firstTime*/);
|
||||
updateGlobalMetaState();
|
||||
updateInputConfiguration();
|
||||
}
|
||||
@ -234,6 +234,11 @@ InputReader::~InputReader() {
|
||||
}
|
||||
|
||||
void InputReader::loopOnce() {
|
||||
if (android_atomic_acquire_load(&mRefreshConfiguration)) {
|
||||
android_atomic_release_store(0, &mRefreshConfiguration);
|
||||
configure(false /*firstTime*/);
|
||||
}
|
||||
|
||||
int32_t timeoutMillis = -1;
|
||||
if (mNextTimeout != LLONG_MAX) {
|
||||
nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
|
||||
@ -454,9 +459,12 @@ void InputReader::handleConfigurationChanged(nsecs_t when) {
|
||||
mDispatcher->notifyConfigurationChanged(when);
|
||||
}
|
||||
|
||||
void InputReader::configureExcludedDevices() {
|
||||
for (size_t i = 0; i < mConfig.excludedDeviceNames.size(); i++) {
|
||||
mEventHub->addExcludedDevice(mConfig.excludedDeviceNames[i]);
|
||||
void InputReader::configure(bool firstTime) {
|
||||
mPolicy->getReaderConfiguration(&mConfig);
|
||||
mEventHub->setExcludedDevices(mConfig.excludedDeviceNames);
|
||||
|
||||
if (!firstTime) {
|
||||
mEventHub->reopenDevices();
|
||||
}
|
||||
}
|
||||
|
||||
@ -677,6 +685,10 @@ bool InputReader::markSupportedKeyCodes(int32_t deviceId, uint32_t sourceMask, s
|
||||
} // release device registy reader lock
|
||||
}
|
||||
|
||||
void InputReader::refreshConfiguration() {
|
||||
android_atomic_release_store(1, &mRefreshConfiguration);
|
||||
}
|
||||
|
||||
void InputReader::dump(String8& dump) {
|
||||
mEventHub->dump(dump);
|
||||
dump.append("\n");
|
||||
|
Reference in New Issue
Block a user