Fix safe mode and KeyEvent.getMaxKeyCode().

Bug: 2901731
Change-Id: I78617c1b9dee3790fc590e5af4b5083368873184
This commit is contained in:
Jeff Brown 2010-08-10 15:47:53 -07:00
parent 81a5c091ca
commit 8d4dfd25f7
2 changed files with 10 additions and 0 deletions

View File

@ -454,6 +454,8 @@ public:
virtual void reset();
virtual void process(const RawEvent* rawEvent);
virtual int32_t getScanCodeState(uint32_t sourceMask, int32_t scanCode);
private:
// Amount that trackball needs to move in order to generate a key event.
static const int32_t TRACKBALL_MOVEMENT_THRESHOLD = 6;

View File

@ -1080,6 +1080,14 @@ void TrackballInputMapper::applyPolicyAndDispatch(nsecs_t when, int32_t motionEv
1, & pointerId, pointerCoords, mXPrecision, mYPrecision, downTime);
}
int32_t TrackballInputMapper::getScanCodeState(uint32_t sourceMask, int32_t scanCode) {
if (scanCode >= BTN_MOUSE && scanCode < BTN_JOYSTICK) {
return getEventHub()->getScanCodeState(getDeviceId(), scanCode);
} else {
return AKEY_STATE_UNKNOWN;
}
}
// --- TouchInputMapper ---