diff --git a/power/power.c b/power/power.c
index 907726a..4c5ebd3 100644
--- a/power/power.c
+++ b/power/power.c
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2008 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.
+ */
 #include <hardware/power.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -15,21 +30,30 @@
 #define LOG_TAG "power"
 #include <utils/Log.h>
 
+#include "qemu.h"
+#ifdef QEMU_POWER
+#include "power_qemu.h"
+#endif
+
 enum {
     ACQUIRE_PARTIAL_WAKE_LOCK = 0,
-    ACQUIRE_FULL_WAKE_LOCK,
     RELEASE_WAKE_LOCK,
     REQUEST_STATE,
     OUR_FD_COUNT
 };
 
-const char * const PATHS[] = {
+const char * const OLD_PATHS[] = {
     "/sys/android_power/acquire_partial_wake_lock",
-    "/sys/android_power/acquire_full_wake_lock",
     "/sys/android_power/release_wake_lock",
     "/sys/android_power/request_state"
 };
 
+const char * const NEW_PATHS[] = {
+    "/sys/power/wake_lock",
+    "/sys/power/wake_unlock",
+    "/sys/power/state"
+};
+
 const char * const AUTO_OFF_TIMEOUT_DEV = "/sys/android_power/auto_off_timeout";
 
 const char * const LCD_BACKLIGHT = "/sys/class/leds/lcd-backlight/brightness";
@@ -41,6 +65,8 @@
 static int g_fds[OUR_FD_COUNT];
 static int g_error = 1;
 
+static const char *off_state = "mem";
+static const char *on_state = "on";
 
 static int64_t systemTime()
 {
@@ -50,21 +76,22 @@
     return t.tv_sec*1000000000LL + t.tv_nsec;
 }
 
-static void
-open_file_descriptors(void)
+static int
+open_file_descriptors(const char * const paths[])
 {
     int i;
     for (i=0; i<OUR_FD_COUNT; i++) {
-        int fd = open(PATHS[i], O_RDWR);
+        int fd = open(paths[i], O_RDWR);
         if (fd < 0) {
-            fprintf(stderr, "fatal error opening \"%s\"\n", PATHS[i]);
+            fprintf(stderr, "fatal error opening \"%s\"\n", paths[i]);
             g_error = errno;
-            return;
+            return -1;
         }
         g_fds[i] = fd;
     }
 
     g_error = 0;
+    return 0;
 }
 
 static inline void
@@ -74,7 +101,11 @@
     //pthread_once(&g_initialized, open_file_descriptors);
     // XXX: not this:
     if (g_initialized == 0) {
-        open_file_descriptors();
+        if(open_file_descriptors(NEW_PATHS) < 0) {
+            open_file_descriptors(OLD_PATHS);
+            on_state = "wake";
+            off_state = "standby";
+        }
         g_initialized = 1;
     }
 }
@@ -93,9 +124,6 @@
     if (lock == PARTIAL_WAKE_LOCK) {
         fd = g_fds[ACQUIRE_PARTIAL_WAKE_LOCK];
     }
-    else if (lock == FULL_WAKE_LOCK) {
-        fd = g_fds[ACQUIRE_FULL_WAKE_LOCK];
-    }
     else {
         return EINVAL;
     }
@@ -138,23 +166,29 @@
 set_a_light(const char* path, int value)
 {
     int fd;
+    static int already_warned = 0;
 
     // LOGI("set_a_light(%s, %d)\n", path, value);
 
     fd = open(path, O_RDWR);
-    if (fd) {
+    if (fd >= 0) {
         char    buffer[20];
         int bytes = sprintf(buffer, "%d\n", value);
         write(fd, buffer, bytes);
         close(fd);
     } else {
-        LOGE("set_a_light failed to open %s\n", path);
+        if (already_warned == 0) {
+            LOGE("set_a_light failed to open %s\n", path);
+            already_warned = 1;
+        }
     }
 }
 
 int
 set_light_brightness(unsigned int mask, unsigned int brightness)
 {
+    QEMU_FALLBACK(set_light_brightness(mask,brightness));
+
     initialize_fds();
 
 //    LOGI("set_light_brightness mask=0x%08x brightness=%d now=%lld g_error=%s\n",
@@ -179,6 +213,8 @@
 int
 set_screen_state(int on)
 {
+    QEMU_FALLBACK(set_screen_state(on));
+
     //LOGI("*** set_screen_state %d", on);
 
     initialize_fds();
@@ -191,14 +227,12 @@
     char buf[32];
     int len;
     if(on)
-        len = sprintf(buf, "wake");
+        len = sprintf(buf, on_state);
     else
-        len = sprintf(buf, "standby");
+        len = sprintf(buf, off_state);
     len = write(g_fds[REQUEST_STATE], buf, len);
     if(len < 0) {
         LOGE("Failed setting last user activity: g_error=%d\n", g_error);
     }
     return 0;
 }
-
-
