diff options
| author | jrior001 <jriordan001@gmail.com> | 2015-07-18 22:40:15 -0400 |
|---|---|---|
| committer | LuK1337 <priv.luk@gmail.com> | 2016-01-26 18:05:37 +0100 |
| commit | 34e096211cbf766386345470082ad3ff1aa38179 (patch) | |
| tree | 3ab6d07582b383129c1455705eb1ac92dc9f5a52 /cmhw | |
| parent | 6c07293041c09e0b9d6044fc31c8101400f45b68 (diff) | |
msm8916-common: cmhw: Add TapToWake support
Change-Id: If4535d0c4f6bba66ec9a3036a5436ae08924e423
Diffstat (limited to 'cmhw')
| -rw-r--r-- | cmhw/org/cyanogenmod/hardware/TapToWake.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/cmhw/org/cyanogenmod/hardware/TapToWake.java b/cmhw/org/cyanogenmod/hardware/TapToWake.java new file mode 100644 index 0000000..8cbb21e --- /dev/null +++ b/cmhw/org/cyanogenmod/hardware/TapToWake.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2015 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.cyanogenmod.hardware; + +import java.io.File; +import org.cyanogenmod.hardware.util.FileUtils; + +public class TapToWake { + + private static final String CONTROL_PATH = "/sys/bus/i2c/devices/i2c-5/5-0038/dclick_mode"; + private static boolean sEnabled = true; + + public static boolean isSupported() { + File f = new File(CONTROL_PATH); + return f.exists(); + } + + public static boolean isEnabled() { + return sEnabled; + } + + public static boolean setEnabled(boolean state) { + sEnabled = state; + return FileUtils.writeLine(CONTROL_PATH, (state ? "1" : "0")); + } +} |
