diff options
| author | myfluxi <linflux@arcor.de> | 2016-11-24 20:53:35 +0100 |
|---|---|---|
| committer | droidfivex <droidfivex@gmail.com> | 2016-12-14 01:30:44 +0900 |
| commit | 4f2c2e38d4048ebbea545a37950cad4b30a1b6f6 (patch) | |
| tree | 80c8e2b12b4828fad7907b69bc3c1bbb43e0b7cc | |
| parent | ff84b17215c83e78219c47605a785f168023c003 (diff) | |
hammerhead: Switch to cmhw vibrator implementation
Change-Id: Icb4386abebd2569ad8af4c0e46136ea3ada6c909
| -rw-r--r-- | BoardConfig.mk | 3 | ||||
| -rw-r--r-- | cmhw/org/cyanogenmod/hardware/VibratorHW.java | 51 | ||||
| -rw-r--r-- | init.hammerhead.rc | 4 | ||||
| -rw-r--r-- | sepolicy/file.te | 1 | ||||
| -rw-r--r-- | sepolicy/file_contexts | 3 | ||||
| -rw-r--r-- | sepolicy/system_server.te | 1 |
6 files changed, 2 insertions, 61 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk index 5fa5fb9..a7914f7 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -147,7 +147,8 @@ MALLOC_SVELTE := true endif # Hardware -BOARD_HARDWARE_CLASS := device/lge/hammerhead/cmhw +BOARD_USES_CYANOGEN_HARDWARE := true +BOARD_HARDWARE_CLASS := hardware/cyanogen/cmhw # Recovery RECOVERY_FSTAB_VERSION := 2 diff --git a/cmhw/org/cyanogenmod/hardware/VibratorHW.java b/cmhw/org/cyanogenmod/hardware/VibratorHW.java deleted file mode 100644 index 2ab64cc..0000000 --- a/cmhw/org/cyanogenmod/hardware/VibratorHW.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2014 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 org.cyanogenmod.internal.util.FileUtils; - -public class VibratorHW { - private static String AMP_PATH = "/sys/class/timed_output/vibrator/amp"; - - public static boolean isSupported() { - return FileUtils.isFileWritable(AMP_PATH); - } - - public static int getMaxIntensity() { - return 100; - } - - public static int getMinIntensity() { - return 0; - } - - public static int getWarningThreshold() { - return -1; - } - - public static int getCurIntensity() { - return Integer.parseInt(FileUtils.readOneLine(AMP_PATH)); - } - - public static int getDefaultIntensity() { - return 63; - } - - public static boolean setIntensity(int intensity) { - return FileUtils.writeLine(AMP_PATH, String.valueOf(intensity)); - } -} diff --git a/init.hammerhead.rc b/init.hammerhead.rc index 1a6896c..cc2e905 100644 --- a/init.hammerhead.rc +++ b/init.hammerhead.rc @@ -195,10 +195,6 @@ on post-fs-data chmod 664 /sys/devices/system/cpu/cpu3/online write /dev/cpuctl/apps/cpu.notify_on_migrate 1 - # Hardware tunables - chown system system /sys/devices/virtual/timed_output/vibrator/amp - chmod 0664 /sys/devices/virtual/timed_output/vibrator/amp - on charger # Booting modem wait /dev/block/platform/msm_sdcc.1/by-name/modem diff --git a/sepolicy/file.te b/sepolicy/file.te index b60b723..7595419 100644 --- a/sepolicy/file.te +++ b/sepolicy/file.te @@ -26,4 +26,3 @@ type sysfs_rmnet, fs_type, sysfs_type; type sysfs_mpdecision, fs_type, sysfs_type; type sysfs_surfaceflinger, fs_type, sysfs_type; type sysfs_smdcntl_open_timeout, fs_type, sysfs_type; -type sysfs_hardware, fs_type, sysfs_type; diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 68f288c..1a39fe7 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -158,9 +158,6 @@ # Bluetooth /sys/devices/platform/bluetooth_rfkill/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0 -# Hardware tunables -/sys/devices/virtual/timed_output/vibrator/amp -- u:object_r:sysfs_hardware:s0 - # Thermal engine /dev/msm_thermal_query u:object_r:thermal_engine_device:s0 diff --git a/sepolicy/system_server.te b/sepolicy/system_server.te index 622d92e..782af9b 100644 --- a/sepolicy/system_server.te +++ b/sepolicy/system_server.te @@ -24,5 +24,4 @@ allow system_server self:netlink_socket create_socket_perms; allow system_server persist_file:dir r_dir_perms; r_dir_file(system_server, persist_wifi_file) -allow system_server sysfs_hardware:file rw_file_perms; allow system_server sysfs_thermal:file r_file_perms; |
