summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-08-11 18:26:11 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-11 18:26:11 -0700
commit61bb11cfa03abc345f27ec14f63929b6f600edff (patch)
tree966e0e0870317c9519d148ec73f634fe80d1f098 /services
parentc88ba95921444946443794cbaca5911f1a924720 (diff)
parent063097545e6a273952463803d1a2fab2cb590d4e (diff)
downloadframeworks_base-61bb11cfa03abc345f27ec14f63929b6f600edff.zip
frameworks_base-61bb11cfa03abc345f27ec14f63929b6f600edff.tar.gz
frameworks_base-61bb11cfa03abc345f27ec14f63929b6f600edff.tar.bz2
Merge "Ensure outValue is set, even when an error occurs."
Diffstat (limited to 'services')
-rw-r--r--services/input/EventHub.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
index 960e414..1d7cc19 100644
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -312,6 +312,8 @@ int32_t EventHub::getSwitchState(int32_t deviceId, int32_t sw) const {
}
status_t EventHub::getAbsoluteAxisValue(int32_t deviceId, int32_t axis, int32_t* outValue) const {
+ *outValue = 0;
+
if (axis >= 0 && axis <= ABS_MAX) {
AutoMutex _l(mLock);
@@ -328,7 +330,6 @@ status_t EventHub::getAbsoluteAxisValue(int32_t deviceId, int32_t axis, int32_t*
return OK;
}
}
- *outValue = 0;
return -1;
}