diff -Nru a/bionic/linker/linker.c b/bionic/linker/linker.c
--- a/bionic/linker/linker.c	2012-07-15 20:26:43.516598603 +0900
+++ b/bionic/linker/linker.c	2012-07-12 02:42:19.893305895 +0900
@@ -108,6 +108,10 @@
 
 static soinfo *preloads[LDPRELOAD_MAX + 1];
 
+static const char ldpostload_names[] = "libbinder.deckard.so";
+
+static soinfo *postloads = NULL;
+
 #if LINKER_DEBUG
 int debug_verbosity;
 #endif
@@ -470,6 +474,13 @@
         }
     }
 
+    if(postloads != NULL) {
+        lsi = postloads;
+        s = _elf_lookup(lsi, elf_hash, name);
+        if(s != NULL)
+            goto done;
+    }
+
 #if ALLOW_SYMBOLS_FROM_MAIN
     /* If we are resolving relocations while dlopen()ing a library, it's OK for
      * the library to resolve a symbol that's defined in the executable itself,
@@ -1881,6 +1892,18 @@
         }
     }
 
+    if(si->flags & FLAG_EXE) {
+        soinfo *lsi = find_library(ldpostload_names);
+        if(lsi == 0) {
+            strlcpy(tmp_err_buf, linker_get_error(), sizeof(tmp_err_buf));
+            DL_ERR("%5d could not load needed library '%s' for '%s' (%s)",
+                   pid, ldpostload_names, si->name, tmp_err_buf);
+            goto fail;
+        }
+        lsi->refcount++;
+        postloads = lsi;
+    }
+
     for(d = si->dynamic; *d; d += 2) {
         if(d[0] == DT_NEEDED){
             DEBUG("%5d %s needs %s\n", pid, si->name, si->strtab + d[1]);
diff -Nru a/build/core/main.mk b/build/core/main.mk
--- a/build/core/main.mk	2012-07-15 20:26:44.044862582 +0900
+++ b/build/core/main.mk	2012-07-12 02:42:19.885305896 +0900
@@ -243,7 +243,7 @@
 enable_target_debugging := true
 ifneq (,$(user_variant))
   # Target is secure in user builds.
-  ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1
+  ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0
 
   tags_to_install := user
   ifeq ($(user_variant),userdebug)
diff -Nru a/development/tools/emulator/system/gps/Android.mk b/development/tools/emulator/system/gps/Android.mk
--- a/development/tools/emulator/system/gps/Android.mk	2012-07-15 20:26:47.038358456 +0900
+++ b/development/tools/emulator/system/gps/Android.mk	2012-07-14 07:25:33.053360547 +0900
@@ -28,12 +28,13 @@
 
 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
 LOCAL_CFLAGS += -DQEMU_HARDWARE
-LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware
+LOCAL_PREBUILT_LIBS := libloc_api.so
+LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware libloc_api
 LOCAL_SRC_FILES := gps_qemu.c
 ifeq ($(TARGET_PRODUCT),vbox_x86)
 LOCAL_MODULE := gps.vbox_x86
 else
-LOCAL_MODULE := gps.goldfish
+LOCAL_MODULE := gps.deckard
 endif
 LOCAL_MODULE_TAGS := debug
 include $(BUILD_SHARED_LIBRARY)
diff -Nru a/development/tools/emulator/system/gps/gps_qemu.c b/development/tools/emulator/system/gps/gps_qemu.c
--- a/development/tools/emulator/system/gps/gps_qemu.c	2012-07-15 20:26:47.042360456 +0900
+++ b/development/tools/emulator/system/gps/gps_qemu.c	2012-07-12 02:42:19.897305895 +0900
@@ -229,7 +229,7 @@
     r->utc_mon  = -1;
     r->utc_day  = -1;
     r->callback = NULL;
-    r->fix.size = sizeof(r->fix);
+//    r->fix.size = sizeof(r->fix);
 
     nmea_reader_update_utc_diff( r );
 }
@@ -562,15 +562,21 @@
 enum {
     CMD_QUIT  = 0,
     CMD_START = 1,
-    CMD_STOP  = 2
+    CMD_STOP  = 2,
+    CMD_LOCATION      = 3,
+    CMD_STATUS        = 4,
+    CMD_SV_STATUS     = 5,
+    CMD_XTRA_DOWNLOAD = 6,
+    CMD_AGPS_STATUS   = 7
 };
 
 
 /* this is the state of our connection to the qemu_gpsd daemon */
 typedef struct {
     int                     init;
-    int                     fd;
     GpsCallbacks            callbacks;
+    GpsXtraCallbacks        xtra_callbacks;
+    AGpsCallbacks           agps_callbacks;
     pthread_t               thread;
     int                     control[2];
 } GpsState;
@@ -578,6 +584,101 @@
 static GpsState  _gps_state[1];
 
 
+static GpsLocation  sGpsLocation;
+static GpsStatus    sGpsStatus;
+static GpsSvStatus  sGpsSvStatus;
+static AGpsStatus   sAGpsStatus;
+
+
+static void
+gps_state_location( GpsLocation*  location )
+{
+    GpsState*  s = _gps_state;
+    char  cmd = CMD_LOCATION;
+    int   ret;
+
+    memcpy(&sGpsLocation, location, sizeof(sGpsLocation));
+
+    do { ret=write( s->control[0], &cmd, 1 ); }
+    while (ret < 0 && errno == EINTR);
+
+    if (ret != 1)
+        D("%s: could not send CMD_LOCATION command: ret=%d: %s",
+          __FUNCTION__, ret, strerror(errno));
+}
+
+
+static void
+gps_state_status( GpsStatus*  status )
+{
+    GpsState*  s = _gps_state;
+    char  cmd = CMD_STATUS;
+    int   ret;
+
+    memcpy(&sGpsStatus, status, sizeof(sGpsStatus));
+
+    do { ret=write( s->control[0], &cmd, 1 ); }
+    while (ret < 0 && errno == EINTR);
+
+    if (ret != 1)
+        D("%s: could not send CMD_STATUS command: ret=%d: %s",
+          __FUNCTION__, ret, strerror(errno));
+}
+
+
+static void
+gps_state_sv_status( GpsSvStatus*  sv_info )
+{
+    GpsState*  s = _gps_state;
+    char  cmd = CMD_SV_STATUS;
+    int   ret;
+
+    memcpy(&sGpsSvStatus, sv_info, sizeof(sGpsSvStatus));
+
+    do { ret=write( s->control[0], &cmd, 1 ); }
+    while (ret < 0 && errno == EINTR);
+
+    if (ret != 1)
+        D("%s: could not send CMD_SV_STATUS command: ret=%d: %s",
+          __FUNCTION__, ret, strerror(errno));
+}
+
+
+static void
+gps_state_xtra_download_request( )
+{
+    GpsState*  s = _gps_state;
+    char  cmd = CMD_XTRA_DOWNLOAD;
+    int   ret;
+
+    do { ret=write( s->control[0], &cmd, 1 ); }
+    while (ret < 0 && errno == EINTR);
+
+    if (ret != 1)
+        D("%s: could not send CMD_XTRA_DOWNLOAD command: ret=%d: %s",
+          __FUNCTION__, ret, strerror(errno));
+}
+
+
+static void
+gps_state_agps_status( AGpsStatus*  status )
+{
+    GpsState*  s = _gps_state;
+    char  cmd = CMD_AGPS_STATUS;
+    int   ret;
+
+    memcpy(&sAGpsStatus, status, sizeof(sAGpsStatus));
+    sAGpsStatus.size = 0;
+
+    do { ret=write( s->control[0], &cmd, 1 ); }
+    while (ret < 0 && errno == EINTR);
+
+    if (ret != 1)
+        D("%s: could not send CMD_AGPS_STATUS command: ret=%d: %s",
+          __FUNCTION__, ret, strerror(errno));
+}
+
+
 static void
 gps_state_done( GpsState*  s )
 {
@@ -591,8 +692,6 @@
     close( s->control[0] ); s->control[0] = -1;
     close( s->control[1] ); s->control[1] = -1;
 
-    // close connection to the QEMU GPS daemon
-    close( s->fd ); s->fd = -1;
     s->init = 0;
 }
 
@@ -667,14 +766,10 @@
     NmeaReader  reader[1];
     int         epoll_fd   = epoll_create(2);
     int         started    = 0;
-    int         gps_fd     = state->fd;
     int         control_fd = state->control[1];
 
-    nmea_reader_init( reader );
-
     // register control file descriptors for polling
     epoll_register( epoll_fd, control_fd );
-    epoll_register( epoll_fd, gps_fd );
 
     D("gps thread running");
 
@@ -713,39 +808,36 @@
                     }
                     else if (cmd == CMD_START) {
                         if (!started) {
-                            D("gps thread starting  location_cb=%p", state->callbacks.location_cb);
+                            D("gps thread starting");
                             started = 1;
-                            nmea_reader_set_callback( reader, state->callbacks.location_cb );
                         }
                     }
                     else if (cmd == CMD_STOP) {
                         if (started) {
                             D("gps thread stopping");
                             started = 0;
-                            nmea_reader_set_callback( reader, NULL );
                         }
                     }
-                }
-                else if (fd == gps_fd)
-                {
-                    char  buff[32];
-                    D("gps fd event");
-                    for (;;) {
-                        int  nn, ret;
-
-                        ret = read( fd, buff, sizeof(buff) );
-                        if (ret < 0) {
-                            if (errno == EINTR)
-                                continue;
-                            if (errno != EWOULDBLOCK)
-                                ALOGE("error while reading from gps daemon socket: %s:", strerror(errno));
-                            break;
-                        }
-                        D("received %d bytes: %.*s", ret, ret, buff);
-                        for (nn = 0; nn < ret; nn++)
-                            nmea_reader_addc( reader, buff[nn] );
+                    else if (cmd == CMD_LOCATION) {
+                        if (state->callbacks.location_cb)
+                            state->callbacks.location_cb(&sGpsLocation);
+                    }
+                    else if (cmd == CMD_STATUS) {
+                        if (state->callbacks.status_cb)
+                            state->callbacks.status_cb(&sGpsStatus);
+                    }
+                    else if (cmd == CMD_SV_STATUS) {
+                        if (state->callbacks.sv_status_cb)
+                            state->callbacks.sv_status_cb(&sGpsSvStatus);
+                    }
+                    else if (cmd == CMD_XTRA_DOWNLOAD) {
+                        if (state->xtra_callbacks.download_request_cb)
+                            state->xtra_callbacks.download_request_cb();
+                    }
+                    else if (cmd == CMD_AGPS_STATUS) {
+                        if (state->agps_callbacks.status_cb)
+                            state->agps_callbacks.status_cb(&sAGpsStatus);
                     }
-                    D("gps fd event end");
                 }
                 else
                 {
@@ -763,16 +855,6 @@
     state->init       = 1;
     state->control[0] = -1;
     state->control[1] = -1;
-    state->fd         = -1;
-
-    state->fd = qemud_channel_open(QEMU_CHANNEL_NAME);
-
-    if (state->fd < 0) {
-        D("no gps emulation detected");
-        return;
-    }
-
-    D("gps emulation will read from '%s' qemud channel", QEMU_CHANNEL_NAME );
 
     if ( socketpair( AF_LOCAL, SOCK_STREAM, 0, state->control ) < 0 ) {
         ALOGE("could not create thread control socket pair: %s", strerror(errno));
@@ -804,6 +886,110 @@
 /*****************************************************************/
 /*****************************************************************/
 
+static const GpsInterface* sGpsInterface = NULL;
+static const GpsXtraInterface* sGpsXtraInterface = NULL;
+static const AGpsInterface* sAGpsInterface = NULL;
+
+
+GpsXtraCallbacks sGpsXtraCallbacks = {
+    gps_state_xtra_download_request,
+    NULL,
+};
+
+static int
+qemu_gps_xtra_init(GpsXtraCallbacks* callbacks)
+{
+    GpsState*  s = _gps_state;
+
+    s->xtra_callbacks = *callbacks;
+
+    if (sGpsXtraInterface)
+        return sGpsXtraInterface->init(&sGpsXtraCallbacks);
+    return 0;
+}
+
+static int
+qemu_gps_xtra_inject_data(char* data, int length)
+{
+    if (sGpsXtraInterface)
+        return sGpsXtraInterface->inject_xtra_data(data, length);
+    return 0;
+}
+
+static const GpsXtraInterface  qemuGpsXtraInterface = {
+    qemu_gps_xtra_init,
+    qemu_gps_xtra_inject_data,
+};
+
+
+AGpsCallbacks sAGpsCallbacks = {
+    gps_state_agps_status,
+    NULL,
+};
+
+static void
+qemu_agps_init(AGpsCallbacks* callbacks)
+{
+    GpsState*  s = _gps_state;
+
+    s->agps_callbacks = *callbacks;
+
+    if (sAGpsInterface)
+        sAGpsInterface->init(&sAGpsCallbacks);
+}
+
+static int
+qemu_agps_data_conn_open(const char* apn)
+{
+    if (sAGpsInterface)
+        return sAGpsInterface->data_conn_open(apn);
+    return 0;
+}
+
+static int
+qemu_agps_data_conn_closed()
+{
+    if (sAGpsInterface)
+        return sAGpsInterface->data_conn_closed();
+    return 0;
+}
+
+static int
+qemu_agps_data_conn_failed()
+{
+    if (sAGpsInterface)
+        return sAGpsInterface->data_conn_failed();
+    return 0;
+}
+
+static int
+qemu_agps_set_server(AGpsType type, const char* hostname, int port)
+{
+    if (sAGpsInterface)
+        return sAGpsInterface->set_server(type, hostname, port);
+    return 0;
+}
+
+static const AGpsInterface  qemuAGpsInterface = {
+    qemu_agps_init,
+    qemu_agps_data_conn_open,
+    qemu_agps_data_conn_closed,
+    qemu_agps_data_conn_failed,
+    qemu_agps_set_server,
+};
+
+
+GpsCallbacks sGpsCallbacks = {
+    gps_state_location,
+    gps_state_status,
+    gps_state_sv_status,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+};
 
 static int
 qemu_gps_init(GpsCallbacks* callbacks)
@@ -813,9 +999,8 @@
     if (!s->init)
         gps_state_init(s, callbacks);
 
-    if (s->fd < 0)
-        return -1;
-
+    if (sGpsInterface)
+        return sGpsInterface->init(&sGpsCallbacks);
     return 0;
 }
 
@@ -826,6 +1011,9 @@
 
     if (s->init)
         gps_state_done(s);
+
+    if (sGpsInterface)
+        sGpsInterface->cleanup();
 }
 
 
@@ -841,6 +1029,9 @@
 
     D("%s: called", __FUNCTION__);
     gps_state_start(s);
+
+    if (sGpsInterface)
+        return sGpsInterface->start();
     return 0;
 }
 
@@ -857,6 +1048,9 @@
 
     D("%s: called", __FUNCTION__);
     gps_state_stop(s);
+
+    if (sGpsInterface)
+        return sGpsInterface->stop();
     return 0;
 }
 
@@ -864,35 +1058,52 @@
 static int
 qemu_gps_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty)
 {
+    if (sGpsInterface)
+        return sGpsInterface->inject_time(time, timeReference, uncertainty);
     return 0;
 }
 
 static int
 qemu_gps_inject_location(double latitude, double longitude, float accuracy)
 {
+    if (sGpsInterface)
+        return sGpsInterface->inject_location(latitude, longitude, accuracy);
     return 0;
 }
 
 static void
 qemu_gps_delete_aiding_data(GpsAidingData flags)
 {
+    if (sGpsInterface)
+        sGpsInterface->delete_aiding_data(flags);
 }
 
