summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Pfetsch <spfetsch@google.com>2016-10-25 21:47:58 +0000
committergitbuildkicker <android-build@google.com>2016-10-25 15:14:55 -0700
commit896a5c155643df3ac470b838a69d2c4882c1e1cf (patch)
tree9fffd08dc408363fbcbe5e1ffeb0079ae1be0b21
parent611e745bdc11d95db724648a325e32fc67e2d82c (diff)
downloadandroid-frameworks-native-896a5c155643df3ac470b838a69d2c4882c1e1cf.tar.gz
android-frameworks-native-896a5c155643df3ac470b838a69d2c4882c1e1cf.tar.xz
Revert "services: surfaceflinger: ASAN fix"
This reverts commit 1d3df546d5ee4dcc9e7cae6f8b8b790f741539af. Original patch may have caused a stability issue caught in monkey testing. Bug: 32312240 Change-Id: Ie8d291679590e624b8b90c4786b1c25c76cb2c9f (cherry picked from commit 598f6d5429b290f33107ef678328914b99c8312e)
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index db52d40..8db071e 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1768,12 +1768,9 @@ void SurfaceFlinger::updateCursorAsync()
void SurfaceFlinger::commitTransaction()
{
- sp<const DisplayDevice> hw = getDefaultDisplayDevice();
-
- if (!mLayersPendingRemoval.isEmpty() && hw->isDisplayOn()) {
+ if (!mLayersPendingRemoval.isEmpty()) {
// Notify removed layers now that they can't be drawn from
for (size_t i = 0; i < mLayersPendingRemoval.size(); i++) {
- mCurrentState.layersSortedByZ.remove(mLayersPendingRemoval[i]);
recordBufferingStats(mLayersPendingRemoval[i]->getName().string(),
mLayersPendingRemoval[i]->getOccupancyHistory(true));
mLayersPendingRemoval[i]->onRemoved();
@@ -2220,10 +2217,14 @@ status_t SurfaceFlinger::removeLayer(const wp<Layer>& weakLayer) {
return NO_ERROR;
}
- mLayersPendingRemoval.push(layer);
- mLayersRemoved = true;
- setTransactionFlags(eTransactionNeeded);
- return NO_ERROR;
+ ssize_t index = mCurrentState.layersSortedByZ.remove(layer);
+ if (index >= 0) {
+ mLayersPendingRemoval.push(layer);
+ mLayersRemoved = true;
+ setTransactionFlags(eTransactionNeeded);
+ return NO_ERROR;
+ }
+ return status_t(index);
}
uint32_t SurfaceFlinger::peekTransactionFlags(uint32_t /* flags */) {