diff options
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/gui/ConsumerBase.cpp | 12 | ||||
| -rw-r--r-- | libs/gui/SensorManager.cpp | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp index 5546d5416c..3cf3078345 100644 --- a/libs/gui/ConsumerBase.cpp +++ b/libs/gui/ConsumerBase.cpp @@ -314,6 +314,18 @@ status_t ConsumerBase::addReleaseFenceLocked(int slot, if (!mSlots[slot].mFence.get()) { mSlots[slot].mFence = fence; + return OK; + } + + auto signaled = mSlots[slot].mFence->hasSignaled(); + + if (!signaled) { + CB_LOGE("fence has invalid state"); + return BAD_VALUE; + } + + if (*signaled) { + mSlots[slot].mFence = fence; } else { char fenceName[32] = {}; snprintf(fenceName, 32, "%.28s:%d", mName.string(), slot); diff --git a/libs/gui/SensorManager.cpp b/libs/gui/SensorManager.cpp index 5338034fd6..57c3073bf4 100644 --- a/libs/gui/SensorManager.cpp +++ b/libs/gui/SensorManager.cpp @@ -194,7 +194,8 @@ Sensor const* SensorManager::getDefaultSensor(int type) // a non_wake-up version. if (type == SENSOR_TYPE_PROXIMITY || type == SENSOR_TYPE_SIGNIFICANT_MOTION || type == SENSOR_TYPE_TILT_DETECTOR || type == SENSOR_TYPE_WAKE_GESTURE || - type == SENSOR_TYPE_GLANCE_GESTURE || type == SENSOR_TYPE_PICK_UP_GESTURE) { + type == SENSOR_TYPE_GLANCE_GESTURE || type == SENSOR_TYPE_PICK_UP_GESTURE || + type == SENSOR_TYPE_WRIST_TILT_GESTURE) { wakeUpSensor = true; } // For now we just return the first sensor of that type we find. |