-static int qemu_gps_set_position_mode(GpsPositionMode mode, int fix_frequency)
+typedef int (*gps_set_position_mode)(GpsPositionMode mode, int fix_frequency);
+
+static int qemu_gps_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence,
+            uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time)
 {
-    // FIXME - support fix_frequency
+    if (sGpsInterface)
+        return ((gps_set_position_mode)sGpsInterface->set_position_mode)(mode, (int)(min_interval/1000));
     return 0;
 }
 
 static const void*
 qemu_gps_get_extension(const char* name)
 {
-    // no extensions supported
+    if (sGpsInterface) {
+        if (!strcmp(name, GPS_XTRA_INTERFACE)) {
+            sGpsXtraInterface = (GpsXtraInterface*)sGpsInterface->get_extension(name);
+            return (const void*)&qemuGpsXtraInterface;
+        } else if (!strcmp(name, AGPS_INTERFACE)) {
+            sAGpsInterface = (AGpsInterface*)sGpsInterface->get_extension(name);
+            return (const void*)&qemuAGpsInterface;
+        }
+    }
     return NULL;
 }
 
 static const GpsInterface  qemuGpsInterface = {
-    sizeof(GpsInterface),
     qemu_gps_init,
     qemu_gps_start,
     qemu_gps_stop,
@@ -904,8 +1115,11 @@
     qemu_gps_get_extension,
 };
 
+const GpsInterface* gps_get_hardware_interface();
+
 const GpsInterface* gps__get_gps_interface(struct gps_device_t* dev)
 {
+    sGpsInterface = gps_get_hardware_interface();
     return &qemuGpsInterface;
 }
 
@@ -935,7 +1149,7 @@
     .version_major = 1,
     .version_minor = 0,
     .id = GPS_HARDWARE_MODULE_ID,
-    .name = "Goldfish GPS Module",
+    .name = "Deckard GPS Module",
     .author = "The Android Open Source Project",
     .methods = &gps_module_methods,
 };
diff -Nru a/device/sharp/deckard/Android.mk b/device/sharp/deckard/Android.mk
--- a/device/sharp/deckard/Android.mk	1970-01-01 09:00:00.000000000 +0900
+++ b/device/sharp/deckard/Android.mk	2012-07-12 02:42:19.881305896 +0900
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2011 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.
+#
+
+# WARNING: Everything listed here will be built on ALL platforms,
+# including x86, the emulator, and the SDK.  Modules must be uniquely
+# named (liblights.deckard), and must build everywhere, or limit themselves
+# to only building on ARM if they include assembly. Individual makefiles
+# are responsible for having their own logic, for fine-grained control.
+
+LOCAL_PATH := $(call my-dir)
+
+# if some modules are built directly from this directory (not subdirectories),
+# their rules should be written here.
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff -Nru a/device/sharp/deckard/AndroidProducts.mk b/device/sharp/deckard/AndroidProducts.mk
--- a/device/sharp/deckard/AndroidProducts.mk	1970-01-01 09:00:00.000000000 +0900
+++ b/device/sharp/deckard/AndroidProducts.mk	2012-07-12 02:42:19.881305896 +0900
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2011 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.
+#
+
+PRODUCT_MAKEFILES := $(LOCAL_DIR)/full_deckard.mk
diff -Nru a/device/sharp/deckard/BoardConfig.mk b/device/sharp/deckard/BoardConfig.mk
--- a/device/sharp/deckard/BoardConfig.mk	1970-01-01 09:00:00.000000000 +0900
+++ b/device/sharp/deckard/BoardConfig.mk	2012-07-12 02:42:19.881305896 +0900
@@ -0,0 +1,79 @@
+#
+# Copyright (C) 2011 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 variable is set first, so it can be overridden
+# by BoardConfigVendor.mk
+USE_CAMERA_STUB := true
+
+# Use the non-open-source parts, if they're present
+-include vendor/sharp/deckard/BoardConfigVendor.mk
+
+TARGET_CPU_ABI := armeabi-v7a
+TARGET_CPU_ABI2 := armeabi
+TARGET_CPU_SMP := false
+TARGET_ARCH_VARIANT := armv7-a-neon
+ARCH_ARM_HAVE_TLS_REGISTER := true
+
+BOARD_HAVE_BLUETOOTH := true
+BOARD_HAVE_BLUETOOTH_BCM := false
+TARGET_NO_BOOTLOADER := true
+TARGET_NO_RECOVERY := true
+TARGET_NO_KERNEL := true
+
+BOARD_KERNEL_BASE := 0x20000000
+#BOARD_KERNEL_CMDLINE :=
+
+TARGET_NO_RADIOIMAGE := true
+TARGET_BOARD_PLATFORM := qsd8k
+TARGET_BOOTLOADER_BOARD_NAME := deckard
+
+#BOARD_USES_HGL := true
+#BOARD_USES_OVERLAY := true
+USE_OPENGL_RENDERER := true
+
+#TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
+#TARGET_RECOVERY_UI_LIB := librecovery_ui_deckard
+
+# device-specific extensions to the updater binary
+#TARGET_RECOVERY_UPDATER_LIBS += librecovery_updater_deckard
+#TARGET_RELEASETOOLS_EXTENSIONS := device/sharp/deckard
+
+TARGET_USERIMAGES_USE_EXT4 := true
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 268435456
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 536870912
+BOARD_FLASH_BLOCK_SIZE := 4096
+
+#TARGET_PROVIDES_INIT_RC := true
+#TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
+
+# Wifi related defines
+BOARD_WPA_SUPPLICANT_DRIVER := WEXT
+WPA_SUPPLICANT_VERSION      := VER_0_5_X
+#BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
+#BOARD_HOSTAPD_DRIVER        := NL80211
+#BOARD_HOSTAPD_PRIVATE_LIB   := lib_driver_cmd_bcmdhd
+#BOARD_WLAN_DEVICE           := sdio
+#WIFI_DRIVER_FW_PATH_PARAM   := "/sys/module/bcmdhd/parameters/firmware_path"
+WIFI_DRIVER_MODULE_PATH     := "/system/lib/modules/unifi_sdio.ko"
+#WIFI_DRIVER_FW_PATH_STA     := "/vendor/firmware/fw_bcmdhd.bin"
+#WIFI_DRIVER_FW_PATH_P2P     := "/vendor/firmware/fw_bcmdhd_p2p.bin"
+#WIFI_DRIVER_FW_PATH_AP      := "/vendor/firmware/fw_bcmdhd_apsta.bin"
+WIFI_DRIVER_FW_STA_PATH     := "/system/etc/firmware/unifi-sdio-1/a05/sta.xbv"
+WIFI_DRIVER_MODULE_NAME     := "unifi_sdio"
+
+#BOARD_LIB_DUMPSTATE := libdumpstate.deckard
+
+#BOARD_USES_SECURE_SERVICES := true
diff -Nru a/device/sharp/deckard/SH_qwerty_key.idc b/device/sharp/deckard/SH_qwerty_key.idc
--- a/device/sharp/deckard/SH_qwerty_key.idc	1970-01-01 09:00:00.000000000 +0900
+++ b/device/sharp/deckard/SH_qwerty_key.idc	2012-07-12 02:42:19.881305896 +0900
@@ -0,0 +1,23 @@
+# Copyright (C) 2011 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.
+
+#
+# Input Device Calibration File for the Tuna touch screen.
+#
+
+# Basic Parameters
+cursor.mode = navigation
+cursor.orientationAware = 1
+keyboard.orientationAware = 1
+
diff -Nru a/device/sharp/deckard/SH_touchpanel.idc b/device/sharp/deckard/SH_touchpanel.idc
--- a/device/sharp/deckard/SH_touchpanel.idc	1970-01-01 09:00:00.000000000 +0900
+++ b/device/sharp/deckard/SH_touchpanel.idc	2012-07-12 02:42:19.881305896 +0900
@@ -0,0 +1,21 @@
+# Copyright (C) 2011 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.
+
+#
+# Input Device Calibration File for the Tuna touch screen.
+#
+
+# Basic Parameters
+touch.deviceType = touchScreen
+
diff -Nru a/device/sharp/deckard/device.mk b/device/sharp/deckard/device.mk
--- a/device/sharp/deckard/device.mk	1970-01-01 09:00:00.000000000 +0900
+++ b/device/sharp/deckard/device.mk	2012-07-15 17:10:43.217468712 +0900
@@ -0,0 +1,99 @@
+#
+# Copyright (C) 2011 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.
+#
+
+ifeq ($(TARGET_PREBUILT_KERNEL),)
+LOCAL_KERNEL := device/sharp/deckard/kernel
+else
+LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
+endif
+
+PRODUCT_COPY_FILES := \
+	$(LOCAL_KERNEL):kernel \
+	device/sharp/deckard/ubi.cfg:ubi.cfg \
+	device/sharp/deckard/vold.fstab:system/etc/vold.fstab
+
+# Compcache
+PRODUCT_COPY_FILES += \
+	device/sharp/deckard/unifi_sdio.ko:system/lib/modules/unifi_sdio.ko
+
+# Key maps
+PRODUCT_COPY_FILES += \
+	frameworks/base/data/keyboards/qwerty.kl:system/usr/keylayout/SH_qwerty_key.kl \
+	frameworks/base/data/keyboards/qwerty2.kcm:system/usr/keychars/SH_qwerty_key.kcm \
+	frameworks/base/data/keyboards/qwerty.kl:system/usr/keylayout/SH_pm_key.kl \
+	frameworks/base/data/keyboards/qwerty.kcm:system/usr/keychars/SH_pm_key.kcm
+
+# Input device calibration files
+PRODUCT_COPY_FILES += \
+	device/sharp/deckard/SH_touchpanel.idc:system/usr/idc/SH_touchpanel.idc \
+	device/sharp/deckard/SH_qwerty_key.idc:system/usr/idc/SH_qwerty_key.idc
+
+# These are the hardware-specific features
+PRODUCT_COPY_FILES += \
+	frameworks/native/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \
+	frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
+	frameworks/native/data/etc/android.hardware.touchscreen.multitouch.distinct.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.distinct.xml
+
+# adreno GPU drivers
+PRODUCT_COPY_FILES += \
+	device/sharp/deckard/adreno/system/etc/firmware/yamato_pfp.fw:system/etc/firmware/yamato_pfp.fw \
+	device/sharp/deckard/adreno/system/etc/firmware/yamato_pm4.fw:system/etc/firmware/yamato_pm4.fw \
+	device/sharp/deckard/adreno/system/lib/egl/egl.cfg:system/lib/egl/egl.cfg \
+	device/sharp/deckard/adreno/system/lib/egl/eglsubAndroid.so:system/lib/egl/eglsubAndroid.so \
+	device/sharp/deckard/adreno/system/lib/egl/libEGL_adreno200.so:system/lib/egl/libEGL_adreno200.so \
+	device/sharp/deckard/adreno/system/lib/egl/libGLES_android.so:system/lib/egl/libGLES_android.so \
+	device/sharp/deckard/adreno/system/lib/egl/libGLESv1_CM_adreno200.so:system/lib/egl/libGLESv1_CM_adreno200.so \
+	device/sharp/deckard/adreno/system/lib/egl/libGLESv2_adreno200.so:system/lib/egl/libGLESv2_adreno200.so \
+	device/sharp/deckard/adreno/system/lib/egl/libq3dtools_adreno200.so:system/lib/egl/libq3dtools_adreno200.so \
+	device/sharp/deckard/adreno/system/lib/libC2D2.so:system/lib/libC2D2.so \
+	device/sharp/deckard/adreno/system/lib/libgsl.so:system/lib/libgsl.so \
+	device/sharp/deckard/adreno/system/lib/libOpenVG.so:system/lib/libOpenVG.so \
+	device/sharp/deckard/adreno/system/lib/libsc-a2xx.so:system/lib/libsc-a2xx.so \
+	device/sharp/deckard/ics_system/lib/hw/copybit.qsd8k.so:system/lib/hw/copybit.qsd8k.so \
+	device/sharp/deckard/ics_system/lib/hw/gralloc.qsd8k.so:system/lib/hw/gralloc.qsd8k.so \
+	device/sharp/deckard/ics_system/lib/hw/hwcomposer.qsd8k.so:system/lib/hw/hwcomposer.qsd8k.so \
+	device/sharp/deckard/ics_system/lib/libgenlock.so:system/lib/libgenlock.so \
+	device/sharp/deckard/ics_system/lib/libmemalloc.so:system/lib/libmemalloc.so \
+	device/sharp/deckard/ics_system/lib/liboverlay.so:system/lib/liboverlay.so \
+	device/sharp/deckard/ics_system/lib/libQcomUI.so:system/lib/libQcomUI.so \
+	device/sharp/deckard/ics_system/lib/libtilerenderer.so:system/lib/libtilerenderer.so
+
+# Prebuilt libraries that are needed to build open-source libraries
+PRODUCT_COPY_FILES += \
+	device/sharp/deckard/libaudio.so:obj/lib/libaudio.so \
+	device/sharp/deckard/libloc_api.so:obj/lib/libloc_api.so
+
+PRODUCT_PACKAGES += \
+	audio.primary.deckard \
+	libbinder.deckard
+
+PRODUCT_PROPERTY_OVERRIDES := \
+	wifi.interface=wlan0 \
+	wifi.supplicant_scan_interval=15
+
+PRODUCT_PROPERTY_OVERRIDES += \
+	hwui.render_dirty_regions=false \
+	hwui.disable_vsync=true
+
+PRODUCT_PROPERTY_OVERRIDES += \
+	ro.opengles.version=131072
+
+PRODUCT_PROPERTY_OVERRIDES += \
+	ro.sf.lcd_density=160
+
+PRODUCT_CHARACTERISTICS := tablet
+
+$(call inherit-product, frameworks/native/build/phone-hdpi-dalvik-heap.mk)
diff -Nru a/device/sharp/deckard/full_deckard.mk b/device/sharp/deckard/full_deckard.mk
--- a/device/sharp/deckard/full_deckard.mk	1970-01-01 09:00:00.000000000 +0900
+++ b/device/sharp/deckard/full_deckard.mk	2012-07-12 02:42:19.881305896 +0900
@@ -0,0 +1,31 @@
+# Copyright (C) 2011 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 the build configuration for a full Android
+# build for deckard hardware. This cleanly combines a set of
+# device-specific aspects (drivers) with a device-agnostic
+# product configuration (apps). Except for a few implementation
+# details, it only fundamentally contains two inherit-product
+# lines, full and deckard, hence its name.
+#
+
+# Inherit from those products. Most specific first.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
+$(call inherit-product, device/sharp/deckard/device.mk)
+
+PRODUCT_NAME := full_deckard
+PRODUCT_DEVICE := deckard
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := Full AOSP on Deckard
diff -Nru a/device/sharp/deckard/ubi.cfg b/device/sharp/deckard/ubi.cfg
--- a/device/sharp/deckard/ubi.cfg	1970-01-01 09:00:00.000000000 +0900
+++ b/device/sharp/deckard/ubi.cfg	2012-07-12 02:42:19.881305896 +0900
@@ -0,0 +1,8 @@
+[boot]
+mode=ubi
+image=./boot.img
+vol_id=0
+vol_size=200MiB
+vol_type=dynamic
+vol_name=boot
+vol_flags=autoresize
diff -Nru a/device/sharp/deckard/vendorsetup.sh b/device/sharp/deckard/vendorsetup.sh
--- a/device/sharp/deckard/vendorsetup.sh	1970-01-01 09:00:00.000000000 +0900
+++ b/device/sharp/deckard/vendorsetup.sh	2012-07-12 02:42:19.885305896 +0900
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2011 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.
+#
+
+add_lunch_combo full_deckard-userdebug
diff -Nru a/device/sharp/deckard/vold.fstab b/device/sharp/deckard/vold.fstab
--- a/device/sharp/deckard/vold.fstab	1970-01-01 09:00:00.000000000 +0900
+++ b/device/sharp/deckard/vold.fstab	2012-07-12 02:42:19.885305896 +0900
@@ -0,0 +1,16 @@
+## Vold 2.0 Generic fstab
+## - San Mehat (san@android.com)
+## 
+
+#######################
+## Regular device mount
+##
+## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...> 
+## label        - Label for the volume
+## mount_point  - Where the volume will be mounted
+## part         - Partition # (1 based), or 'auto' for first usable partition.
+## <sysfs_path> - List of sysfs paths to source devices, must start with '/' character
+## flags        - (optional) Comma separated list of flags, must not contain '/' character
+######################
+
+dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/virtual/block/stheno
バイナリーファイル a/display-ee72cb0.tar.gz とb/display-ee72cb0.tar.gz は異なります
バイナリーファイル a/display-jb-6f012b4.tar.gz とb/display-jb-6f012b4.tar.gz は異なります
diff -Nru a/external/dhcpcd/Android.mk b/external/dhcpcd/Android.mk
--- a/external/dhcpcd/Android.mk	2012-07-15 20:26:59.308489943 +0900
+++ b/external/dhcpcd/Android.mk	2012-07-12 02:42:19.897305895 +0900
@@ -26,13 +26,13 @@
 LOCAL_MODULE_TAGS := debug
 include $(BUILD_EXECUTABLE)
 
