OSDN Git Service

make the mouse events wake event
authorYi Sun <beyounn@gmail.com>
Tue, 15 Dec 2009 07:41:42 +0000 (23:41 -0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 20 Dec 2010 07:35:56 +0000 (15:35 +0800)
phone/com/android/internal/policy/impl/PhoneWindowManager.java

index 265884c..90b2c4c 100755 (executable)
@@ -2032,14 +2032,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
     public boolean isWakeRelMovementTq(int device, int classes,
             RawInputEvent event) {
         // if it's tagged with one of the wake bits, it wakes up the device
-        return ((event.flags & (FLAG_WAKE | FLAG_WAKE_DROPPED)) != 0);
+        return (((classes & RawInputEvent.CLASS_MOUSE) != 0)||( (event.flags & (FLAG_WAKE | FLAG_WAKE_DROPPED)) != 0));
     }
 
     /** {@inheritDoc} */
     public boolean isWakeAbsMovementTq(int device, int classes,
             RawInputEvent event) {
         // if it's tagged with one of the wake bits, it wakes up the device
-        return ((event.flags & (FLAG_WAKE | FLAG_WAKE_DROPPED)) != 0);
+        return (((classes & RawInputEvent.CLASS_MOUSE) != 0) || (event.flags & (FLAG_WAKE | FLAG_WAKE_DROPPED)) != 0);
     }
 
     /**
@@ -2050,7 +2050,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
         // like to have pressing it wake the device up, so force it here.
         int keycode = event.keycode;
         int flags = event.flags;
-        if (keycode == RawInputEvent.BTN_MOUSE) {
+        int scancode = event.scancode;
+        if ((keycode == RawInputEvent.BTN_MOUSE)|| (scancode == RawInputEvent.BTN_MOUSE) ||
+                       (scancode == RawInputEvent.BTN_RIGHT)) {
             flags |= WindowManagerPolicy.FLAG_WAKE;
         }
         return (flags