diff options
author | Jeff Brown <jeffbrown@google.com> | 2014-02-26 18:48:51 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2014-02-26 18:49:36 -0800 |
commit | c5e2442e59c427a921139722a7431e412f359dd8 (patch) | |
tree | 5ca8da357b6617ba250c1a7e796c1a76201af030 /services/inputflinger/InputReader.cpp | |
parent | e4cf2f20dd10bfaf96d636bb5363aa25f8bc95ae (diff) | |
download | frameworks_native-c5e2442e59c427a921139722a7431e412f359dd8.zip frameworks_native-c5e2442e59c427a921139722a7431e412f359dd8.tar.gz frameworks_native-c5e2442e59c427a921139722a7431e412f359dd8.tar.bz2 |
Add touch.wake IDC property to control wakeup.
Normally we do not wake the device when the internal touch screen is
touched. This behavior can now be configured by setting a property
in the input device configuration file. Add the following line to
the IDC file to enable an initial touch to wake the device from sleep.
touch.wake = 1
Change-Id: Ifd6d4f51afacd30d85f475725a66e6fcccde9cbb
Diffstat (limited to 'services/inputflinger/InputReader.cpp')
-rw-r--r-- | services/inputflinger/InputReader.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp index 94e2a80..5eaf00b 100644 --- a/services/inputflinger/InputReader.cpp +++ b/services/inputflinger/InputReader.cpp @@ -2831,6 +2831,13 @@ void TouchInputMapper::configureParameters() { mParameters.deviceType == Parameters::DEVICE_TYPE_TOUCH_SCREEN && getDevice()->isExternal(); } + + // Initial downs on external touch devices should wake the device. + // Normally we don't do this for internal touch screens to prevent them from waking + // up in your pocket but you can enable it using the input device configuration. + mParameters.wake = getDevice()->isExternal(); + getDevice()->getConfiguration().tryGetProperty(String8("touch.wake"), + mParameters.wake); } void TouchInputMapper::dumpParameters(String8& dump) { @@ -3733,11 +3740,7 @@ void TouchInputMapper::sync(nsecs_t when) { getContext()->fadePointer(); } - // Initial downs on external touch devices should wake the device. - // We don't do this for internal touch screens to prevent them from waking - // up in your pocket. - // TODO: Use the input device configuration to control this behavior more finely. - if (getDevice()->isExternal()) { + if (mParameters.wake) { policyFlags |= POLICY_FLAG_WAKE_DROPPED; } } |