-#include $(CLEAR_VARS)
-#LOCAL_MODULE := dhcpcd.conf
-#LOCAL_MODULE_TAGS := user
-#LOCAL_MODULE_CLASS := ETC
-#LOCAL_MODULE_PATH := $(etc_dir)
-#LOCAL_SRC_FILES := android.conf
-#include $(BUILD_PREBUILT)
+include $(CLEAR_VARS)
+LOCAL_MODULE := dhcpcd.conf
+LOCAL_MODULE_TAGS := user
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(etc_dir)
+LOCAL_SRC_FILES := android.conf
+include $(BUILD_PREBUILT)
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := dhcpcd-run-hooks
diff -Nru a/external/webkit/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp b/external/webkit/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp
--- a/external/webkit/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp	2012-07-15 20:28:01.687661335 +0900
+++ b/external/webkit/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp	2012-07-13 02:22:57.797197500 +0900
@@ -501,9 +501,12 @@
 TilesManager* TilesManager::instance()
 {
     if (!gInstance) {
+        gInstance = (TilesManager *)-1;
         gInstance = new TilesManager();
         ALOGV("instance(), new gInstance is %x", gInstance);
     }
+    while ((volatile int)gInstance == -1)
+        ALOGV("instance(), Waiting while gInstance = %x", gInstance);
     return gInstance;
 }
 
