Merge "Use primary color for matches string."
diff --git a/NOTICE b/NOTICE
index 2006201..8d6f583 100644
--- a/NOTICE
+++ b/NOTICE
@@ -17,7 +17,7 @@
=========================================================================
Apache Commons
-Copyright 1999-2004 The Apache Software Foundation
+Copyright 1999-2006 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
@@ -53,6 +53,26 @@
These files are Copyright 1998 - 2009 PacketVideo, but released under
the Apache2 License.
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the TagSoup code. ==
+ =========================================================================
+
+This file is part of TagSoup and is Copyright 2002-2008 by John Cowan.
+
+TagSoup is licensed under the Apache License,
+Version 2.0. You may obtain a copy of this license at
+http://www.apache.org/licenses/LICENSE-2.0 . You may also have
+additional legal rights not granted by this license.
+
+TagSoup is distributed in the hope that it will be useful, but
+unless required by applicable law or agreed to in writing, TagSoup
+is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, either express or implied; not even the implied warranty
+of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
diff --git a/include/ui/InputDispatcher.h b/include/ui/InputDispatcher.h
index b811ace..738f62a 100644
--- a/include/ui/InputDispatcher.h
+++ b/include/ui/InputDispatcher.h
@@ -109,9 +109,6 @@
// (ignored for KeyEvents)
float xOffset, yOffset;
- // The window type of the input target.
- int32_t windowType;
-
// The subset of pointer ids to include in motion events dispatched to this input target
// if FLAG_SPLIT is set.
BitSet32 pointerIds;
@@ -1018,8 +1015,7 @@
void addWindowTargetLocked(const InputWindow* window, int32_t targetFlags,
BitSet32 pointerIds);
void addMonitoringTargetsLocked();
- bool shouldPokeUserActivityForCurrentInputTargetsLocked();
- void pokeUserActivityLocked(nsecs_t eventTime, int32_t eventType);
+ void pokeUserActivityLocked(const EventEntry* eventEntry);
bool checkInjectionPermission(const InputWindow* window, const InjectionState* injectionState);
bool isWindowObscuredAtPointLocked(const InputWindow* window, int32_t x, int32_t y) const;
bool isWindowFinishedWithPreviousInputLocked(const InputWindow* window);
diff --git a/include/ui/InputReader.h b/include/ui/InputReader.h
index eb88d8b..2d4bf8b 100644
--- a/include/ui/InputReader.h
+++ b/include/ui/InputReader.h
@@ -584,6 +584,16 @@
// Immutable calibration parameters in parsed form.
struct Calibration {
+ // Position
+ bool haveXOrigin;
+ int32_t xOrigin;
+ bool haveYOrigin;
+ int32_t yOrigin;
+ bool haveXScale;
+ float xScale;
+ bool haveYScale;
+ float yScale;
+
// Touch Size
enum TouchSizeCalibration {
TOUCH_SIZE_CALIBRATION_DEFAULT,
diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp
index 949dc4d..d679ea2 100644
--- a/libs/ui/InputDispatcher.cpp
+++ b/libs/ui/InputDispatcher.cpp
@@ -340,6 +340,11 @@
mInboundQueue.dequeue(entry);
mPendingEvent = entry;
}
+
+ // Poke user activity for this event.
+ if (mPendingEvent->policyFlags & POLICY_FLAG_PASS_TO_USER) {
+ pokeUserActivityLocked(mPendingEvent);
+ }
}
// Now we have an event to dispatch.
@@ -686,11 +691,6 @@
// Dispatch the key.
dispatchEventToCurrentInputTargetsLocked(currentTime, entry, false);
-
- // Poke user activity.
- if (shouldPokeUserActivityForCurrentInputTargetsLocked()) {
- pokeUserActivityLocked(entry->eventTime, POWER_MANAGER_BUTTON_EVENT);
- }
return true;
}
@@ -753,31 +753,6 @@
// Dispatch the motion.
dispatchEventToCurrentInputTargetsLocked(currentTime, entry, false);
-
- // Poke user activity.
- if (shouldPokeUserActivityForCurrentInputTargetsLocked()) {
- int32_t eventType;
- if (isPointerEvent) {
- switch (entry->action) {
- case AMOTION_EVENT_ACTION_DOWN:
- eventType = POWER_MANAGER_TOUCH_EVENT;
- break;
- case AMOTION_EVENT_ACTION_UP:
- eventType = POWER_MANAGER_TOUCH_UP_EVENT;
- break;
- default:
- if (entry->eventTime - entry->downTime >= EVENT_IGNORE_DURATION) {
- eventType = POWER_MANAGER_TOUCH_EVENT;
- } else {
- eventType = POWER_MANAGER_LONG_TOUCH_EVENT;
- }
- break;
- }
- } else {
- eventType = POWER_MANAGER_BUTTON_EVENT;
- }
- pokeUserActivityLocked(entry->eventTime, eventType);
- }
return true;
}
@@ -829,6 +804,8 @@
assert(eventEntry->dispatchInProgress); // should already have been set to true
+ pokeUserActivityLocked(eventEntry);
+
for (size_t i = 0; i < mCurrentInputTargets.size(); i++) {
const InputTarget& inputTarget = mCurrentInputTargets.itemAt(i);
@@ -1338,7 +1315,6 @@
target.flags = targetFlags;
target.xOffset = - window->frameLeft;
target.yOffset = - window->frameTop;
- target.windowType = window->layoutParamsType;
target.pointerIds = pointerIds;
}
@@ -1351,7 +1327,6 @@
target.flags = 0;
target.xOffset = 0;
target.yOffset = 0;
- target.windowType = -1;
}
}
@@ -1418,19 +1393,32 @@
}
}
-bool InputDispatcher::shouldPokeUserActivityForCurrentInputTargetsLocked() {
- for (size_t i = 0; i < mCurrentInputTargets.size(); i++) {
- if (mCurrentInputTargets[i].windowType == InputWindow::TYPE_KEYGUARD) {
- return false;
+void InputDispatcher::pokeUserActivityLocked(const EventEntry* eventEntry) {
+ int32_t eventType = POWER_MANAGER_BUTTON_EVENT;
+ if (eventEntry->type == EventEntry::TYPE_MOTION) {
+ const MotionEntry* motionEntry = static_cast<const MotionEntry*>(eventEntry);
+ if (motionEntry->source & AINPUT_SOURCE_CLASS_POINTER) {
+ switch (motionEntry->action) {
+ case AMOTION_EVENT_ACTION_DOWN:
+ eventType = POWER_MANAGER_TOUCH_EVENT;
+ break;
+ case AMOTION_EVENT_ACTION_UP:
+ eventType = POWER_MANAGER_TOUCH_UP_EVENT;
+ break;
+ default:
+ if (motionEntry->eventTime - motionEntry->downTime >= EVENT_IGNORE_DURATION) {
+ eventType = POWER_MANAGER_TOUCH_EVENT;
+ } else {
+ eventType = POWER_MANAGER_LONG_TOUCH_EVENT;
+ }
+ break;
+ }
}
}
- return true;
-}
-void InputDispatcher::pokeUserActivityLocked(nsecs_t eventTime, int32_t eventType) {
CommandEntry* commandEntry = postCommandLocked(
& InputDispatcher::doPokeUserActivityLockedInterruptible);
- commandEntry->eventTime = eventTime;
+ commandEntry->eventTime = eventEntry->eventTime;
commandEntry->userActivityEventType = eventType;
}
@@ -2536,9 +2524,9 @@
#if DEBUG_FOCUS
LOGD("Touched window was removed: %s", touchedWindow.channel->getName().string());
#endif
- mTouchState.windows.removeAt(i);
synthesizeCancelationEventsForInputChannelLocked(touchedWindow.channel,
InputState::CANCEL_POINTER_EVENTS, "touched window was removed");
+ mTouchState.windows.removeAt(i);
}
}
diff --git a/libs/ui/InputReader.cpp b/libs/ui/InputReader.cpp
index 01ebda9..88b91e0 100644
--- a/libs/ui/InputReader.cpp
+++ b/libs/ui/InputReader.cpp
@@ -1344,7 +1344,7 @@
dumpRawAxes(dump);
dumpCalibration(dump);
dumpSurfaceLocked(dump);
- dump.appendFormat(INDENT3 "Translation and Scaling Factors:");
+ dump.appendFormat(INDENT3 "Translation and Scaling Factors:\n");
dump.appendFormat(INDENT4 "XOrigin: %d\n", mLocked.xOrigin);
dump.appendFormat(INDENT4 "YOrigin: %d\n", mLocked.yOrigin);
dump.appendFormat(INDENT4 "XScale: %0.3f\n", mLocked.xScale);
@@ -1481,10 +1481,18 @@
// Configure X and Y factors.
if (mRawAxes.x.valid && mRawAxes.y.valid) {
- mLocked.xOrigin = mRawAxes.x.minValue;
- mLocked.yOrigin = mRawAxes.y.minValue;
- mLocked.xScale = float(width) / mRawAxes.x.getRange();
- mLocked.yScale = float(height) / mRawAxes.y.getRange();
+ mLocked.xOrigin = mCalibration.haveXOrigin
+ ? mCalibration.xOrigin
+ : mRawAxes.x.minValue;
+ mLocked.yOrigin = mCalibration.haveYOrigin
+ ? mCalibration.yOrigin
+ : mRawAxes.y.minValue;
+ mLocked.xScale = mCalibration.haveXScale
+ ? mCalibration.xScale
+ : float(width) / mRawAxes.x.getRange();
+ mLocked.yScale = mCalibration.haveYScale
+ ? mCalibration.yScale
+ : float(height) / mRawAxes.y.getRange();
mLocked.xPrecision = 1.0f / mLocked.xScale;
mLocked.yPrecision = 1.0f / mLocked.yScale;
@@ -1750,6 +1758,12 @@
const InputDeviceCalibration& in = getDevice()->getCalibration();
Calibration& out = mCalibration;
+ // Position
+ out.haveXOrigin = in.tryGetProperty(String8("touch.position.xOrigin"), out.xOrigin);
+ out.haveYOrigin = in.tryGetProperty(String8("touch.position.yOrigin"), out.yOrigin);
+ out.haveXScale = in.tryGetProperty(String8("touch.position.xScale"), out.xScale);
+ out.haveYScale = in.tryGetProperty(String8("touch.position.yScale"), out.yScale);
+
// Touch Size
out.touchSizeCalibration = Calibration::TOUCH_SIZE_CALIBRATION_DEFAULT;
String8 touchSizeCalibrationString;
@@ -1959,6 +1973,20 @@
void TouchInputMapper::dumpCalibration(String8& dump) {
dump.append(INDENT3 "Calibration:\n");
+ // Position
+ if (mCalibration.haveXOrigin) {
+ dump.appendFormat(INDENT4 "touch.position.xOrigin: %d\n", mCalibration.xOrigin);
+ }
+ if (mCalibration.haveYOrigin) {
+ dump.appendFormat(INDENT4 "touch.position.yOrigin: %d\n", mCalibration.yOrigin);
+ }
+ if (mCalibration.haveXScale) {
+ dump.appendFormat(INDENT4 "touch.position.xScale: %0.3f\n", mCalibration.xScale);
+ }
+ if (mCalibration.haveYScale) {
+ dump.appendFormat(INDENT4 "touch.position.yScale: %0.3f\n", mCalibration.yScale);
+ }
+
// Touch Size
switch (mCalibration.touchSizeCalibration) {
case Calibration::TOUCH_SIZE_CALIBRATION_NONE: