sm6150-common: Drop power AIDL extension
Change-Id: Ied144ee0f7840ab43499d43f3d0c64dfd414d99f
This commit is contained in:
parent
48c5fdf505
commit
f36cf7a8a9
@ -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
|
||||
|
@ -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",
|
||||
],
|
||||
}
|
@ -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 <aidl/android/hardware/power/BnPower.h>
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/logging.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
// 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
|
Loading…
Reference in New Issue
Block a user