diff -Nru a/frameworks/av/media/libstagefright/AwesomePlayer.cpp b/frameworks/av/media/libstagefright/AwesomePlayer.cpp
--- a/frameworks/av/media/libstagefright/AwesomePlayer.cpp	2012-07-15 20:28:15.362494764 +0900
+++ b/frameworks/av/media/libstagefright/AwesomePlayer.cpp	2012-07-12 02:42:19.889305896 +0900
@@ -1103,6 +1103,7 @@
     if (USE_SURFACE_ALLOC
             && !strncmp(component, "OMX.", 4)
             && strncmp(component, "OMX.google.", 11)
+            && strcmp(component, "OMX.qcom.video.decoder.avc")
             && strcmp(component, "OMX.Nvidia.mpeg2v.decode")) {
         // Hardware decoders avoid the CPU color conversion by decoding
         // directly to ANativeBuffers, so we must use a renderer that
diff -Nru a/frameworks/av/media/libstagefright/OMXCodec.cpp b/frameworks/av/media/libstagefright/OMXCodec.cpp
--- a/frameworks/av/media/libstagefright/OMXCodec.cpp	2012-07-15 20:28:15.382504764 +0900
+++ b/frameworks/av/media/libstagefright/OMXCodec.cpp	2012-07-12 03:02:05.085256327 +0900
@@ -1317,6 +1317,7 @@
       mPaused(false),
       mNativeWindow(
               (!strncmp(componentName, "OMX.google.", 11)
+              || !strcmp(componentName, "OMX.qcom.video.decoder.avc")
               || !strcmp(componentName, "OMX.Nvidia.mpeg2v.decode"))
                         ? NULL : nativeWindow) {
     mPortStatus[kPortIndexInput] = ENABLED;
@@ -1532,6 +1533,14 @@
             if (mOMXLivesLocally) {
                 mem.clear();
 
+                if (!strcmp(mComponentName, "OMX.qcom.video.decoder.avc")) {
+                    if (def.nBufferSize < (OMX_U32)353280) {
+                        ALOGW("HACK: fix buffer size %lu -> %lu for %s",
+                            def.nBufferSize, (OMX_U32)353280, mComponentName);
+                        def.nBufferSize = (OMX_U32)353280;
+                    }
+                }
+
                 err = mOMX->allocateBuffer(
                         mNode, portIndex, def.nBufferSize, &buffer,
                         &info.mData);
@@ -2164,6 +2173,14 @@
                     CHECK(mQuirks & kRequiresAllocateBufferOnOutputPorts);
                     CHECK(mQuirks & kDefersOutputBufferAllocation);
 
+                    if (!strcmp(mComponentName, "OMX.qcom.video.decoder.avc")) {
+                        if (info->mSize < (OMX_U32)353280) {
+                            ALOGW("HACK: fix buffer size %d -> %lu for %s",
+                                info->mSize, (OMX_U32)353280, mComponentName);
+                            info->mSize = (OMX_U32)353280;
+                        }
+                    }
+
                     // The qcom video decoders on Nexus don't actually allocate
                     // output buffer memory on a call to OMX_AllocateBuffer
                     // the "pBuffer" member of the OMX_BUFFERHEADERTYPE
diff -Nru a/frameworks/base/core/java/android/provider/Settings.java b/frameworks/base/core/java/android/provider/Settings.java
--- a/frameworks/base/core/java/android/provider/Settings.java	2012-07-15 20:28:25.367494345 +0900
+++ b/frameworks/base/core/java/android/provider/Settings.java	2012-07-12 02:42:19.901305895 +0900
@@ -1180,7 +1180,7 @@
          * END_BUTTON_BEHAVIOR default value.
          * @hide
          */
-        public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
+        public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_HOME | END_BUTTON_BEHAVIOR_SLEEP;
 
         /**
          * Is advanced settings mode turned on. 0 == no, 1 == yes
diff -Nru a/frameworks/base/core/java/android/util/DisplayMetrics.java b/frameworks/base/core/java/android/util/DisplayMetrics.java
--- a/frameworks/base/core/java/android/util/DisplayMetrics.java	2012-07-15 20:28:25.491556342 +0900
+++ b/frameworks/base/core/java/android/util/DisplayMetrics.java	2012-07-12 02:42:19.897305895 +0900
@@ -212,6 +212,7 @@
         // The reason for this is that ro.sf.lcd_density is write-once and is
         // set by the init process when it parses build.prop before anything else.
         return SystemProperties.getInt("qemu.sf.lcd_density",
-                SystemProperties.getInt("ro.sf.lcd_density", DENSITY_DEFAULT));
+                SystemProperties.getInt("persist.sys.lcd_density",
+                SystemProperties.getInt("ro.sf.lcd_density", DENSITY_DEFAULT)));
     }
 }
diff -Nru a/frameworks/base/core/res/res/values/strings.xml b/frameworks/base/core/res/res/values/strings.xml
--- a/frameworks/base/core/res/res/values/strings.xml	2012-07-15 20:28:29.277448184 +0900
+++ b/frameworks/base/core/res/res/values/strings.xml	2012-07-12 21:30:46.749930694 +0900
@@ -3576,4 +3576,7 @@
 
     <!-- "Done" button for MediaRouter chooser dialog when grouping routes. [CHAR LIMIT=NONE] -->
     <string name="media_route_chooser_grouping_done">Done</string>
+    <!--Application killed toast -->
+    <string name="app_killed_message" translatable="false">Application killed</string>
+
 </resources>
diff -Nru a/frameworks/base/data/keyboards/qwerty2.kcm b/frameworks/base/data/keyboards/qwerty2.kcm
--- a/frameworks/base/data/keyboards/qwerty2.kcm	2012-07-15 20:28:32.575096044 +0900
+++ b/frameworks/base/data/keyboards/qwerty2.kcm	2012-07-12 02:42:19.885305896 +0900
@@ -122,8 +122,8 @@
     number:                             '5'
     base:                               'l'
     shift, capslock:                    'L'
-    alt:                                ':'
-    shift+alt, capslock+alt:            '`'
+    alt:                                ';'
+    shift+alt, capslock+alt:            '+'
 }
 
 key M {
@@ -158,8 +158,8 @@
     number:                             '7'
     base:                               'p'
     shift, capslock:                    'P'
-    alt:                                '='
-    shift+alt, capslock+alt:            '\u00a5'
+    alt:                                '@'
+    shift+alt, capslock+alt:            '`'
 }
 
 key Q {
@@ -167,8 +167,8 @@
     number:                             '7'
     base:                               'q'
     shift, capslock:                    'Q'
-    alt:                                '|'
-    shift+alt, capslock+alt:            '\u0300'
+    alt:                                '\t'
+    shift+alt, capslock+alt:            '\t'
 }
 
 key R {
@@ -257,8 +257,8 @@
     number:                             ','
     base:                               ','
     shift:                              '<'
-    alt:                                ','
-    shift+alt:                          ','
+    alt:                                '['
+    shift+alt:                          '{'
 }
 
 key PERIOD {
@@ -266,8 +266,8 @@
     number:                             '.'
     base:                               '.'
     shift:                              '>'
-    alt:                                '.'
-    shift+alt:                          '\u2026'
+    alt:                                ']'
+    shift+alt:                          '}'
 }
 
 key AT {
@@ -284,8 +284,8 @@
     number:                             '/'
     base:                               '/'
     shift:                              '?'
-    alt:                                '?'
-    shift+alt:                          '?'
+    alt:                                ':'
+    shift+alt:                          '*'
 }
 
 key SPACE {
@@ -302,8 +302,8 @@
     number:                             '\n'
     base:                               '\n'
     shift:                              '\n'
-    alt:                                '\n'
-    shift+alt:                          '\n'
+    alt:                                '0'
+    shift+alt:                          '0'
 }
 
 key TAB {
@@ -319,9 +319,9 @@
     label:                              '0'
     number:                             '0'
     base:                               '0'
-    shift:                              ')'
-    alt:                                ')'
-    shift+alt:                          ')'
+    shift:                              '~'
+    alt:                                '^'
+    shift+alt:                          '^'
 }
 
 key 1 {
@@ -337,9 +337,9 @@
     label:                              '2'
     number:                             '2'
     base:                               '2'
-    shift:                              '@'
-    alt:                                '@'
-    shift+alt:                          '@'
+    shift:                              '"'
+    alt:                                '"'
+    shift+alt:                          '"'
 }
 
 key 3 {
@@ -373,36 +373,36 @@
     label:                              '6'
     number:                             '6'
     base:                               '6'
-    shift:                              '^'
-    alt:                                '^'
-    shift+alt:                          '^'
+    shift:                              '&'
+    alt:                                '&'
+    shift+alt:                          '&'
 }
 
 key 7 {
     label:                              '7'
     number:                             '7'
     base:                               '7'
-    shift:                              '&'
-    alt:                                '&'
-    shift+alt:                          '&'
+    shift:                              '\''
+    alt:                                '\''
+    shift+alt:                          '\''
 }
 
 key 8 {
     label:                              '8'
     number:                             '8'
     base:                               '8'
-    shift:                              '*'
-    alt:                                '*'
-    shift+alt:                          '*'
+    shift:                              '('
+    alt:                                '('
+    shift+alt:                          '('
 }
 
 key 9 {
     label:                              '9'
     number:                             '9'
     base:                               '9'
-    shift:                              '('
-    alt:                                '('
-    shift+alt:                          '('
+    shift:                              ')'
+    alt:                                ')'
+    shift+alt:                          ')'
 }
 
 key GRAVE {
@@ -418,8 +418,8 @@
     label:                              '-'
     number:                             '-'
     base:                               '-'
-    shift:                              '_'
-    alt:                                '-'
+    shift:                              '='
+    alt:                                '\\'
     shift+alt:                          '_'
 }
 
diff -Nru a/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
--- a/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java	2012-07-15 20:29:20.030810061 +0900
+++ b/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java	2012-07-15 18:12:29.657313699 +0900
@@ -17,6 +17,7 @@
 
 import android.app.ActivityManager;
 import android.app.ActivityManagerNative;
+import android.app.IActivityManager;
 import android.app.IUiModeManager;
 import android.app.ProgressDialog;
 import android.app.SearchManager;
@@ -1025,7 +1026,7 @@
                 * DisplayMetrics.DENSITY_DEFAULT
                 / DisplayMetrics.DENSITY_DEVICE;
 
-        if (shortSizeDp < 600) {
+        /*if (shortSizeDp < 600) {
             // 0-599dp: "phone" UI with a separate status & navigation bar
             mHasSystemNavBar = false;
             mNavigationBarCanMove = true;
@@ -1037,14 +1038,29 @@
             // 720dp: "tablet" UI with a single combined status & navigation bar
             mHasSystemNavBar = true;
             mNavigationBarCanMove = false;
+        }*/
+        if (shortSizeDp < 360) {
+            // 0-359dp: "phone" UI with a separate status & navigation bar
+            mHasSystemNavBar = false;
+            mNavigationBarCanMove = true;
+        } else if (shortSizeDp < 480) {
+            // 360-479dp: "phone" UI with modifications for larger screens
+            mHasSystemNavBar = false;
+            mNavigationBarCanMove = false;
+        } else {
+            // 480dp: "tablet" UI with a single combined status & navigation bar
+            mHasSystemNavBar = true;
+            mNavigationBarCanMove = false;
         }
 
+
         if (!mHasSystemNavBar) {
             mHasNavigationBar = mContext.getResources().getBoolean(
                     com.android.internal.R.bool.config_showNavigationBar);
             // Allow a system property to override this. Used by the emulator.
             // See also hasNavigationBar().
-            String navBarOverride = SystemProperties.get("qemu.hw.mainkeys");
+            String navBarOverride = SystemProperties.get("qemu.hw.mainkeys",
+                SystemProperties.get("persist.sys.mainkeys"));
             if (! "".equals(navBarOverride)) {
                 if      (navBarOverride.equals("1")) mHasNavigationBar = false;
                 else if (navBarOverride.equals("0")) mHasNavigationBar = true;
@@ -3037,9 +3053,12 @@
                 mPowerManager.userActivity(SystemClock.uptimeMillis(), false,
                         LocalPowerManager.BUTTON_EVENT);
             }
-        } else if (!mLidControlsSleep) {
+        /*} else if (!mLidControlsSleep) {
             mPowerManager.userActivity(SystemClock.uptimeMillis(), false,
                     LocalPowerManager.OTHER_EVENT);
+        }*/
+        } else {
+            mPowerManager.goToSleep(SystemClock.uptimeMillis());
         }
     }
 
@@ -3745,6 +3764,9 @@
             int sensorRotation = mOrientationListener.getProposedRotation(); // may be -1
             if (sensorRotation < 0) {
                 sensorRotation = lastRotation;
+                if (mLandscapeRotation >= 0) {
+                    sensorRotation = mLandscapeRotation;
+                }
             }
 
             final int preferredRotation;
@@ -4228,11 +4250,28 @@
         mContext.startActivity(mHomeIntent);
     }
     
+    int mKillProcessPid = 0;
     /**
      * goes to the home screen
      * @return whether it did anything
      */
     boolean goHome() {
+        mKillProcessPid = 0;
+        try {
+            IActivityManager mgr = ActivityManagerNative.getDefault();
+            java.util.List<android.app.ActivityManager.RunningAppProcessInfo> apps = mgr.getRunningAppProcesses();
+            for (android.app.ActivityManager.RunningAppProcessInfo appInfo : apps) {
+                int uid = appInfo.uid;
+                // Make sure it's a foreground user application (not system, root, phone, etc.)
+                if (uid >= android.os.Process.FIRST_APPLICATION_UID && uid <= android.os.Process.LAST_APPLICATION_UID
+                    && appInfo.importance == android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND) {
+                    mKillProcessPid = appInfo.pid;
+                    break;
+                }
+            }
+        } catch (RemoteException remoteException) {
+        }
+
         if (false) {
             // This code always brings home to the front.
             try {
@@ -4277,6 +4316,18 @@
                 // bummer, the activity manager, which is in this process, is dead
             }
         }
+        if (mKillProcessPid > 0) {
+            mHandler.post(new Runnable() {
+                public void run() {
+                    if (mKillProcessPid > 0) {
+                        performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
+                        // Kill the entire pid
+                        //android.widget.Toast.makeText(mContext, R.string.app_killed_message, android.widget.Toast.LENGTH_SHORT).show();
+                        android.os.Process.killProcess(mKillProcessPid);
+                    }
+                }
+            });
+        }
         return true;
     }
     
diff -Nru a/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java b/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
--- a/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java	2012-07-15 20:29:20.751170030 +0900
+++ b/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java	2012-07-15 18:35:25.809256145 +0900
@@ -6398,8 +6398,12 @@
         sl = reduceConfigLayout(sl, Surface.ROTATION_90, density, unrotDh, unrotDw);
         sl = reduceConfigLayout(sl, Surface.ROTATION_180, density, unrotDw, unrotDh);
         sl = reduceConfigLayout(sl, Surface.ROTATION_270, density, unrotDh, unrotDw);
-        outConfig.smallestScreenWidthDp = (int)(mSmallestDisplayWidth / density);
-        outConfig.screenLayout = sl;
+        int wd = (int)(mSmallestDisplayWidth / density);
+        outConfig.smallestScreenWidthDp = ((wd >= 480) && (wd < 720)) ? 720 : wd;
+        outConfig.screenLayout = ((wd >= 480) && ((sl & Configuration.SCREENLAYOUT_SIZE_MASK) <
+                                   Configuration.SCREENLAYOUT_SIZE_LARGE)) ?
+                                 ((sl & ~Configuration.SCREENLAYOUT_SIZE_MASK) |
+                                  Configuration.SCREENLAYOUT_SIZE_LARGE) : sl;
     }
 
     private int reduceCompatConfigWidthSize(int curSize, int rotation, DisplayMetrics dm,
diff -Nru a/frameworks/base/services/jni/com_android_server_location_GpsLocationProvider.cpp b/frameworks/base/services/jni/com_android_server_location_GpsLocationProvider.cpp
--- a/frameworks/base/services/jni/com_android_server_location_GpsLocationProvider.cpp	2012-07-15 20:29:20.815202027 +0900
+++ b/frameworks/base/services/jni/com_android_server_location_GpsLocationProvider.cpp	2012-07-12 02:42:19.897305895 +0900
@@ -136,7 +136,7 @@
 }
 
 GpsCallbacks sGpsCallbacks = {
-    sizeof(GpsCallbacks),
+//    sizeof(GpsCallbacks),
     location_callback,
     status_callback,
     sv_status_callback,
diff -Nru a/frameworks/base/services/sensorservice/SensorDevice.cpp b/frameworks/base/services/sensorservice/SensorDevice.cpp
--- a/frameworks/base/services/sensorservice/SensorDevice.cpp	2012-07-15 20:29:20.831210028 +0900
+++ b/frameworks/base/services/sensorservice/SensorDevice.cpp	2012-07-12 02:57:53.901266832 +0900
@@ -109,15 +109,22 @@
             SENSORS_HARDWARE_MODULE_ID, strerror(-err));
 
     if (mSensorModule) {
-        err = sensors_open(&mSensorModule->common, &mSensorDevice);
+        err = sensors_control_open(&mSensorModule->common, &mSensorDevice);
 
         ALOGE_IF(err, "couldn't open device for module %s (%s)",
                 SENSORS_HARDWARE_MODULE_ID, strerror(-err));
 
+        err = sensors_data_open(&mSensorModule->common, &mSensorDataDevice);
+
+        ALOGE_IF(err, "couldn't open data device for module %s (%s)",
+                SENSORS_HARDWARE_MODULE_ID, strerror(-err));
+
         if (mSensorDevice) {
             sensor_t const* list;
             ssize_t count = mSensorModule->get_sensors_list(mSensorModule, &list);
             mActivationCount.setCapacity(count);
+            native_handle_t* hdl = mSensorDevice->open_data_source(mSensorDevice);
+            mSensorDataDevice->data_open(mSensorDataDevice, hdl);
             Info model;
             for (size_t i=0 ; i<size_t(count) ; i++) {
                 mActivationCount.add(list[i].handle, model);
@@ -166,11 +173,35 @@
 
 ssize_t SensorDevice::poll(sensors_event_t* buffer, size_t count) {
     if (!mSensorDevice) return NO_INIT;
-    ssize_t c;
-    do {
-        c = mSensorDevice->poll(mSensorDevice, buffer, count);
-    } while (c == -EINTR);
-    return c;
+    sensors_data_t data;
+    int ret;
+    ret = mSensorDataDevice->poll(mSensorDataDevice, &data);
+    if (ret < 0) {
+        return 0;
+    }
+    buffer->version = 0;
+    buffer->sensor = (data.sensor == 0x1) ? 0 :
+                     (data.sensor == 0x2) ? 1 :
+                     (data.sensor == 0x4) ? 2 :
+                     (data.sensor == 0x8) ? 3 :
+                     (data.sensor == 0x10) ? 4 :
+                     (data.sensor == 0x20) ? 5 :
+                     (data.sensor == 0x40) ? 6 :
+                     (data.sensor == 0x80) ? 7 :
+                     (data.sensor == 0x100) ? 8 :
+                     (data.sensor == 0x200) ? 9 :
+                     (data.sensor == 0x400) ? 10 :
+                     (data.sensor == 0x800) ? 11 :
+                     (data.sensor == 0x1000) ? 12 :
+                     (data.sensor == 0x2000) ? 13 :
+                     (data.sensor == 0x4000) ? 14 : 15;
+    buffer->type = 0;
+    buffer->timestamp = data.time;
+    buffer->acceleration.x = data.acceleration.x;
+    buffer->acceleration.y = data.acceleration.y;
+    buffer->acceleration.z = data.acceleration.z;
+    buffer->acceleration.status = data.acceleration.status;
+    return 1;
 }
 
 status_t SensorDevice::activate(void* ident, int handle, int enabled)
@@ -233,7 +264,7 @@
     { // scope for the lock
         Mutex::Autolock _l(mLock);
         nsecs_t ns = info.selectDelay();
-        mSensorDevice->setDelay(mSensorDevice, handle, ns);
+        mSensorDevice->set_delay(mSensorDevice, (int32_t)(ns/1000000));
     }
 
     return err;
@@ -247,7 +278,7 @@
     status_t err = info.setDelayForIdent(ident, ns);
     if (err < 0) return err;
     ns = info.selectDelay();
-    return mSensorDevice->setDelay(mSensorDevice, handle, ns);
+    return mSensorDevice->set_delay(mSensorDevice, (int32_t)(ns/1000000));
 }
 
 // ---------------------------------------------------------------------------
diff -Nru a/frameworks/base/services/sensorservice/SensorDevice.h b/frameworks/base/services/sensorservice/SensorDevice.h
--- a/frameworks/base/services/sensorservice/SensorDevice.h	2012-07-15 20:29:20.831210028 +0900
+++ b/frameworks/base/services/sensorservice/SensorDevice.h	2012-07-12 02:42:19.897305895 +0900
@@ -35,7 +35,8 @@
 
 class SensorDevice : public Singleton<SensorDevice> {
     friend class Singleton<SensorDevice>;
-    struct sensors_poll_device_t* mSensorDevice;
+    struct sensors_control_device_t* mSensorDevice;
+    struct sensors_data_device_t* mSensorDataDevice;
     struct sensors_module_t* mSensorModule;
     mutable Mutex mLock; // protect mActivationCount[].rates
     // fixed-size array after construction
diff -Nru a/frameworks/native/include/binder/Binder.h b/frameworks/native/include/binder/Binder.h
--- a/frameworks/native/include/binder/Binder.h	2012-07-15 20:29:31.936759564 +0900
+++ b/frameworks/native/include/binder/Binder.h	2012-07-12 02:42:19.889305896 +0900
@@ -27,7 +27,11 @@
 public:
                         BBinder();
 
+#ifndef LIBBINDER_DECKARD
     virtual const String16& getInterfaceDescriptor() const;
+#else
+    virtual String16    getInterfaceDescriptor() const;
+#endif
     virtual bool        isBinderAlive() const;
     virtual status_t    pingBinder();
     virtual status_t    dump(int fd, const Vector<String16>& args);
diff -Nru a/frameworks/native/include/binder/BpBinder.h b/frameworks/native/include/binder/BpBinder.h
--- a/frameworks/native/include/binder/BpBinder.h	2012-07-15 20:29:31.936759564 +0900
+++ b/frameworks/native/include/binder/BpBinder.h	2012-07-12 02:42:19.889305896 +0900
@@ -31,7 +31,11 @@
 
     inline  int32_t     handle() const { return mHandle; }
 
+#ifndef LIBBINDER_DECKARD
     virtual const String16&    getInterfaceDescriptor() const;
+#else
+    virtual String16    getInterfaceDescriptor() const;
+#endif
     virtual bool        isBinderAlive() const;
     virtual status_t    pingBinder();
     virtual status_t    dump(int fd, const Vector<String16>& args);
diff -Nru a/frameworks/native/include/binder/IBinder.h b/frameworks/native/include/binder/IBinder.h
--- a/frameworks/native/include/binder/IBinder.h	2012-07-15 20:29:31.936759564 +0900
+++ b/frameworks/native/include/binder/IBinder.h	2012-07-12 02:42:19.889305896 +0900
@@ -57,7 +57,11 @@
         FLAG_ONEWAY             = 0x00000001
     };
 
+#ifndef LIBBINDER_DECKARD
                           IBinder();
+#else
+    inline                  IBinder() { }
+#endif
 
     /**
      * Check if this IBinder implements the interface named by
@@ -70,7 +74,11 @@
      * Return the canonical name of the interface provided by this IBinder
      * object.
      */
+#ifndef LIBBINDER_DECKARD
     virtual const String16& getInterfaceDescriptor() const = 0;
+#else
+    virtual String16        getInterfaceDescriptor() const = 0;
+#endif
 
     virtual bool            isBinderAlive() const = 0;
     virtual status_t        pingBinder() = 0;
@@ -148,7 +156,11 @@
     virtual BpBinder*       remoteBinder();
 
 protected:
+#ifndef LIBBINDER_DECKARD
     virtual          ~IBinder();
+#else
+    inline virtual          ~IBinder() { }
+#endif
 
 private:
 };
diff -Nru a/frameworks/native/include/binder/IInterface.h b/frameworks/native/include/binder/IInterface.h
--- a/frameworks/native/include/binder/IInterface.h	2012-07-15 20:29:31.936759564 +0900
+++ b/frameworks/native/include/binder/IInterface.h	2012-07-12 02:42:19.889305896 +0900
@@ -27,12 +27,16 @@
 class IInterface : public virtual RefBase
 {
 public:
+#ifndef LIBBINDER_DECKARD
             IInterface();
+#endif
             sp<IBinder>         asBinder();
             sp<const IBinder>   asBinder() const;
             
 protected:
+#ifndef LIBBINDER_DECKARD
     virtual                     ~IInterface();
+#endif
     virtual IBinder*            onAsBinder() = 0;
 };
 
@@ -51,7 +55,11 @@
 {
 public:
     virtual sp<IInterface>      queryLocalInterface(const String16& _descriptor);
+#ifndef LIBBINDER_DECKARD
     virtual const String16&     getInterfaceDescriptor() const;
+#else
+    virtual String16            getInterfaceDescriptor() const;
+#endif
 
 protected:
     virtual IBinder*            onAsBinder();
@@ -71,6 +79,7 @@
 
 // ----------------------------------------------------------------------
 
+#ifndef LIBBINDER_DECKARD
 #define DECLARE_META_INTERFACE(INTERFACE)                               \
     static const android::String16 descriptor;                          \
     static android::sp<I##INTERFACE> asInterface(                       \
@@ -79,7 +88,16 @@
     I##INTERFACE();                                                     \
     virtual ~I##INTERFACE();                                            \
 
+#else
+#define DECLARE_META_INTERFACE(INTERFACE)                               \
+    static const android::String16 descriptor;                          \
+    static android::sp<I##INTERFACE> asInterface(                       \
+            const android::sp<android::IBinder>& obj);                  \
+    virtual android::String16 getInterfaceDescriptor() const;           \
+
+#endif
 
+#ifndef LIBBINDER_DECKARD
 #define IMPLEMENT_META_INTERFACE(INTERFACE, NAME)                       \
     const android::String16 I##INTERFACE::descriptor(NAME);             \
     const android::String16&                                            \
@@ -103,6 +121,28 @@
     I##INTERFACE::I##INTERFACE() { }                                    \
     I##INTERFACE::~I##INTERFACE() { }                                   \
 
+#else
+#define IMPLEMENT_META_INTERFACE(INTERFACE, NAME)                       \
+    const android::String16 I##INTERFACE::descriptor(NAME);             \
+    String16 I##INTERFACE::getInterfaceDescriptor() const {             \
+        return I##INTERFACE::descriptor;                                \
+    }                                                                   \
+    android::sp<I##INTERFACE> I##INTERFACE::asInterface(                \
+            const android::sp<android::IBinder>& obj)                   \
+    {                                                                   \
+        android::sp<I##INTERFACE> intr;                                 \
+        if (obj != NULL) {                                              \
+            intr = static_cast<I##INTERFACE*>(                          \
+                obj->queryLocalInterface(                               \
+                        I##INTERFACE::descriptor).get());               \
+            if (intr == NULL) {                                         \
+                intr = new Bp##INTERFACE(obj);                          \
+            }                                                           \
+        }                                                               \
+        return intr;                                                    \
+    }                                                                   \
+
+#endif
 
 #define CHECK_INTERFACE(interface, data, reply)                         \
     if (!data.checkInterface(this)) { return PERMISSION_DENIED; }       \
@@ -120,7 +160,11 @@
 }
 
 template<typename INTERFACE>
