Merge "Hopefully fix issue #2662536: Why is launcher being killed?" into froyo
diff --git a/NOTICE b/NOTICE
index bb9c5f2..2006201 100644
--- a/NOTICE
+++ b/NOTICE
@@ -43,6 +43,16 @@
These files are Copyright 2007 Nuance Communications, but released under
the Apache2 License.
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Media Codecs code. ==
+ =========================================================================
+
+Media Codecs
+These files are Copyright 1998 - 2009 PacketVideo, but released under
+the Apache2 License.
+
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
diff --git a/include/binder/Binder.h b/include/binder/Binder.h
index 47b2bb9..ba3ac4b 100644
--- a/include/binder/Binder.h
+++ b/include/binder/Binder.h
@@ -71,7 +71,6 @@
Extras* mExtras;
void* mReserved0;
- static String16 sEmptyDescriptor;
};
// ---------------------------------------------------------------------------
diff --git a/libs/binder/Android.mk b/libs/binder/Android.mk
index 2df6775..13dc500 100644
--- a/libs/binder/Android.mk
+++ b/libs/binder/Android.mk
@@ -12,34 +12,35 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
# we have the common sources, plus some device-specific stuff
-LOCAL_SRC_FILES:= \
- Binder.cpp \
- BpBinder.cpp \
- IInterface.cpp \
- IMemory.cpp \
- IPCThreadState.cpp \
- IPermissionController.cpp \
- IServiceManager.cpp \
- MemoryDealer.cpp \
+sources := \
+ Binder.cpp \
+ BpBinder.cpp \
+ IInterface.cpp \
+ IMemory.cpp \
+ IPCThreadState.cpp \
+ IPermissionController.cpp \
+ IServiceManager.cpp \
+ MemoryDealer.cpp \
MemoryBase.cpp \
MemoryHeapBase.cpp \
MemoryHeapPmem.cpp \
- Parcel.cpp \
- Permission.cpp \
- ProcessState.cpp \
- Static.cpp
+ Parcel.cpp \
+ Permission.cpp \
+ ProcessState.cpp \
+ Static.cpp
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
LOCAL_LDLIBS += -lpthread
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libcutils \
- libutils
-
-LOCAL_MODULE:= libbinder
-
+LOCAL_MODULE := libbinder
+LOCAL_SHARED_LIBRARIES := liblog libcutils libutils
+LOCAL_SRC_FILES := $(sources)
include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_LDLIBS += -lpthread
+LOCAL_MODULE := libbinder
+LOCAL_SRC_FILES := $(sources)
+include $(BUILD_STATIC_LIBRARY)
diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp
index 0dd7622..9945f91 100644
--- a/libs/binder/Binder.cpp
+++ b/libs/binder/Binder.cpp
@@ -69,8 +69,6 @@
// ---------------------------------------------------------------------------
-String16 BBinder::sEmptyDescriptor;
-
BBinder::BBinder()
: mExtras(NULL)
{
@@ -88,6 +86,9 @@
const String16& BBinder::getInterfaceDescriptor() const
{
+ // This is a local static rather than a global static,
+ // to avoid static initializer ordering issues.
+ static String16 sEmptyDescriptor;
LOGW("reached BBinder::getInterfaceDescriptor (this=%p)", this);
return sEmptyDescriptor;
}
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp
index 0a3254d..ce7e9aa 100644
--- a/libs/surfaceflinger/Layer.cpp
+++ b/libs/surfaceflinger/Layer.cpp
@@ -281,9 +281,28 @@
GLuint textureName = mTextures[index].name;
if (UNLIKELY(textureName == -1LU)) {
// the texture has not been created yet, this Layer has
- // in fact never been drawn into. this happens frequently with
- // SurfaceView.
- clearWithOpenGL(clip);
+ // in fact never been drawn into. This happens frequently with
+ // SurfaceView because the WindowManager can't know when the client
+ // has drawn the first time.
+
+ // If there is nothing under us, we paint the screen in black, otherwise
+ // we just skip this update.
+
+ // figure out if there is something below us
+ Region under;
+ const SurfaceFlinger::LayerVector& drawingLayers(mFlinger->mDrawingState.layersSortedByZ);
+ const size_t count = drawingLayers.size();
+ for (size_t i=0 ; i<count ; ++i) {
+ const sp<LayerBase>& layer(drawingLayers[i]);
+ if (layer.get() == static_cast<LayerBase const*>(this))
+ break;
+ under.orSelf(layer->visibleRegionScreen);
+ }
+ // if not everything below us is covered, we plug the holes!
+ Region holes(clip.subtract(under));
+ if (!holes.isEmpty()) {
+ clearWithOpenGL(holes);
+ }
return;
}
drawWithOpenGL(clip, mTextures[index]);
diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk
index d0eedb4..afecdcb 100644
--- a/libs/utils/Android.mk
+++ b/libs/utils/Android.mk
@@ -104,3 +104,13 @@
LOCAL_MODULE:= libutils
include $(BUILD_SHARED_LIBRARY)
+ifneq ($(TARGET_SIMULATOR),true)
+ifeq ($(TARGET_OS),linux)
+include $(CLEAR_VARS)
+LOCAL_C_INCLUDES += external/zlib external/icu4c/common
+LOCAL_LDLIBS := -lrt -ldl -lpthread
+LOCAL_MODULE := libutils
+LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp
+include $(BUILD_STATIC_LIBRARY)
+endif
+endif
diff --git a/libs/utils/String8.cpp b/libs/utils/String8.cpp
index 3a34838..636cd83 100644
--- a/libs/utils/String8.cpp
+++ b/libs/utils/String8.cpp
@@ -136,10 +136,11 @@
void initialize_string8()
{
-#ifdef LIBUTILS_NATIVE
- // Bite me, Darwin!
- gDarwinIsReallyAnnoying = gDarwinCantLoadAllObjects;
-#endif
+ // HACK: This dummy dependency forces linking libutils Static.cpp,
+ // which is needed to initialize String8/String16 classes.
+ // These variables are named for Darwin, but are needed elsewhere too,
+ // including static linking on any platform.
+ gDarwinIsReallyAnnoying = gDarwinCantLoadAllObjects;
SharedBuffer* buf = SharedBuffer::alloc(1);
char* str = (char*)buf->data();