From daa3753a04699724d2cfe824ac1f5a266d643a05 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Tue, 1 May 2012 15:54:03 -0700 Subject: Improve handling of built-in keyboard. The window manager policy made some incorrect assumptions about the meaning of the Configuration.keyboard field. We need to be more careful about distinguishing between built-in and external keyboards. Most of this change is to move the determination of the parts of the Configuration related to input devices into the WindowManagerService leveraging new features of the InputManagerService to good effect. Then we plumb through the flag that indicates whether a device is internal or external so that we can be more particular about how the lid switch effects changes to the Configuration. Bug: 6424373 Change-Id: I36a1c22ade35e578955465a25940a33f227b9763 --- libs/androidfw/InputDevice.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libs/androidfw/InputDevice.cpp') diff --git a/libs/androidfw/InputDevice.cpp b/libs/androidfw/InputDevice.cpp index 928157f0bcfa..fe891cb2879a 100644 --- a/libs/androidfw/InputDevice.cpp +++ b/libs/androidfw/InputDevice.cpp @@ -127,12 +127,12 @@ String8 getInputDeviceConfigurationFilePathByName( // --- InputDeviceInfo --- InputDeviceInfo::InputDeviceInfo() { - initialize(-1, -1, InputDeviceIdentifier(), String8()); + initialize(-1, -1, InputDeviceIdentifier(), String8(), false); } InputDeviceInfo::InputDeviceInfo(const InputDeviceInfo& other) : mId(other.mId), mGeneration(other.mGeneration), mIdentifier(other.mIdentifier), - mAlias(other.mAlias), mSources(other.mSources), + mAlias(other.mAlias), mIsExternal(other.mIsExternal), mSources(other.mSources), mKeyboardType(other.mKeyboardType), mKeyCharacterMap(other.mKeyCharacterMap), mHasVibrator(other.mHasVibrator), @@ -143,11 +143,12 @@ InputDeviceInfo::~InputDeviceInfo() { } void InputDeviceInfo::initialize(int32_t id, int32_t generation, - const InputDeviceIdentifier& identifier, const String8& alias) { + const InputDeviceIdentifier& identifier, const String8& alias, bool isExternal) { mId = id; mGeneration = generation; mIdentifier = identifier; mAlias = alias; + mIsExternal = isExternal; mSources = 0; mKeyboardType = AINPUT_KEYBOARD_TYPE_NONE; mHasVibrator = false; -- cgit v1.2.3-59-g8ed1b