Fix incorrect video overlay status update.

Status should be set to PREPARE_TO_CLOSE only if its OPEN.
Devices which rely on the status being CLOSED, if overlay
is unavailable, can crash.

(cherry picked from commit a6ee9945dedde6f2d119f0bdd8724fed20781f0e)

Conflicts:

	libhwcomposer/badger/hwcomposer.cpp

Change-Id: Iddf0ba1cc142e02fcf906d3b31f8f44a65def316

Conflicts:
	libhwcomposer/hwcomposer.cpp
This commit is contained in:
Saurabh Shah 2012-05-24 11:38:11 -07:00 committed by Andrew Sutherland
parent ce483cb074
commit 6107e39aec

View File

@ -1670,8 +1670,8 @@ static int hwc_set(hwc_composer_device_t *dev,
}
}
} else {
ctx->hwcOverlayStatus = HWC_OVERLAY_PREPARE_TO_CLOSE;
unlockPreviousOverlayBuffer(ctx);
if (ctx->hwcOverlayStatus == HWC_OVERLAY_OPEN)
ctx->hwcOverlayStatus = HWC_OVERLAY_PREPARE_TO_CLOSE;
}