Stop using default value for Surface producerControlledByApp parameter
Bug: 10785749
Change-Id: Ifbf9340e5eabe621a69e990ec3e05ac51f8db66a
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp
index f4e88f5..16e533c 100644
--- a/libs/gui/SurfaceControl.cpp
+++ b/libs/gui/SurfaceControl.cpp
@@ -46,13 +46,13 @@
// ============================================================================
SurfaceControl::SurfaceControl(
- const sp<SurfaceComposerClient>& client,
+ const sp<SurfaceComposerClient>& client,
const sp<IBinder>& handle,
const sp<IGraphicBufferProducer>& gbp)
: mClient(client), mHandle(handle), mGraphicBufferProducer(gbp)
{
}
-
+
SurfaceControl::~SurfaceControl()
{
destroy();
@@ -71,7 +71,7 @@
IPCThreadState::self()->flushCommands();
}
-void SurfaceControl::clear()
+void SurfaceControl::clear()
{
// here, the window manager tells us explicitly that we should destroy
// the surface's resource. Soon after this call, it will also release
@@ -83,7 +83,7 @@
}
bool SurfaceControl::isSameSurface(
- const sp<SurfaceControl>& lhs, const sp<SurfaceControl>& rhs)
+ const sp<SurfaceControl>& lhs, const sp<SurfaceControl>& rhs)
{
if (lhs == 0 || rhs == 0)
return false;
@@ -181,7 +181,9 @@
{
Mutex::Autolock _l(mLock);
if (mSurfaceData == 0) {
- mSurfaceData = new Surface(mGraphicBufferProducer);
+ // This surface is always consumed by SurfaceFlinger, so the
+ // producerControlledByApp value doesn't matter; using false.
+ mSurfaceData = new Surface(mGraphicBufferProducer, false);
}
return mSurfaceData;
}
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 61a9361..917d4cd 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -73,7 +73,7 @@
mLayerStack(NO_LAYER_STACK),
mOrientation()
{
- mNativeWindow = new Surface(producer);
+ mNativeWindow = new Surface(producer, false);
ANativeWindow* const window = mNativeWindow.get();
int format;
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index fa1ea09..def4618 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2782,7 +2782,7 @@
// create a surface (because we're a producer, and we need to
// dequeue/queue a buffer)
- sp<Surface> sur = new Surface(producer);
+ sp<Surface> sur = new Surface(producer, false);
ANativeWindow* window = sur.get();
status_t result = NO_ERROR;