+#ifndef LIBBINDER_DECKARD
 inline const String16& BnInterface<INTERFACE>::getInterfaceDescriptor() const
+#else
+inline String16 BnInterface<INTERFACE>::getInterfaceDescriptor() const
+#endif
 {
     return INTERFACE::getInterfaceDescriptor();
 }
diff -Nru a/frameworks/native/include/binder/Parcel.h b/frameworks/native/include/binder/Parcel.h
--- a/frameworks/native/include/binder/Parcel.h	2012-07-15 20:29:31.936759564 +0900
+++ b/frameworks/native/include/binder/Parcel.h	2012-07-12 02:42:19.893305895 +0900
@@ -74,8 +74,14 @@
     // propagating the StrictMode policy mask, populating the current
     // IPCThreadState, which as an optimization may optionally be
     // passed in.
+#ifndef LIBBINDER_DECKARD
     bool                enforceInterface(const String16& interface,
                                          IPCThreadState* threadState = NULL) const;
+#else
+    bool                enforceInterface(const String16& interface) const;
+    bool                enforceInterface(const String16& interface,
+                                         IPCThreadState* threadState) const;
+#endif
     bool                checkInterface(IBinder*) const;
 
     void                freeData();
@@ -111,7 +117,12 @@
     // Place a file descriptor into the parcel.  The given fd must remain
     // valid for the lifetime of the parcel.
     // The Parcel does not take ownership of the given fd unless you ask it to.
+#ifndef LIBBINDER_DECKARD
     status_t            writeFileDescriptor(int fd, bool takeOwnership = false);
+#else
+    status_t            writeFileDescriptor(int fd);
+    status_t            writeFileDescriptor(int fd, bool takeOwnership);
+#endif
     
     // Place a file descriptor into the parcel.  A dup of the fd is made, which
     // will be closed once the parcel is destroyed.
diff -Nru a/frameworks/native/include/utils/Condition.h b/frameworks/native/include/utils/Condition.h
--- a/frameworks/native/include/utils/Condition.h	2012-07-15 20:29:31.940761563 +0900
+++ b/frameworks/native/include/utils/Condition.h	2012-07-12 02:42:19.893305895 +0900
@@ -70,6 +70,7 @@
 
 // ---------------------------------------------------------------------------
 
+#ifndef LIBUTILS_DECKARD
 #if defined(HAVE_PTHREADS)
 
 inline Condition::Condition() {
@@ -126,6 +127,7 @@
 }
 
 #endif // HAVE_PTHREADS
+#endif
 
 // ---------------------------------------------------------------------------
 }; // namespace android
diff -Nru a/frameworks/native/include/utils/Mutex.h b/frameworks/native/include/utils/Mutex.h
--- a/frameworks/native/include/utils/Mutex.h	2012-07-15 20:29:31.940761563 +0900
+++ b/frameworks/native/include/utils/Mutex.h	2012-07-12 02:42:19.893305895 +0900
@@ -88,12 +88,14 @@
 
 #if defined(HAVE_PTHREADS)
 
+#ifndef LIBUTILS_DECKARD
 inline Mutex::Mutex() {
     pthread_mutex_init(&mMutex, NULL);
 }
 inline Mutex::Mutex(const char* name) {
     pthread_mutex_init(&mMutex, NULL);
 }
+#endif
 inline Mutex::Mutex(int type, const char* name) {
     if (type == SHARED) {
         pthread_mutexattr_t attr;
@@ -105,6 +107,7 @@
         pthread_mutex_init(&mMutex, NULL);
     }
 }
+#ifndef LIBUTILS_DECKARD
 inline Mutex::~Mutex() {
     pthread_mutex_destroy(&mMutex);
 }
@@ -117,6 +120,7 @@
 inline status_t Mutex::tryLock() {
     return -pthread_mutex_trylock(&mMutex);
 }
+#endif
 
 #endif // HAVE_PTHREADS
 
