The CHEEK_TOUCH stuff never worked.  Remove it.

Bug: 3104906
Change-Id: Ia37236ba1775fc3ec8c111e2e0b85b105e0dea6a
diff --git a/core/java/android/os/LocalPowerManager.java b/core/java/android/os/LocalPowerManager.java
index d348f07..52df1f8 100644
--- a/core/java/android/os/LocalPowerManager.java
+++ b/core/java/android/os/LocalPowerManager.java
@@ -21,18 +21,13 @@
     // Note: be sure to update BatteryStats if adding or modifying event constants.
     
     public static final int OTHER_EVENT = 0;
-    public static final int CHEEK_EVENT = 1;
-    public static final int TOUCH_EVENT = 2;  // touch events are TOUCH for 300ms, and then either
-                                              // up events or LONG_TOUCH events.
-    public static final int LONG_TOUCH_EVENT = 3;
-    public static final int TOUCH_UP_EVENT = 4;
-    public static final int BUTTON_EVENT = 5;  // Button and trackball events.
+    public static final int BUTTON_EVENT = 1;
+    public static final int TOUCH_EVENT = 2;
 
-    public static final int POKE_LOCK_IGNORE_CHEEK_EVENTS = 0x1;
+    public static final int POKE_LOCK_IGNORE_TOUCH_EVENTS = 0x1;
+
     public static final int POKE_LOCK_SHORT_TIMEOUT = 0x2;
     public static final int POKE_LOCK_MEDIUM_TIMEOUT = 0x4;
-    public static final int POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS = 0x8;
-
     public static final int POKE_LOCK_TIMEOUT_MASK = 0x6;
 
     void goToSleep(long time);
diff --git a/include/ui/PowerManager.h b/include/ui/PowerManager.h
index 5434b4f..dd80318 100644
--- a/include/ui/PowerManager.h
+++ b/include/ui/PowerManager.h
@@ -22,14 +22,10 @@
 
 enum {
     POWER_MANAGER_OTHER_EVENT = 0,
-    POWER_MANAGER_CHEEK_EVENT = 1,
-    POWER_MANAGER_TOUCH_EVENT = 2, // touch events are TOUCH for 300ms, and then either
-                                   // up events or LONG_TOUCH events.
-    POWER_MANAGER_LONG_TOUCH_EVENT = 3,
-    POWER_MANAGER_TOUCH_UP_EVENT = 4,
-    POWER_MANAGER_BUTTON_EVENT = 5, // Button and trackball events.
+    POWER_MANAGER_BUTTON_EVENT = 1,
+    POWER_MANAGER_TOUCH_EVENT = 2,
 
-    POWER_MANAGER_LAST_EVENT = POWER_MANAGER_BUTTON_EVENT, // Last valid event code.
+    POWER_MANAGER_LAST_EVENT = POWER_MANAGER_TOUCH_EVENT, // Last valid event code.
 };
 
 } // namespace android
diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp
index 299b1ba..7ddb3c7 100644
--- a/libs/ui/InputDispatcher.cpp
+++ b/libs/ui/InputDispatcher.cpp
@@ -51,9 +51,6 @@
 
 namespace android {
 
-// Delay before reporting long touch events to the power manager.
-const nsecs_t LONG_TOUCH_DELAY = 300 * 1000000LL; // 300 ms
-
 // Default input dispatching timeout if there is no focused application or paused window
 // from which to determine an appropriate dispatching timeout.
 const nsecs_t DEFAULT_INPUT_DISPATCHING_TIMEOUT = 5000 * 1000000LL; // 5 sec
@@ -1416,21 +1413,7 @@
         }
 
         if (motionEntry->source & AINPUT_SOURCE_CLASS_POINTER) {
-            switch (motionEntry->action) {
-            case AMOTION_EVENT_ACTION_DOWN:
-                eventType = POWER_MANAGER_TOUCH_EVENT;
-                break;
-            case AMOTION_EVENT_ACTION_UP:
-                eventType = POWER_MANAGER_TOUCH_UP_EVENT;
-                break;
-            default:
-                if (motionEntry->eventTime - motionEntry->downTime < LONG_TOUCH_DELAY) {
-                    eventType = POWER_MANAGER_TOUCH_EVENT;
-                } else {
-                    eventType = POWER_MANAGER_LONG_TOUCH_EVENT;
-                }
-                break;
-            }
+            eventType = POWER_MANAGER_TOUCH_EVENT;
         }
         break;
     }
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 41cbbf4..caf6376 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -1175,10 +1175,8 @@
             pw.println("mPokeLocks.size=" + mPokeLocks.size() + ":");
             for (PokeLock p: mPokeLocks.values()) {
                 pw.println("    poke lock '" + p.tag + "':"
-                        + ((p.pokey & POKE_LOCK_IGNORE_CHEEK_EVENTS) != 0
-                                ? " POKE_LOCK_IGNORE_CHEEK_EVENTS" : "")
-                        + ((p.pokey & POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS) != 0
-                                ? " POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS" : "")
+                        + ((p.pokey & POKE_LOCK_IGNORE_TOUCH_EVENTS) != 0
+                                ? " POKE_LOCK_IGNORE_TOUCH_EVENTS" : "")
                         + ((p.pokey & POKE_LOCK_SHORT_TIMEOUT) != 0
                                 ? " POKE_LOCK_SHORT_TIMEOUT" : "")
                         + ((p.pokey & POKE_LOCK_MEDIUM_TIMEOUT) != 0
@@ -2218,31 +2216,13 @@
     private void userActivity(long time, long timeoutOverride, boolean noChangeLights,
             int eventType, boolean force) {
 
-        if (((mPokey & POKE_LOCK_IGNORE_CHEEK_EVENTS) != 0)
-                && (eventType == CHEEK_EVENT)) {
-            if (false) {
-                Slog.d(TAG, "dropping cheek event mPokey=0x" + Integer.toHexString(mPokey));
-            }
-            return;
-        }
-
-        if (((mPokey & POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS) != 0)
-                && (eventType == TOUCH_EVENT || eventType == TOUCH_UP_EVENT
-                    || eventType == LONG_TOUCH_EVENT || eventType == CHEEK_EVENT)) {
+        if (((mPokey & POKE_LOCK_IGNORE_TOUCH_EVENTS) != 0) && (eventType == TOUCH_EVENT)) {
             if (false) {
                 Slog.d(TAG, "dropping touch mPokey=0x" + Integer.toHexString(mPokey));
             }
             return;
         }
 
-        if (false) {
-            if (((mPokey & POKE_LOCK_IGNORE_CHEEK_EVENTS) != 0)) {
-                Slog.d(TAG, "userActivity !!!");//, new RuntimeException());
-            } else {
-                Slog.d(TAG, "mPokey=0x" + Integer.toHexString(mPokey));
-            }
-        }
-
         synchronized (mLocks) {
             if (mSpew) {
                 Slog.d(TAG, "userActivity mLastEventTime=" + mLastEventTime + " time=" + time
diff --git a/tests/StatusBar/src/com/android/statusbartest/PowerTest.java b/tests/StatusBar/src/com/android/statusbartest/PowerTest.java
index 178fa92..92d5bee 100644
--- a/tests/StatusBar/src/com/android/statusbartest/PowerTest.java
+++ b/tests/StatusBar/src/com/android/statusbartest/PowerTest.java
@@ -81,9 +81,9 @@
                 mProx.release(PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE);
             }
         },
-        new Test("Cheek events don't poke") {
+        new Test("Touch events don't poke") {
             public void run() {
-                mPokeState |= LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
+                mPokeState |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_EVENTS;
                 try {
                     mPowerManager.setPokeLock(mPokeState, mPokeToken, TAG);
                 } catch (RemoteException e) {
@@ -92,29 +92,9 @@
             }
         },
 
-        new Test("Cheek events poke") {
+        new Test("Touch events poke") {
             public void run() {
-                mPokeState &= ~LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
-                try {
-                    mPowerManager.setPokeLock(mPokeState, mPokeToken, TAG);
-                } catch (RemoteException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        },
-        new Test("Touch and Cheek events don't poke") {
-            public void run() {
-                mPokeState |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
-                try {
-                    mPowerManager.setPokeLock(mPokeState, mPokeToken, TAG);
-                } catch (RemoteException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        },
-        new Test("Touch and Cheek events poke") {
-            public void run() {
-                mPokeState &= ~LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
+                mPokeState &= ~LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_EVENTS;
                 try {
                     mPowerManager.setPokeLock(mPokeState, mPokeToken, TAG);
                 } catch (RemoteException e) {