aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/tools/Android.mk
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-05-26 17:07:25 +0200
committerDavid 'Digit' Turner <digit@google.com>2009-05-26 17:07:25 +0200
commit303659072cc188102a8261f5c799980d477fd479 (patch)
treebce721be46821f837917506bf451f1299542eb7b /emulator/tools/Android.mk
parent6ca13900eb5b9d7a8a59925f2bb6c35adc0613d0 (diff)
downloadsdk-303659072cc188102a8261f5c799980d477fd479.zip
sdk-303659072cc188102a8261f5c799980d477fd479.tar.gz
sdk-303659072cc188102a8261f5c799980d477fd479.tar.bz2
This adds a new helper program (qemu-props) to support the emulated system.
Its purpose is to contact the 'boot-properties' service during the boot process and to set the list of system properties read from the emulator program through it. It must be launched from /system/etc/init.goldfish.rc as root. It depends on the 'boot-properties' service being implemented by the emulator (in a later patch). If not available, it will simply timeout. This also fixes a potential crash in qemud which can happen in the following case: - client sends a command to a service - the service responds with one or more message - the service immediately closes the connection before the client can read the data what happened is that the FDHandler object was buffering out-going packets to the client, but the Multiplexer acted on the disconnection immediately. This resulted in: - client_free() being called - fdhandler_shutdown() being called - the FDHandler being placed on the 'closing' list to be able to send buffered packets later. And 'receiver_close' being called - client_fd_close() being called, which would call client_free() recursively - the second client_free() call would free the object - the first client_free() call would try to free the object again - ==> dlmalloc() detects a double-free and immediately aborts. the fixes simply avoids the calle to receiver_close() in fdhandler_shutdown() since this function is called from an explicit shutdown request from the multiplexer, it doesn't correspond to the case where the client has closed the connection itself.
Diffstat (limited to 'emulator/tools/Android.mk')
-rw-r--r--emulator/tools/Android.mk36
1 files changed, 36 insertions, 0 deletions
diff --git a/emulator/tools/Android.mk b/emulator/tools/Android.mk
new file mode 100644
index 0000000..c9d9613
--- /dev/null
+++ b/emulator/tools/Android.mk
@@ -0,0 +1,36 @@
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# this file is used to build emulator-specific program tools
+# that should only run in the emulator.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+ifneq ($(TARGET_PRODUCT),sim)
+
+# The 'qemu-props' program is run from /system/etc/init.goldfish.rc
+# to setup various system properties sent by the emulator program.
+#
+include $(CLEAR_VARS)
+LOCAL_MODULE := qemu-props
+LOCAL_SRC_FILES := qemu-props.c
+LOCAL_SHARED_LIBRARIES := libcutils
+# we don't want this in 'user' builds which don't have
+# emulator-specific binaries.
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+
+endif # TARGET_PRODUCT != sim
+