From f36cf7a8a92b94e2dbe23662a887d33588dbfd43 Mon Sep 17 00:00:00 2001 From: Sebastiano Barezzi Date: Thu, 3 Jun 2021 00:27:07 +0200 Subject: [PATCH] sm6150-common: Drop power AIDL extension Change-Id: Ied144ee0f7840ab43499d43f3d0c64dfd414d99f --- BoardConfigCommon.mk | 3 -- power/Android.bp | 11 ------- power/power-mode.cpp | 69 -------------------------------------------- 3 files changed, 83 deletions(-) delete mode 100644 power/Android.bp delete mode 100644 power/power-mode.cpp diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 810c3f6..dcd1395 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -124,9 +124,6 @@ TARGET_COPY_OUT_VENDOR := vendor # Platform TARGET_BOARD_PLATFORM := sm6150 -# Power -TARGET_POWER_LIBPERFMGR_MODE_EXTENSION_LIB := //$(COMMON_PATH):libperfmgr-ext-xiaomi - # Properties TARGET_ODM_PROP += $(COMMON_PATH)/odm.prop TARGET_SYSTEM_PROP += $(COMMON_PATH)/system.prop diff --git a/power/Android.bp b/power/Android.bp deleted file mode 100644 index 91ccc3c..0000000 --- a/power/Android.bp +++ /dev/null @@ -1,11 +0,0 @@ -cc_library_static { - name: "libperfmgr-ext-xiaomi", - vendor: true, - srcs: [ - "power-mode.cpp", - ], - shared_libs: [ - "android.hardware.power-V4-ndk", - "libbase", - ], -} diff --git a/power/power-mode.cpp b/power/power-mode.cpp deleted file mode 100644 index 1886dc3..0000000 --- a/power/power-mode.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2020 The LineageOS 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. - */ - -#include -#include -#include -#include - -// defines from drivers/input/touchscreen/xiaomi/xiaomi_touch.h -#define SET_CUR_VALUE 0 -#define Touch_Doubletap_Mode 14 - -#define TOUCH_DEV_PATH "/dev/xiaomi-touch" - -#define TOUCH_MAGIC 0x5400 -#define TOUCH_IOC_SETMODE TOUCH_MAGIC + SET_CUR_VALUE - -namespace aidl { -namespace google { -namespace hardware { -namespace power { -namespace impl { -namespace pixel { - -using ::aidl::android::hardware::power::Mode; - -bool isDeviceSpecificModeSupported(Mode type, bool* _aidl_return) { - switch (type) { - case Mode::DOUBLE_TAP_TO_WAKE: - *_aidl_return = true; - return true; - default: - return false; - } -} - -bool setDeviceSpecificMode(Mode type, bool enabled) { - switch (type) { - case Mode::DOUBLE_TAP_TO_WAKE: { - int fd = open(TOUCH_DEV_PATH, O_RDWR); - int arg[2] = {Touch_Doubletap_Mode, enabled ? 1 : 0}; - ioctl(fd, TOUCH_IOC_SETMODE, &arg); - close(fd); - return true; - } - default: - return false; - } -} - -} // namespace pixel -} // namespace impl -} // namespace power -} // namespace hardware -} // namespace google -} // namespace aidl