Loading...
Index: mydroid/cdma-import/hardware/libhardware/power/power.c
==============================================================
=====
--- mydroid/cdma-import/hardware/libhardware/power/power.c          (revision 49)
+++ mydroid/cdma-import/hardware/libhardware/power/power.c            (revision 147)
@@ -180,13 +180,15 @@
set_screen_state(int on)
{
         //LOGI("*** set_screen_state %d", on);
+       if(!on)
+           return -EIO;

        initialize_fds();

        //LOGI("go_to_sleep eventTime=%lld now=%lld g_error=%s\n", eventTime,
           //        systemTime(), strerror(g_error));
-       if (g_error) return g_error;
+//        if (g_error) return g_error;

        char buf[32];
        int len;
@@ -197,6 +199,7 @@
        len = write(g_fds[REQUEST_STATE], buf, len);
        if(len < 0) {
             LOGE("Failed setting last user activity: g_error=%d\n", g_error);
+         return errno;
        }
        return 0;
}
Loading...