diff options
author | Mathias Agopian <mathias@google.com> | 2011-02-09 18:38:55 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-03-07 16:56:16 -0800 |
commit | 951d3fec41c8c77f5ce86a5394573e8180d93927 (patch) | |
tree | 49a8ec1a8241ba35781627b7562252e27efc2505 /services/surfaceflinger/LayerBase.cpp | |
parent | ff5a09904fb05f2776f1bbf1dd3915f38031190c (diff) | |
download | frameworks_base-951d3fec41c8c77f5ce86a5394573e8180d93927.zip frameworks_base-951d3fec41c8c77f5ce86a5394573e8180d93927.tar.gz frameworks_base-951d3fec41c8c77f5ce86a5394573e8180d93927.tar.bz2 |
Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) only
37c2a37 fix [3408713] Dialog window invisible sometimes
d35c666 fix [3385504] Surface flinger hang when adding dim surface
1723b04 fix [3389263] OMX.Nvidia.h264.decode fails to shutdown
1b0114f fix a surface leak in SurfaceFlinger
Bug: 3513017
Change-Id: Ia13ed8c9cdcb1f484e177cdcaff687e7c88a10c3
Diffstat (limited to 'services/surfaceflinger/LayerBase.cpp')
-rw-r--r-- | services/surfaceflinger/LayerBase.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index 916d420..0f02c6d 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -527,7 +527,9 @@ int32_t LayerBaseClient::sIdentity = 1; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client) - : LayerBase(flinger, display), mClientRef(client), + : LayerBase(flinger, display), + mHasSurface(false), + mClientRef(client), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { } @@ -544,14 +546,20 @@ sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() { sp<Surface> s; Mutex::Autolock _l(mLock); - s = mClientSurface.promote(); - if (s == 0) { - s = createSurface(); - mClientSurface = s; - } + + LOG_ALWAYS_FATAL_IF(mHasSurface, + "LayerBaseClient::getSurface() has already been called"); + + mHasSurface = true; + s = createSurface(); + mClientSurfaceBinder = s->asBinder(); return s; } +wp<IBinder> LayerBaseClient::getSurfaceBinder() const { + return mClientSurfaceBinder; +} + sp<LayerBaseClient::Surface> LayerBaseClient::createSurface() const { return new Surface(mFlinger, mIdentity, |