레이블이 wake up인 게시물을 표시합니다. 모든 게시물 표시
레이블이 wake up인 게시물을 표시합니다. 모든 게시물 표시

2017년 6월 27일 화요일

How to enable Touch Wake up.

I refer to this in the site.

http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3.4-DevKit-2.1_PortingGuides?TB_iframe=true


anroid-6.0.1_r67

frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java


    /** {@inheritDoc} */
    @Override
    public int interceptMotionBeforeQueueingNonInteractive(long whenNanos, int policyFlags) {
        if ((policyFlags & FLAG_WAKE) != 0) {
            if (wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotion,
                    "android.policy:MOTION")) {
                return 0;
            }
        }

        if (shouldDispatchInputWhenNonInteractive()) {
            return ACTION_PASS_TO_USER;
        }

        // If we have not passed the action up and we are in theater mode without dreaming,
        // there will be no dream to intercept the touch and wake into ambient.  The device should
        // wake up in this case.
        if (isTheaterModeEnabled() && (policyFlags & FLAG_WAKE) != 0) {
            wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotionWhenNotDreaming,
                    "android.policy:MOTION");
        }

        if (!mPowerManager.isInteractive()) {
            wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotion,
                    "android.policy:MOTION");
        }
        return 0;
    }


android-5.1.1_r38

--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -4943,6 +4943,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
             wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotionWhenNotDreaming);
         }

+        if (!mPowerManager.isInteractive()) {
+            wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotion);
+        }
+
         return 0;
     }

android-4.4.4_r2.0.1

diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 10323a4..b2da523 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -4176,6 +4176,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
         if (isWakeMotion) {
             result |= ACTION_WAKE_UP;
         }
+        if (!mPowerManager.isScreenOn())
+            mPowerManager.wakeUp(SystemClock.uptimeMillis());
         return result;
     }