diff options
author | Tim Kilbourn <tkilbourn@google.com> | 2015-04-08 10:26:18 -0700 |
---|---|---|
committer | Tim Kilbourn <tkilbourn@google.com> | 2015-04-09 10:02:16 -0700 |
commit | 063ff53d0b0a0d670ea0185e687526d8fd302820 (patch) | |
tree | 3b658ea2501e1bf1ed204570a030288b94d67d10 /services/inputflinger/InputReader.cpp | |
parent | 82f393aad651fbf06d8c6872ac10a739ff2a3e42 (diff) | |
download | frameworks_native-063ff53d0b0a0d670ea0185e687526d8fd302820.zip frameworks_native-063ff53d0b0a0d670ea0185e687526d8fd302820.tar.gz frameworks_native-063ff53d0b0a0d670ea0185e687526d8fd302820.tar.bz2 |
Pass through availability of audio mic for input devices.
Bug: 15374820
Change-Id: Id2ca6da10165e3a887ebfbb18f663a3bf316ac79
Diffstat (limited to 'services/inputflinger/InputReader.cpp')
-rw-r--r-- | services/inputflinger/InputReader.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp index ccf8ced..b39f367 100644 --- a/services/inputflinger/InputReader.cpp +++ b/services/inputflinger/InputReader.cpp @@ -417,6 +417,11 @@ InputDevice* InputReader::createDeviceLocked(int32_t deviceId, int32_t controlle device->setExternal(true); } + // Devices with mics. + if (classes & INPUT_DEVICE_CLASS_MIC) { + device->setMic(true); + } + // Switch-like devices. if (classes & INPUT_DEVICE_CLASS_SWITCH) { device->addMapper(new SwitchInputMapper(device)); @@ -858,7 +863,7 @@ InputDevice::InputDevice(InputReaderContext* context, int32_t id, int32_t genera int32_t controllerNumber, const InputDeviceIdentifier& identifier, uint32_t classes) : mContext(context), mId(id), mGeneration(generation), mControllerNumber(controllerNumber), mIdentifier(identifier), mClasses(classes), - mSources(0), mIsExternal(false), mDropUntilNextSync(false) { + mSources(0), mIsExternal(false), mHasMic(false), mDropUntilNextSync(false) { } InputDevice::~InputDevice() { @@ -877,6 +882,7 @@ void InputDevice::dump(String8& dump) { deviceInfo.getDisplayName().string()); dump.appendFormat(INDENT2 "Generation: %d\n", mGeneration); dump.appendFormat(INDENT2 "IsExternal: %s\n", toString(mIsExternal)); + dump.appendFormat(INDENT2 "HasMic: %s\n", toString(mHasMic)); dump.appendFormat(INDENT2 "Sources: 0x%08x\n", deviceInfo.getSources()); dump.appendFormat(INDENT2 "KeyboardType: %d\n", deviceInfo.getKeyboardType()); @@ -1008,8 +1014,7 @@ void InputDevice::timeoutExpired(nsecs_t when) { void InputDevice::getDeviceInfo(InputDeviceInfo* outDeviceInfo) { outDeviceInfo->initialize(mId, mGeneration, mControllerNumber, mIdentifier, mAlias, - mIsExternal); - + mIsExternal, mHasMic); size_t numMappers = mMappers.size(); for (size_t i = 0; i < numMappers; i++) { InputMapper* mapper = mMappers[i]; |