diff -Nru a/frameworks/native/libs/binder/Android.mk b/frameworks/native/libs/binder/Android.mk
--- a/frameworks/native/libs/binder/Android.mk	2012-07-15 20:29:31.944763562 +0900
+++ b/frameworks/native/libs/binder/Android.mk	2012-07-12 02:42:19.893305895 +0900
@@ -43,3 +43,12 @@
 LOCAL_MODULE := libbinder
 LOCAL_SRC_FILES := $(sources)
 include $(BUILD_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_CFLAGS += -DLIBBINDER_DECKARD
+LOCAL_LDLIBS += -lpthread
+LOCAL_MODULE := libbinder.deckard
+LOCAL_MODULE_TAGS := optional
+LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libbinder
+LOCAL_SRC_FILES := $(sources)
+include $(BUILD_SHARED_LIBRARY)
diff -Nru a/frameworks/native/libs/binder/Binder.cpp b/frameworks/native/libs/binder/Binder.cpp
--- a/frameworks/native/libs/binder/Binder.cpp	2012-07-15 20:29:31.944763562 +0900
+++ b/frameworks/native/libs/binder/Binder.cpp	2012-07-12 02:42:19.893305895 +0900
@@ -28,6 +28,7 @@
 
 // ---------------------------------------------------------------------------
 
+#ifndef LIBBINDER_DECKARD
 IBinder::IBinder()
     : RefBase()
 {
@@ -36,6 +37,7 @@
 IBinder::~IBinder()
 {
 }
+#endif
 
 // ---------------------------------------------------------------------------
 
@@ -85,13 +87,19 @@
     return NO_ERROR;
 }
 
+extern String16 gEmptyDescriptor;
+
+#ifndef LIBBINDER_DECKARD
 const String16& BBinder::getInterfaceDescriptor() const
+#else
+String16 BBinder::getInterfaceDescriptor() const
+#endif
 {
     // This is a local static rather than a global static,
     // to avoid static initializer ordering issues.
-    static String16 sEmptyDescriptor;
+//    static String16 sEmptyDescriptor;
     ALOGW("reached BBinder::getInterfaceDescriptor (this=%p)", this);
-    return sEmptyDescriptor;
+    return gEmptyDescriptor;
 }
 
 status_t BBinder::transact(
diff -Nru a/frameworks/native/libs/binder/BpBinder.cpp b/frameworks/native/libs/binder/BpBinder.cpp
--- a/frameworks/native/libs/binder/BpBinder.cpp	2012-07-15 20:29:31.944763562 +0900
+++ b/frameworks/native/libs/binder/BpBinder.cpp	2012-07-12 02:42:19.893305895 +0900
@@ -103,7 +103,11 @@
     return mDescriptorCache.size() ? true : false;
 }
 
+#ifndef LIBBINDER_DECKARD
 const String16& BpBinder::getInterfaceDescriptor() const
+#else
+String16 BpBinder::getInterfaceDescriptor() const
+#endif
 {
     if (isDescriptorCached() == false) {
         Parcel send, reply;
diff -Nru a/frameworks/native/libs/binder/IInterface.cpp b/frameworks/native/libs/binder/IInterface.cpp
--- a/frameworks/native/libs/binder/IInterface.cpp	2012-07-15 20:29:31.944763562 +0900
+++ b/frameworks/native/libs/binder/IInterface.cpp	2012-07-12 02:42:19.893305895 +0900
@@ -20,12 +20,14 @@
 
 // ---------------------------------------------------------------------------
 
+#ifndef LIBBINDER_DECKARD
 IInterface::IInterface() 
     : RefBase() {
 }
 
 IInterface::~IInterface() {
 }
+#endif
 
 sp<IBinder> IInterface::asBinder()
 {
diff -Nru a/frameworks/native/libs/binder/IMemory.cpp b/frameworks/native/libs/binder/IMemory.cpp
--- a/frameworks/native/libs/binder/IMemory.cpp	2012-07-15 20:29:31.944763562 +0900
+++ b/frameworks/native/libs/binder/IMemory.cpp	2012-07-12 02:42:19.893305895 +0900
@@ -63,7 +63,7 @@
     KeyedVector< wp<IBinder>, heap_info_t > mHeapCache;
 };
 
-static sp<HeapCache> gHeapCache = new HeapCache();
+extern sp<HeapCache> gHeapCache;
 
 /******************************************************************************/
 
diff -Nru a/frameworks/native/libs/binder/IPCThreadState.cpp b/frameworks/native/libs/binder/IPCThreadState.cpp
--- a/frameworks/native/libs/binder/IPCThreadState.cpp	2012-07-15 20:29:31.944763562 +0900
+++ b/frameworks/native/libs/binder/IPCThreadState.cpp	2012-07-12 02:42:19.893305895 +0900
@@ -289,11 +289,11 @@
 }
 #endif
 
-static pthread_mutex_t gTLSMutex = PTHREAD_MUTEX_INITIALIZER;
-static bool gHaveTLS = false;
-static pthread_key_t gTLS = 0;
-static bool gShutdown = false;
-static bool gDisableBackgroundScheduling = false;
+extern pthread_mutex_t gTLSMutex;
+extern bool gHaveTLS;
+extern pthread_key_t gTLS;
+extern bool gShutdown;
+extern bool gDisableBackgroundScheduling;
 
 IPCThreadState* IPCThreadState::self()
 {
diff -Nru a/frameworks/native/libs/binder/Parcel.cpp b/frameworks/native/libs/binder/Parcel.cpp
--- a/frameworks/native/libs/binder/Parcel.cpp	2012-07-15 20:29:31.944763562 +0900
+++ b/frameworks/native/libs/binder/Parcel.cpp	2012-07-12 02:42:19.893305895 +0900
@@ -483,6 +483,13 @@
     return enforceInterface(binder->getInterfaceDescriptor());
 }
 
+#ifdef LIBBINDER_DECKARD
+bool Parcel::enforceInterface(const String16& interface) const
+{
+    return enforceInterface(interface, NULL);
+}
+#endif
+
 bool Parcel::enforceInterface(const String16& interface,
                               IPCThreadState* threadState) const
 {
@@ -710,6 +717,13 @@
     return err;
 }
 
+#ifdef LIBBINDER_DECKARD
+status_t Parcel::writeFileDescriptor(int fd)
+{
+    return writeFileDescriptor(fd, false);
+}
+#endif
+
 status_t Parcel::writeFileDescriptor(int fd, bool takeOwnership)
 {
     flat_binder_object obj;
diff -Nru a/frameworks/native/libs/binder/Static.cpp b/frameworks/native/libs/binder/Static.cpp
--- a/frameworks/native/libs/binder/Static.cpp	2012-07-15 20:29:31.944763562 +0900
+++ b/frameworks/native/libs/binder/Static.cpp	2012-07-12 02:42:19.893305895 +0900
@@ -24,6 +24,49 @@
 
 namespace android {
 
+#ifndef LIBBINDER_DECKARD
+// ------------ Binder.cpp
+
+String16 gEmptyDescriptor;
+
+// ------------ IMemory.cpp
+
+class HeapCache : public IBinder::DeathRecipient
+{
+public:
+    HeapCache();
+    virtual ~HeapCache();
+
+    virtual void binderDied(const wp<IBinder>& who);
+
+    sp<IMemoryHeap> find_heap(const sp<IBinder>& binder);
+    void free_heap(const sp<IBinder>& binder);
+    sp<IMemoryHeap> get_heap(const sp<IBinder>& binder);
+    void dump_heaps();
+
+private:
+    // For IMemory.cpp
+    struct heap_info_t {
+        sp<IMemoryHeap> heap;
+        int32_t         count;
+    };
+
+    void free_heap(const wp<IBinder>& binder);
+
+    Mutex mHeapCacheLock;
+    KeyedVector< wp<IBinder>, heap_info_t > mHeapCache;
+};
+
+sp<HeapCache> gHeapCache = new HeapCache();
+
+// ------------ IPCThreadState.cpp
+
+pthread_mutex_t gTLSMutex = PTHREAD_MUTEX_INITIALIZER;
+bool gHaveTLS = false;
+pthread_key_t gTLS = 0;
+bool gShutdown = false;
+bool gDisableBackgroundScheduling = false;
+
 // ------------ ProcessState.cpp
 
 Mutex gProcessMutex;
@@ -49,5 +92,6 @@
 Mutex gDefaultServiceManagerLock;
 sp<IServiceManager> gDefaultServiceManager;
 sp<IPermissionController> gPermissionController;
+#endif
 
 }   // namespace android
diff -Nru a/frameworks/native/libs/utils/Android.mk b/frameworks/native/libs/utils/Android.mk
--- a/frameworks/native/libs/utils/Android.mk	2012-07-15 20:29:31.948765562 +0900
+++ b/frameworks/native/libs/utils/Android.mk	2012-07-12 02:42:19.893305895 +0900
@@ -110,6 +110,7 @@
 LOCAL_LDLIBS += -lrt -ldl
 endif
 
+LOCAL_CFLAGS += -DLIBUTILS_DECKARD
 LOCAL_C_INCLUDES += \
 		bionic/libc/private \
 		external/zlib
diff -Nru a/frameworks/native/libs/utils/Threads.cpp b/frameworks/native/libs/utils/Threads.cpp
--- a/frameworks/native/libs/utils/Threads.cpp	2012-07-15 20:29:31.984783560 +0900
+++ b/frameworks/native/libs/utils/Threads.cpp	2012-07-12 02:42:19.893305895 +0900
@@ -382,7 +382,28 @@
  */
 
 #if defined(HAVE_PTHREADS)
+#ifndef LIBUTILS_DECKARD
 // implemented as inlines in threads.h
+#else
+Mutex::Mutex() {
+    pthread_mutex_init(&mMutex, NULL);
+}
+Mutex::Mutex(const char* name) {
+    pthread_mutex_init(&mMutex, NULL);
+}
+Mutex::~Mutex() {
+    pthread_mutex_destroy(&mMutex);
+}
+status_t Mutex::lock() {
+    return -pthread_mutex_lock(&mMutex);
+}
+void Mutex::unlock() {
+    pthread_mutex_unlock(&mMutex);
+}
+status_t Mutex::tryLock() {
+    return -pthread_mutex_trylock(&mMutex);
+}
+#endif
 #elif defined(HAVE_WIN32_THREADS)
 
 Mutex::Mutex()
@@ -457,7 +478,62 @@
  */
 
 #if defined(HAVE_PTHREADS)
+#ifndef LIBUTILS_DECKARD
 // implemented as inlines in threads.h
+#else
+Condition::Condition() {
+    pthread_cond_init(&mCond, NULL);
+}
+Condition::Condition(int type) {
+    if (type == SHARED) {
+        pthread_condattr_t attr;
+        pthread_condattr_init(&attr);
+        pthread_condattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
+        pthread_cond_init(&mCond, &attr);
+        pthread_condattr_destroy(&attr);
+    } else {
+        pthread_cond_init(&mCond, NULL);
+    }
+}
+Condition::~Condition() {
+    pthread_cond_destroy(&mCond);
+}
+status_t Condition::wait(Mutex& mutex) {
+    return -pthread_cond_wait(&mCond, &mutex.mMutex);
+}
+status_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime) {
+#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE)
+    struct timespec ts;
+    ts.tv_sec  = reltime/1000000000;
+    ts.tv_nsec = reltime%1000000000;
+    return -pthread_cond_timedwait_relative_np(&mCond, &mutex.mMutex, &ts);
+#else // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE
+    struct timespec ts;
+#if defined(HAVE_POSIX_CLOCKS)
+    clock_gettime(CLOCK_REALTIME, &ts);
+#else // HAVE_POSIX_CLOCKS
+    // we don't support the clocks here.
+    struct timeval t;
+    gettimeofday(&t, NULL);
+    ts.tv_sec = t.tv_sec;
+    ts.tv_nsec= t.tv_usec*1000;
+#endif // HAVE_POSIX_CLOCKS
+    ts.tv_sec += reltime/1000000000;
+    ts.tv_nsec+= reltime%1000000000;
+    if (ts.tv_nsec >= 1000000000) {
+        ts.tv_nsec -= 1000000000;
+        ts.tv_sec  += 1;
+    }
+    return -pthread_cond_timedwait(&mCond, &mutex.mMutex, &ts);
+#endif // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE
+}
+void Condition::signal() {
+    pthread_cond_signal(&mCond);
+}
+void Condition::broadcast() {
+    pthread_cond_broadcast(&mCond);
+}
+#endif
 #elif defined(HAVE_WIN32_THREADS)
 
 /*
diff -Nru a/hardware/libhardware/include/hardware/fb.h b/hardware/libhardware/include/hardware/fb.h
--- a/hardware/libhardware/include/hardware/fb.h	2012-07-15 20:29:37.383481337 +0900
+++ b/hardware/libhardware/include/hardware/fb.h	2012-07-11 04:14:32.000000000 +0900
@@ -64,7 +64,10 @@
     /* max swap interval supported by this framebuffer */
     const int       maxSwapInterval;
 
-    int reserved[8];
+    /* Number of framebuffers supported*/
+    const int       numFramebuffers;
+
+    int reserved[7];
 
     /*
      * requests a specific swap-interval (same definition than EGL)
diff -Nru a/hardware/libhardware/include/hardware/gps.h b/hardware/libhardware/include/hardware/gps.h
--- a/hardware/libhardware/include/hardware/gps.h	2012-07-15 20:29:37.383481337 +0900
+++ b/hardware/libhardware/include/hardware/gps.h	2012-07-12 02:42:19.897305895 +0900
@@ -39,7 +39,7 @@
 #define GPS_MAX_SVS 32
 
 /** Requested operational mode for GPS operation. */
-typedef uint32_t GpsPositionMode;
+typedef uint16_t GpsPositionMode;
 // IMPORTANT: Note that the following values must match
 // constants in GpsLocationProvider.java.
 /** Mode for running GPS standalone (no assistance). */
@@ -230,8 +230,6 @@
 
 /** Represents a location. */
 typedef struct {
-    /** set to sizeof(GpsLocation) */
-    size_t          size;
     /** Contains GpsLocationFlags bits. */
     uint16_t        flags;
     /** Represents latitude in degrees. */
@@ -253,15 +251,11 @@
 
 /** Represents the status. */
 typedef struct {
-    /** set to sizeof(GpsStatus) */
-    size_t          size;
     GpsStatusValue status;
 } GpsStatus;
 
 /** Represents SV information. */
 typedef struct {
-    /** set to sizeof(GpsSvInfo) */
-    size_t          size;
     /** Pseudo-random number for the SV. */
     int     prn;
     /** Signal to noise ratio. */
@@ -274,9 +268,6 @@
 
 /** Represents SV status. */
 typedef struct {
-    /** set to sizeof(GpsSvStatus) */
-    size_t          size;
-
     /** Number of SVs currently visible. */
     int         num_svs;
 
@@ -366,8 +357,6 @@
 
 /** GPS callback structure. */
 typedef struct {
-    /** set to sizeof(GpsCallbacks) */
-    size_t      size;
     gps_location_callback location_cb;
     gps_status_callback status_cb;
     gps_sv_status_callback sv_status_cb;
@@ -382,8 +371,6 @@
 
 /** Represents the standard GPS interface. */
 typedef struct {
-    /** set to sizeof(GpsInterface) */
-    size_t          size;
     /**
      * Opens the interface and provides the callback routines
      * to the implemenation of this interface.
@@ -443,8 +430,6 @@
 
 /** Extended interface for XTRA support. */
 typedef struct {
-    /** set to sizeof(GpsXtraInterface) */
-    size_t          size;
     /**
      * Opens the XTRA interface and provides the callback routines
      * to the implemenation of this interface.
@@ -468,12 +453,11 @@
 
 /** Represents the status of AGPS. */
 typedef struct {
-    /** set to sizeof(AGpsStatus) */
-    size_t          size;
-
     AGpsType        type;
     AGpsStatusValue status;
     uint32_t        ipaddr;
+    /** set to sizeof(AGpsStatus) */
+    size_t          size;
 } AGpsStatus;
 
 /** Callback with AGPS status information.
@@ -490,9 +474,6 @@
 
 /** Extended interface for AGPS support. */
 typedef struct {
-    /** set to sizeof(AGpsInterface) */
-    size_t          size;
-
     /**
      * Opens the AGPS interface and provides the callback routines
      * to the implemenation of this interface.
diff -Nru a/hardware/libhardware/include/hardware/sensors.h b/hardware/libhardware/include/hardware/sensors.h
--- a/hardware/libhardware/include/hardware/sensors.h	2012-07-15 20:29:37.383481337 +0900
+++ b/hardware/libhardware/include/hardware/sensors.h	2012-07-12 02:42:19.897305895 +0900
@@ -34,6 +34,8 @@
 /**
  * Name of the sensors device to open
  */
+#define SENSORS_HARDWARE_CONTROL    "control"
+#define SENSORS_HARDWARE_DATA       "data"
 #define SENSORS_HARDWARE_POLL       "poll"
 
 /**
@@ -325,6 +327,33 @@
  * Union of the various types of sensor data
  * that can be returned.
  */
+typedef struct {
+    /* sensor identifier */
+    int             sensor;
+
+    union {
+        /* x,y,z values of the given sensor */
+        sensors_vec_t   vector;
+
+        /* orientation values are in degrees */
+        sensors_vec_t   orientation;
+
+        /* acceleration values are in meter per second per second (m/s^2) */
+        sensors_vec_t   acceleration;
+
+        /* magnetic vector values are in micro-Tesla (uT) */
+        sensors_vec_t   magnetic;
+
+        /* temperature is in degrees centigrade (Celsius) */
+        float           temperature;
+    };
+
+    /* time is in nanosecond */
+    int64_t         time;
+
+    uint32_t        reserved;
+} sensors_data_t;
+
 typedef struct sensors_event_t {
     /* must be sizeof(struct sensors_event_t) */
     int32_t version;
@@ -431,6 +460,78 @@
  * Every device data structure must begin with hw_device_t
  * followed by module specific public methods and attributes.
  */
+struct sensors_control_device_t {
+    struct hw_device_t common;
+    
+    /**
+     * Returns a native_handle_t, which will be the parameter to
+     * sensors_data_device_t::open_data(). 
+     * The caller takes ownership of this handle. This is intended to be
+     * passed cross processes.
+     *
+     * @return a native_handle_t if successful, NULL on error
+     */
+    native_handle_t* (*open_data_source)(struct sensors_control_device_t *dev);
+    
+    /** Activate/deactivate one sensor.
+     *
+     * @param handle is the handle of the sensor to change.
+     * @param enabled set to 1 to enable, or 0 to disable the sensor.
+     *
+     * @return 0 on success, negative errno code otherwise
+     */
+    int (*activate)(struct sensors_control_device_t *dev, 
+            int handle, int enabled);
+    
+    /**
+     * Set the delay between sensor events in ms
+     *
+     * @return 0 if successful, < 0 on error
+     */
+    int (*set_delay)(struct sensors_control_device_t *dev, int32_t ms);
+
+    /**
+     * Causes sensors_data_device_t.poll() to return -EWOULDBLOCK immediately.
+     */
+    int (*wake)(struct sensors_control_device_t *dev);
+};
+
+struct sensors_data_device_t {
+    struct hw_device_t common;
+
+    /**
+     * Prepare to read sensor data.
+     *
+     * This routine does NOT take ownership of the handle
+     * and must not close it. Typically this routine would
+     * use a duplicate of the nh parameter.
+     *
+     * @param nh from sensors_control_open.
+     *
+     * @return 0 if successful, < 0 on error
+     */
+    int (*data_open)(struct sensors_data_device_t *dev, native_handle_t* nh);
+    
+    /**
+     * Caller has completed using the sensor data.
+     * The caller will not be blocked in sensors_data_poll
+     * when this routine is called.
+     *
+     * @return 0 if successful, < 0 on error
+     */
+    int (*data_close)(struct sensors_data_device_t *dev);
+    
+    /**
+     * Return sensor data for one of the enabled sensors.
+     *
+     * @return sensor handle for the returned data, 0x7FFFFFFF when 
+     * sensors_control_device_t.wake() is called and -errno on error
+     *  
+     */
+    int (*poll)(struct sensors_data_device_t *dev, 
+            sensors_data_t* data);
+};
+
 struct sensors_poll_device_t {
     struct hw_device_t common;
 
@@ -470,6 +571,26 @@
 
 /** convenience API for opening and closing a device */
 
+static inline int sensors_control_open(const struct hw_module_t* module, 
+        struct sensors_control_device_t** device) {
+    return module->methods->open(module, 
+            SENSORS_HARDWARE_CONTROL, (struct hw_device_t**)device);
+}
+
+static inline int sensors_control_close(struct sensors_control_device_t* device) {
+    return device->common.close(&device->common);
+}
+
+static inline int sensors_data_open(const struct hw_module_t* module, 
+        struct sensors_data_device_t** device) {
+    return module->methods->open(module, 
+            SENSORS_HARDWARE_DATA, (struct hw_device_t**)device);
+}
+
+static inline int sensors_data_close(struct sensors_data_device_t* device) {
+    return device->common.close(&device->common);
+}
+
 static inline int sensors_open(const struct hw_module_t* module,
         struct sensors_poll_device_t** device) {
     return module->methods->open(module,
diff -Nru a/hardware/libhardware_legacy/audio/Android.mk b/hardware/libhardware_legacy/audio/Android.mk
--- a/hardware/libhardware_legacy/audio/Android.mk	2012-07-15 20:29:37.987783310 +0900
+++ b/hardware/libhardware_legacy/audio/Android.mk	2012-07-15 12:52:36.334116418 +0900
@@ -7,6 +7,24 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := \
+    audio_hw_hal.cpp
+
+LOCAL_CFLAGS += -DAUDIO_DECKARD
+ifeq ($(BOARD_HAVE_BLUETOOTH),true)
+  LOCAL_CFLAGS += -DWITH_A2DP
+endif
+
+LOCAL_MODULE := audio.primary.deckard
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+LOCAL_SHARED_LIBRARIES := libutils libaudio
+LOCAL_MODULE_TAGS := optional
+LOCAL_STATIC_LIBRARIES := libmedia_helper
+
+include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
     AudioHardwareInterface.cpp \
     audio_hw_hal.cpp
 
diff -Nru a/hardware/libhardware_legacy/wifi/wifi.c b/hardware/libhardware_legacy/wifi/wifi.c
--- a/hardware/libhardware_legacy/wifi/wifi.c	2012-07-15 20:29:38.023801309 +0900
+++ b/hardware/libhardware_legacy/wifi/wifi.c	2012-07-12 02:42:19.897305895 +0900
@@ -89,10 +89,12 @@
 
 #define WIFI_DRIVER_LOADER_DELAY	1000000
 
+static const char WLAN0_DEVICE[]         = "/sys/devices/platform/msm_sdcc.1/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/net/wlan0/wireless/status";
+
 static const char IFACE_DIR[]           = "/data/system/wpa_supplicant";
 #ifdef WIFI_DRIVER_MODULE_PATH
 static const char DRIVER_MODULE_NAME[]  = WIFI_DRIVER_MODULE_NAME;
-static const char DRIVER_MODULE_TAG[]   = WIFI_DRIVER_MODULE_NAME " ";
+static const char DRIVER_MODULE_TAG[]   = WIFI_DRIVER_MODULE_NAME;
 static const char DRIVER_MODULE_PATH[]  = WIFI_DRIVER_MODULE_PATH;
 static const char DRIVER_MODULE_ARG[]   = WIFI_DRIVER_MODULE_ARG;
 #endif
@@ -131,38 +133,53 @@
 
 static int insmod(const char *filename, const char *args)
 {
-    void *module;
-    unsigned int size;
     int ret;
+    char command0[]="echo 0 > /sys/devices/platform/bwpm/wifi";
+    char command1[]="echo 0 > /sys/bus/platform/drivers/msm_sdcc/msm_sdcc.1/polling";
+    char command2[]="echo 1 > /sys/devices/platform/bwpm/wifi";
+    char command3[]="echo 1 > /sys/bus/platform/drivers/msm_sdcc/msm_sdcc.1/polling";
+
+    sched_yield();
+    ret=system(command0);
+    sched_yield();
+    ret=system(command1);
+    sched_yield();
+    usleep(1000000);
+    ret=system(command2);
+    sched_yield();
+    ret=system(command3);
+    sched_yield();
+    usleep(10000000);
 
-    module = load_file(filename, &size);
-    if (!module)
-        return -1;
-
-    ret = init_module(module, size, args);
-
-    free(module);
-
-    return ret;
-}
-
-static int rmmod(const char *modname)
-{
-    int ret = -1;
     int maxtry = 10;
-
+    char text[256];
     while (maxtry-- > 0) {
-        ret = delete_module(modname, O_NONBLOCK | O_EXCL);
-        if (ret < 0 && errno == EAGAIN)
-            usleep(500000);
-        else
-            break;
+        if (access(WLAN0_DEVICE, R_OK) == 0) {
+            FILE *fp;
+            if ((fp = fopen(WLAN0_DEVICE, "r")) != NULL ) {
+                fgets(text, 256, fp);
+                fclose(fp);
+                if (strncmp(text, "0x0", 3) == 0) return 0;
+            }
+        } else {
+            ret=system(command0);
+            sched_yield();
+            ret=system(command1);
+            sched_yield();
+            usleep(1000000);
+            ret=system(command2);
+            sched_yield();
+            ret=system(command3);
+            sched_yield();
+            usleep(10000000);
+        }
     }
+    return -1;
+}
 
-    if (ret != 0)
-        ALOGD("Unable to unload driver module \"%s\": %s\n",
-             modname, strerror(errno));
-    return ret;
+static int rmmod(const char *modname)
+{
+    return 0;
 }
 
 int do_dhcp_request(int *ipaddr, int *gateway, int *mask,
diff -Nru a/hardware/msm7k/Android.mk b/hardware/msm7k/Android.mk
--- a/hardware/msm7k/Android.mk	2012-07-15 20:29:38.175877302 +0900
+++ b/hardware/msm7k/Android.mk	2012-07-12 02:42:19.889305896 +0900
@@ -14,9 +14,9 @@
 # limitations under the License.
 #
 
-common_msm_dirs := libcopybit liblights libopencorehw librpc libstagefrighthw
+common_msm_dirs := liblights libopencorehw librpc libstagefrighthw
 msm7k_dirs := $(common_msm_dirs) boot libgralloc libaudio
-qsd8k_dirs := $(common_msm_dirs) libgralloc-qsd8k libaudio-qsd8k dspcrashd
+qsd8k_dirs := $(common_msm_dirs) dspcrashd
 msm7x30_dirs := liblights libgralloc-qsd8k librpc libaudio-qdsp5v2
 
 ifeq ($(TARGET_BOARD_PLATFORM),msm7k)
diff -Nru a/packages/apps/Launcher2/res/xml/default_workspace.xml b/packages/apps/Launcher2/res/xml/default_workspace.xml
--- a/packages/apps/Launcher2/res/xml/default_workspace.xml	2012-07-15 20:29:55.152439593 +0900
+++ b/packages/apps/Launcher2/res/xml/default_workspace.xml	2012-07-12 02:42:19.905305895 +0900
@@ -22,7 +22,7 @@
         launcher:packageName="com.android.settings"
         launcher:className="com.android.settings.widget.SettingsAppWidgetProvider"
         launcher:screen="1"
-        launcher:x="0"
+        launcher:x="1"
         launcher:y="3"
         launcher:spanX="4"
         launcher:spanY="1" />
@@ -32,7 +32,7 @@
         launcher:packageName="com.android.deskclock"
         launcher:className="com.android.alarmclock.AnalogAppWidgetProvider"
         launcher:screen="2"
-        launcher:x="1"
+        launcher:x="2"
         launcher:y="0"
         launcher:spanX="2"
         launcher:spanY="2" />
@@ -48,13 +48,13 @@
         launcher:packageName="com.android.gallery3d"
         launcher:className="com.android.gallery3d.app.Gallery"
         launcher:screen="3"
-        launcher:x="1"
+        launcher:x="2"
         launcher:y="3" />
     <favorite
         launcher:packageName="com.android.settings"
         launcher:className="com.android.settings.Settings"
         launcher:screen="3"
-        launcher:x="2"
+        launcher:x="3"
         launcher:y="3" />
 
     <!-- Far-right screen [4] -->
diff -Nru a/packages/apps/Settings/res/values/strings.xml b/packages/apps/Settings/res/values/strings.xml
--- a/packages/apps/Settings/res/values/strings.xml	2012-07-15 20:30:02.280439295 +0900
+++ b/packages/apps/Settings/res/values/strings.xml	2012-07-12 02:42:19.901305895 +0900
@@ -3749,6 +3749,16 @@
     <!-- UI debug setting: profile hardware acceleration summary [CHAR LIMIT=50] -->
     <string name="track_frame_time_summary">Measure rendering time in adb shell dumpsys gfxinfo</string>
 
+    <!-- UI debug setting: force phone ui  [CHAR LIMIT=25] -->
+    <string name="force_phone_ui">Force Phone UI</string>
+    <!-- UI debug setting: force phone ui summary [CHAR LIMIT=50] -->
+    <string name="force_phone_ui_summary">Use Phone UI</string>
+
+    <!-- UI debug setting: show navigation bar at phone ui?  [CHAR LIMIT=25] -->
+    <string name="show_navigation_bar">Navigation bar</string>
+    <!-- UI debug setting: show navigation bar summary [CHAR LIMIT=50] -->
+    <string name="show_navigation_bar_summary">Show Navigation bar at Phone UI</string>
+
     <!-- UI debug setting: scaling factor for window animations [CHAR LIMIT=25] -->
     <string name="window_animation_scale_title">Window animation scale</string>
 
diff -Nru a/packages/apps/Settings/res/values-en-rGB/strings.xml b/packages/apps/Settings/res/values-en-rGB/strings.xml
--- a/packages/apps/Settings/res/values-en-rGB/strings.xml	2012-07-15 20:30:02.000439306 +0900
+++ b/packages/apps/Settings/res/values-en-rGB/strings.xml	2012-07-12 02:42:19.901305895 +0900
@@ -1557,6 +1557,10 @@
     <string name="force_hw_ui_summary" msgid="5535991166074861515">"Force use of GPU for 2d drawing"</string>
     <string name="track_frame_time" msgid="6146354853663863443">"Profile GPU rendering"</string>
     <string name="track_frame_time_summary" msgid="447577515813970287">"Measure rendering time in adb shell dumpsys gfxinfo"</string>
+    <string name="force_phone_ui" msgid="6426383462520888742">"Force Phone UI"</string>
+    <string name="force_phone_ui_summary" msgid="8642000962902609986">"Use Phone UI"</string>
+    <string name="show_navigation_bar" msgid="6426383462520888752">"Navigation bar"</string>
+    <string name="show_navigation_bar_summary" msgid="8642000962902609996">"Show Navigation bar at Phone UI"</string>
     <string name="window_animation_scale_title" msgid="6162587588166114700">"Window animation scale"</string>
     <string name="transition_animation_scale_title" msgid="387527540523595875">"Transition animation scale"</string>
     <string name="animator_duration_scale_title" msgid="3406722410819934083">"Animator duration scale"</string>
diff -Nru a/packages/apps/Settings/res/values-ja/strings.xml b/packages/apps/Settings/res/values-ja/strings.xml
--- a/packages/apps/Settings/res/values-ja/strings.xml	2012-07-15 20:30:02.120439301 +0900
+++ b/packages/apps/Settings/res/values-ja/strings.xml	2012-07-12 02:42:19.905305895 +0900
@@ -1559,6 +1559,10 @@
     <string name="force_hw_ui_summary" msgid="5535991166074861515">"2D描画にGPUを常に使用する"</string>
     <string name="track_frame_time" msgid="6146354853663863443">"GPUレンダリングのプロフィール作成"</string>
     <string name="track_frame_time_summary" msgid="447577515813970287">"adb shell dumpsys gfxinfoでレンダリング時間を測定"</string>
+    <string name="force_phone_ui" msgid="6426383462520888742">"Phone UI を使用"</string>
+    <string name="force_phone_ui_summary" msgid="8642000962902609986">"強制的に Phone UI を使用する"</string>
+    <string name="show_navigation_bar" msgid="6426383462520888752">"ナビゲーションバー"</string>
+    <string name="show_navigation_bar_summary" msgid="8642000962902609996">"Phone UIでナビゲーションバーを使用する"</string>
     <string name="window_animation_scale_title" msgid="6162587588166114700">"ウィンドウアニメスケール"</string>
     <string name="transition_animation_scale_title" msgid="387527540523595875">"トランジションアニメスケール"</string>
     <string name="animator_duration_scale_title" msgid="3406722410819934083">"Animator再生時間スケール"</string>
diff -Nru a/packages/apps/Settings/res/xml/development_prefs.xml b/packages/apps/Settings/res/xml/development_prefs.xml
--- a/packages/apps/Settings/res/xml/development_prefs.xml	2012-07-15 20:30:02.292439294 +0900
+++ b/packages/apps/Settings/res/xml/development_prefs.xml	2012-07-12 02:42:19.905305895 +0900
@@ -80,6 +80,18 @@
             android:title="@string/pointer_location"
             android:summary="@string/pointer_location_summary"/>
 
+        <CheckBoxPreference
+            android:key="force_phone_ui"
+            android:title="@string/force_phone_ui"
+            android:summary="@string/force_phone_ui_summary"/>
+
+	<CheckBoxPreference
+	    android:key="show_navigation_bar"
+	    android:dependency="force_phone_ui"
+	    android:layout="?android:attr/preferenceLayoutChild"
+	    android:title="@string/show_navigation_bar"
+	    android:summary="@string/show_navigation_bar_summary" />
+
     </PreferenceCategory>
 
     <PreferenceCategory android:key="debug_drawing_category"
diff -Nru a/packages/apps/Settings/src/com/android/settings/DevelopmentSettings.java b/packages/apps/Settings/src/com/android/settings/DevelopmentSettings.java
--- a/packages/apps/Settings/src/com/android/settings/DevelopmentSettings.java	2012-07-15 20:30:02.428439288 +0900
+++ b/packages/apps/Settings/src/com/android/settings/DevelopmentSettings.java	2012-07-12 02:42:19.901305895 +0900
@@ -79,6 +79,8 @@
     private static final String ENFORCE_READ_EXTERNAL = "enforce_read_external";
     private static final String LOCAL_BACKUP_PASSWORD = "local_backup_password";
     private static final String HARDWARE_UI_PROPERTY = "persist.sys.ui.hw";
+    private static final String PHONE_UI_PROPERTY = "persist.sys.lcd_density";
+    private static final String PHONE_UI_NAVBAR = "persist.sys.mainkeys";
 
     private static final String DEBUG_APP_KEY = "debug_app";
     private static final String WAIT_FOR_DEBUGGER_KEY = "wait_for_debugger";
@@ -92,6 +94,8 @@
     private static final String TRACK_FRAME_TIME_KEY = "track_frame_time";
     private static final String SHOW_HW_SCREEN_UPDATES_KEY = "show_hw_screen_udpates";
     private static final String DEBUG_LAYOUT_KEY = "debug_layout";
+    private static final String FORCE_PHONE_UI_KEY = "force_phone_ui";
+    private static final String SHOW_NAV_BAR_KEY = "show_navigation_bar";
     private static final String WINDOW_ANIMATION_SCALE_KEY = "window_animation_scale";
     private static final String TRANSITION_ANIMATION_SCALE_KEY = "transition_animation_scale";
     private static final String ANIMATOR_DURATION_SCALE_KEY = "animator_duration_scale";
diff -Nru a/system/core/include/system/window.h b/system/core/include/system/window.h
--- a/system/core/include/system/window.h	2012-07-15 20:31:48.448434854 +0900
+++ b/system/core/include/system/window.h	2012-07-12 02:42:19.889305896 +0900
@@ -23,6 +23,10 @@
 #include <system/graphics.h>
 #include <cutils/native_handle.h>
 
+#ifdef __cplusplus
+#include <string.h>
+#endif
+
 __BEGIN_DECLS
 
 /*****************************************************************************/
diff -Nru a/system/core/mkbootimg/mkbootimg.c b/system/core/mkbootimg/mkbootimg.c
--- a/system/core/mkbootimg/mkbootimg.c	2012-07-15 20:31:48.512434852 +0900
+++ b/system/core/mkbootimg/mkbootimg.c	2012-07-12 02:42:19.885305896 +0900
@@ -142,7 +142,7 @@
         } else if(!strcmp(arg, "--base")) {
             unsigned base = strtoul(val, 0, 16);
             hdr.kernel_addr =  base + 0x00008000;
-            hdr.ramdisk_addr = base + 0x01000000;
+            hdr.ramdisk_addr = base + 0x04000000;
             hdr.second_addr =  base + 0x00F00000;
             hdr.tags_addr =    base + 0x00000100;
         } else if(!strcmp(arg, "--board")) {
@@ -236,10 +236,10 @@
     }
 
     if(write(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) goto fail;
-    if(write_padding(fd, pagesize, sizeof(hdr))) goto fail;
+    if(write_padding(fd, pagesize*2, sizeof(hdr))) goto fail;
 
     if(write(fd, kernel_data, hdr.kernel_size) != hdr.kernel_size) goto fail;
-    if(write_padding(fd, pagesize, hdr.kernel_size)) goto fail;
+    if(write_padding(fd, pagesize*2, hdr.kernel_size)) goto fail;
 
     if(write(fd, ramdisk_data, hdr.ramdisk_size) != hdr.ramdisk_size) goto fail;
     if(write_padding(fd, pagesize, hdr.ramdisk_size)) goto fail;
diff -Nru a/system/core/rootdir/init.rc b/system/core/rootdir/init.rc
--- a/system/core/rootdir/init.rc	2012-07-15 20:31:48.516434851 +0900
+++ b/system/core/rootdir/init.rc	2012-07-15 20:36:43.472422516 +0900
@@ -17,6 +17,11 @@
 # create mountpoints
     mkdir /mnt 0775 root system
 
+    export EXTERNAL_STORAGE /mnt/sdcard
+    mkdir /mnt/sdcard 0000 system system
+    # for backwards compatibility
+    symlink /mnt/sdcard /sdcard
+
 on init
 
 sysclktz 0
@@ -116,10 +121,136 @@
 on fs
 # mount mtd partitions
     # Mount /system rw first to give the filesystem a chance to save a checkpoint
-    mount yaffs2 mtd@system /system
-    mount yaffs2 mtd@system /system ro remount
-    mount yaffs2 mtd@userdata /data nosuid nodev
-    mount yaffs2 mtd@cache /cache nosuid nodev
+    mkdir /host_system
+    mount yaffs2 mtd@system /host_system
+    mount yaffs2 mtd@system /host_system ro remount
+    mkdir /host_data 0771 root system
+    mount ext3 /dev/block/mmcblk0p1 /host_data nosuid nodev
+    chown root system /host_data
+    chmod 0771 /host_data
+    chown root system /host_data/guest
+    chmod 0771 /host_data/guest
+#    mount yaffs2 mtd@system /system
+    mount ext4 loop@/host_data/guest/system.ext4 /system
+    symlink /host_system/bin/akmd2 /system/bin/akmd2
+    symlink /host_system/bin/mediayamahaserver /system/bin/mediayamahaserver
+    symlink /host_system/bin/medousa /system/bin/medousa
+    symlink /host_system/bin/shdisp_process /system/bin/shdisp_process
+    symlink /host_system/bin/shlcdc_process /system/bin/shlcdc_process
+    symlink /host_system/bin/shsd_process /system/bin/shsd_process
+    symlink /host_system/bin/synergy_service /system/bin/synergy_service
+    symlink /host_system/bin/synergy_wifi_attach /system/bin/synergy_wifi_attach
+    symlink /host_system/bin/unififw /system/bin/unififw
+    mkdir /system/etc/firmware
+    symlink /host_system/etc/firmware/unifi-sdio-1 /system/etc/firmware/unifi-sdio-1
+    symlink /host_system/etc/gps.conf /system/etc/gps.conf
+    symlink /host_system/etc/yamaha /system/etc/yamaha
+    symlink /host_system/etc/AudioFilter.csv /system/etc/AudioFilter.csv
+    symlink /host_system/lib/hw/sensors.default.so /system/lib/hw/sensors.default.so
+    symlink /host_system/lib/libOmxAacDec.so /system/lib/libOmxAacDec.so
+    symlink /host_system/lib/libOmxAacEnc.so /system/lib/libOmxAacEnc.so
+    symlink /host_system/lib/libOmxCore.so /system/lib/libOmxCore.so
+    symlink /host_system/lib/libOmxEvrcDec.so /system/lib/libOmxEvrcDec.so
+    symlink /host_system/lib/libOmxMp3Dec.so /system/lib/libOmxMp3Dec.so
+    symlink /host_system/lib/libOmxQcelp13Dec.so /system/lib/libOmxQcelp13Dec.so
+    symlink /host_system/lib/libOmxQcelp13Enc.so /system/lib/libOmxQcelp13Enc.so
+    symlink /host_system/lib/libOmxVdec.so /system/lib/libOmxVdec.so
+    symlink /host_system/lib/libOmxVidEnc.so /system/lib/libOmxVidEnc.so
+    symlink /host_system/lib/libYamahaKill.so /system/lib/libYamahaKill.so
+    symlink /host_system/lib/libaudio.so /system/lib/libaudio.so
+    symlink /host_system/lib/libaudioyamaha.so /system/lib/libaudioyamaha.so
+    symlink /host_system/lib/libbattlog.so /system/lib/libbattlog.so
+    symlink /host_system/lib/libcommondefs.so /system/lib/libcommondefs.so
+    symlink /host_system/lib/libdiag.so /system/lib/libdiag.so
+    symlink /host_system/lib/libdsm.so /system/lib/libdsm.so
+    symlink /host_system/lib/libloc_api.so /system/lib/libloc_api.so
+    symlink /host_system/lib/libloc_api-rpc.so /system/lib/libloc_api-rpc.so
+    symlink /host_system/lib/libmediayamaha.so /system/lib/libmediayamaha.so
+    symlink /host_system/lib/libmediayamahacheck.so /system/lib/libmediayamahacheck.so
+    symlink /host_system/lib/libmediayamahaservice.so /system/lib/libmediayamahaservice.so
+    symlink /host_system/lib/libmediayamahasmw.so /system/lib/libmediayamahasmw.so
+    symlink /host_system/lib/libmediayamahautils.so /system/lib/libmediayamahautils.so
+    symlink /host_system/lib/libmm-omxcore.so /system/lib/libmm-omxcore.so
+    symlink /host_system/lib/libnv.so /system/lib/libnv.so
+    symlink /host_system/lib/libomx_aacdec_sharedlibrary.so /system/lib/libomx_aacdec_sharedlibrary.so
+    symlink /host_system/lib/libomx_amrdec_sharedlibrary.so /system/lib/libomx_amrdec_sharedlibrary.so
+    symlink /host_system/lib/libomx_amrenc_sharedlibrary.so /system/lib/libomx_amrenc_sharedlibrary.so
+    symlink /host_system/lib/libomx_avcdec_sharedlibrary.so /system/lib/libomx_avcdec_sharedlibrary.so
+    symlink /host_system/lib/libomx_m4vdec_sharedlibrary.so /system/lib/libomx_m4vdec_sharedlibrary.so
+    symlink /host_system/lib/libomx_mp3dec_sharedlibrary.so /system/lib/libomx_mp3dec_sharedlibrary.so
+    symlink /host_system/lib/libomx_sharedlibrary.so /system/lib/libomx_sharedlibrary.so
+    symlink /host_system/lib/libomx_sharedlibrary_qc.so /system/lib/libomx_sharedlibrary_qc.so
+    symlink /host_system/lib/libomx_wmadec_sharedlibrary.so /system/lib/libomx_wmadec_sharedlibrary.so
+    symlink /host_system/lib/libomx_wmvdec_sharedlibrary.so /system/lib/libomx_wmvdec_sharedlibrary.so
+    symlink /host_system/lib/liboncrpc.so /system/lib/liboncrpc.so
+    symlink /host_system/lib/libqueue.so /system/lib/libqueue.so
+    symlink /host_system/lib/libshdisp.so /system/lib/libshdisp.so
+    symlink /host_system/lib/libshkbd.so /system/lib/libshkbd.so
+    symlink /host_system/lib/libshlcdc.so /system/lib/libshlcdc.so
+    symlink /host_system/lib/libshsd.so /system/lib/libshsd.so
+    symlink /host_system/lib/libshspamp.so /system/lib/libshspamp.so
+    symlink /host_system/lib/libshtimer.so /system/lib/libshtimer.so
+    symlink /host_system/lib/libshtps.so /system/lib/libshtps.so
+    symlink /host_system/lib/libshvibrator.so /system/lib/libshvibrator.so
+    symlink /host_system/lib/libsynergy_com.so /system/lib/libsynergy_com.so
+    symlink /host_system/lib/libsynergy_liba2dp.so /system/lib/libsynergy_liba2dp.so
+    rm /system/app/Calendar.apk
+    rm /system/app/CalendarProvider.apk
+    rm /system/app/Gallery2.apk
+    rm /system/app/PinyinIME.apk
+    rm /system/app/Provision.apk
+    rm /system/app/QuickSearchBox.apk
+    symlink /host_data/guest/gapps/system/app/CalendarGoogle.apk /system/app/CalendarGoogle.apk
+    symlink /host_data/guest/gapps/system/app/CalendarProvider.apk /system/app/CalendarProvider.apk
+    symlink /host_data/guest/gapps/system/app/CarHomeGoogle.apk /system/app/CarHomeGoogle.apk
+    symlink /host_data/guest/gapps/system/app/ChromeBookmarksSyncAdapter.apk /system/app/ChromeBookmarksSyncAdapter.apk
+    symlink /host_data/guest/gapps/system/app/FaceLock.apk /system/app/FaceLock.apk
+    symlink /host_data/guest/gapps/system/app/GalleryGoogle.apk /system/app/GalleryGoogle.apk
+    symlink /host_data/guest/gapps/system/app/GenieWidget.apk /system/app/GenieWidget.apk
+    symlink /host_data/guest/gapps/system/app/Gmail.apk /system/app/Gmail.apk
+    symlink /host_data/guest/gapps/system/app/GoogleBackupTransport.apk /system/app/GoogleBackupTransport.apk
+    symlink /host_data/guest/gapps/system/app/GoogleContactsSyncAdapter.apk /system/app/GoogleContactsSyncAdapter.apk
+    symlink /host_data/guest/gapps/system/app/GoogleFeedback.apk /system/app/GoogleFeedback.apk
+    symlink /host_data/guest/gapps/system/app/GoogleLoginService.apk /system/app/GoogleLoginService.apk
+    symlink /host_data/guest/gapps/system/app/GooglePartnerSetup.apk /system/app/GooglePartnerSetup.apk
+    symlink /host_data/guest/gapps/system/app/GoogleQuickSearchBox.apk /system/app/GoogleQuickSearchBox.apk
+    symlink /host_data/guest/gapps/system/app/GoogleServicesFramework.apk /system/app/GoogleServicesFramework.apk
+    symlink /host_data/guest/gapps/system/app/MarketUpdater.apk /system/app/MarketUpdater.apk
+    symlink /host_data/guest/gapps/system/app/MediaUploader.apk /system/app/MediaUploader.apk
+    symlink /host_data/guest/gapps/system/app/NetworkLocation.apk /system/app/NetworkLocation.apk
+    symlink /host_data/guest/gapps/system/app/OneTimeInitializer.apk /system/app/OneTimeInitializer.apk
+    symlink /host_data/guest/gapps/system/app/SetupWizard.apk /system/app/SetupWizard.apk
+    symlink /host_data/guest/gapps/system/app/Talk.apk /system/app/Talk.apk
+    symlink /host_data/guest/gapps/system/app/Vending.apk /system/app/Vending.apk
+    symlink /host_data/guest/gapps/system/app/VoiceSearch.apk /system/app/VoiceSearch.apk
+    symlink /host_data/guest/gapps/system/app/YouTube.apk /system/app/YouTube.apk
+    symlink /host_data/guest/gapps/system/etc/permissions/com.google.android.maps.xml /system/etc/permissions/com.google.android.maps.xml
+    symlink /host_data/guest/gapps/system/etc/permissions/com.google.android.media.effects.xml /system/etc/permissions/com.google.android.media.effects.xml
+    symlink /host_data/guest/gapps/system/etc/permissions/com.google.android.nfc_extras.xml /system/etc/permissions/com.google.android.nfc_extras.xml
+    symlink /host_data/guest/gapps/system/etc/permissions/com.google.widevine.software.drm.xml /system/etc/permissions/com.google.widevine.software.drm.xml
+    symlink /host_data/guest/gapps/system/etc/permissions/features.xml /system/etc/permissions/features.xml
+    symlink /host_data/guest/gapps/system/framework/com.google.android.maps.jar /system/framework/com.google.android.maps.jar
+    symlink /host_data/guest/gapps/system/framework/com.google.android.media.effects.jar /system/framework/com.google.android.media.effects.jar
+    symlink /host_data/guest/gapps/system/framework/com.google.widevine.software.drm.jar /system/framework/com.google.widevine.software.drm.jar
+    symlink /host_data/guest/gapps/system/lib/libfacelock_jni.so /system/lib/libfacelock_jni.so
+    symlink /host_data/guest/gapps/system/lib/libfilterpack_facedetect.so /system/lib/libfilterpack_facedetect.so
+    symlink /host_data/guest/gapps/system/lib/libfrsdk.so /system/lib/libfrsdk.so
+    symlink /host_data/guest/gapps/system/lib/libspeexwrapper.so /system/lib/libspeexwrapper.so
+    symlink /host_data/guest/gapps/system/lib/libvideochat_jni.so /system/lib/libvideochat_jni.so
+    symlink /host_data/guest/gapps/system/lib/libvideochat_stabilize.so /system/lib/libvideochat_stabilize.so
+    symlink /host_data/guest/gapps/system/lib/libvoicesearch.so /system/lib/libvoicesearch.so
+#    mount yaffs2 mtd@system /system ro remount
+    mount ext4 loop@/host_data/guest/system.ext4 /system ro remount
+#    mount yaffs2 mtd@userdata /data nosuid nodev
+    rmdir /data
+    symlink /host_data/guest/data /data
+    chown system system /host_data/guest/data
+    chmod 0771 /host_data/guest/data
+#    mount yaffs2 mtd@cache /cache nosuid nodev
+    rmdir /cache
+    symlink /host_data/guest/cache /cache
+    chown system cache /host_data/guest/cache
+    chmod 0770 /host_data/guest/cache
 
 on post-fs
     # once everything is setup, no need to modify /
@@ -178,6 +309,10 @@
     # give system access to wpa_supplicant.conf for backup and restore
     mkdir /data/misc/wifi 0770 wifi wifi
     chmod 0660 /data/misc/wifi/wpa_supplicant.conf
+    mkdir /data/misc/wifi/sockets 0770 wifi wifi
+    mkdir /data/misc/dhcp 0770 dhcp dhcp
+    chown dhcp dhcp /data/misc/dhcp
+    chown system system /sys/bus/platform/devices/msm_sdcc.1/polling
     mkdir /data/local 0751 root root
 
     # For security reasons, /data/local/tmp should always be empty.
@@ -221,6 +356,9 @@
 # set RLIMIT_NICE to allow priorities from 19 to -20
     setrlimit 13 40 40
 
+# set RLIMIT_MEMLOCK to 64MB
+    setrlimit 8 67108864 67108864
+
 # Memory management.  Basic kernel parameters, and allow the high
 # level system server to be able to adjust the kernel OOM driver
 # parameters to match how it is managing things.
@@ -309,6 +447,8 @@
 # Set this property so surfaceflinger is not started by system_init
     setprop system_init.startsurfaceflinger 0
 
+    insmod /system/lib/modules/unifi_sdio.ko
+
     class_start core
     class_start main
 
@@ -357,7 +497,7 @@
 # adbd is controlled via property triggers in init.<platform>.usb.rc
 service adbd /sbin/adbd
     class core
-    disabled
+#    disabled
 
 # adbd on at boot in emulator
 on property:ro.kernel.qemu=1
@@ -419,6 +559,11 @@
     group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc
     ioprio rt 4
 
+service mediayamaha /system/bin/mediayamahaserver
+    class main
+    user media
+    group system audio camera inet net_bt net_bt_admin
+
 service bootanim /system/bin/bootanimation
     class main
     user graphics
@@ -488,3 +633,40 @@
     socket mdnsd stream 0660 mdnsr inet
     disabled
     oneshot
+
+service akmd2 /system/bin/akmd2
+    class main
+
+service shlcdc_process /system/bin/shlcdc_process
+    class main
+
+service shdisp_process /system/bin/shdisp_process
+    class main
+
+service shsd_process /system/bin/shsd_process
+    class main
+
+service medousa /system/bin/medousa
+    class main
+    group sdcard_rw
+
+service synergy_service /system/bin/synergy_service -C /dev/ttyHS0 -U 4000000
+    class main
+    oneshot
+
+service wpa_supplicant /system/bin/wpa_supplicant \
+    -Dwext -iwlan0 -C/data/misc/wifi/sockets
+    class main
+    socket wpa_wlan0 dgram 660 wifi wifi
+    disabled
+    oneshot
+
+service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
+    class main
+    disabled
+    oneshot
+
+service iprenew_wlan0 /system/bin/dhcpcd -n
+    class main
+    disabled
+    oneshot
diff -Nru a/system/core/rootdir/init.usb.rc b/system/core/rootdir/init.usb.rc
--- a/system/core/rootdir/init.usb.rc	2012-07-15 20:31:48.524434851 +0900
+++ b/system/core/rootdir/init.usb.rc	2012-07-12 02:42:19.889305896 +0900
@@ -10,11 +10,11 @@
     chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
 
 # Used to disable USB when switching states
-on property:sys.usb.config=none
-    stop adbd
-    write /sys/class/android_usb/android0/enable 0
-    write /sys/class/android_usb/android0/bDeviceClass 0
-    setprop sys.usb.state ${sys.usb.config}
+#on property:sys.usb.config=none
+#    stop adbd
+#    write /sys/class/android_usb/android0/enable 0
+#    write /sys/class/android_usb/android0/bDeviceClass 0
+#    setprop sys.usb.state ${sys.usb.config}
 
 # adb only USB configuration
 # This should only be used during device bringup
diff -Nru a/system/core/rootdir/ueventd.rc b/system/core/rootdir/ueventd.rc
--- a/system/core/rootdir/ueventd.rc	2012-07-15 20:31:48.524434851 +0900
+++ b/system/core/rootdir/ueventd.rc	2012-07-12 02:42:19.889305896 +0900
@@ -16,7 +16,8 @@
 /dev/msm_hw3dc            0666   root       root
 
 # gpu driver for adreno200 is globally accessible
-/dev/kgsl                 0666   root       root
+/dev/kgsl-3d0             0666   root       root
+/dev/genlock              0666   root       root
 
 # these should not be world writable
 /dev/diag                 0660   radio      radio
@@ -30,7 +31,9 @@
 /dev/graphics/*           0660   root       graphics
 /dev/msm_hw3dm            0660   system     graphics
 /dev/input/*              0660   root       input
+/dev/i2c-0                0666   root       root
 /dev/eac                  0660   root       audio
+/dev/ae2                  0666   system     audio
 /dev/cam                  0660   root       camera
 /dev/pmem                 0660   system     graphics
 /dev/pmem_adsp*           0660   system     audio
@@ -44,6 +47,8 @@
 /dev/akm8976_aot          0640   compass    system
 /dev/akm8973_daemon       0640   compass    system
 /dev/akm8973_aot          0640   compass    system
+/dev/akm8973_dev          0640   compass    system
+/dev/smb380_dev           0640   compass    system
 /dev/bma150               0640   compass    system
 /dev/cm3602               0640   compass    system
 /dev/akm8976_pffd         0640   compass    system
@@ -53,6 +58,12 @@
 /dev/msm_pcm_ctl*         0660   system     audio
 /dev/msm_snd*             0660   system     audio
 /dev/msm_mp3*             0660   system     audio
+/dev/msm_aac*             0660   system     audio
+/dev/msm_pcm*             0666   system     audio
+/dev/msm_voice            0666   system     audio
+/dev/msm_audio_dev_ctrl   0666   system     audio
+/dev/msm_qcelp_in         0660   system     audio
+/dev/msm_evrc_in          0660   system     audio
 /dev/audience_a1026*      0660   system     audio
 /dev/tpa2018d1*           0660   system     audio
 /dev/msm_audpre           0660   system     audio
diff -Nru a/system/extras/su/su.c b/system/extras/su/su.c
--- a/system/extras/su/su.c	2012-07-15 20:31:48.928434834 +0900
+++ b/system/extras/su/su.c	2012-07-12 02:42:19.885305896 +0900
@@ -48,7 +48,7 @@
     myuid = getuid();
     if (myuid != AID_ROOT && myuid != AID_SHELL) {
         fprintf(stderr,"su: uid %d not allowed to su\n", myuid);
-        return 1;
+//        return 1;
     }
 
     if(argc < 2) {
diff -Nru a/system/vold/DirectVolume.cpp b/system/vold/DirectVolume.cpp
--- a/system/vold/DirectVolume.cpp	2012-07-15 20:31:50.216434780 +0900
+++ b/system/vold/DirectVolume.cpp	2012-07-12 02:42:19.897305895 +0900
@@ -148,6 +148,9 @@
         mDiskNumParts = 1;
     }
 
+    if (strcmp(devpath, "/devices/virtual/block/stheno") == 0)
+        mDiskNumParts = 0;
+
     char msg[255];
 
     int partmask = 0;
