Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 135c4b4e authored by Manu Suresh's avatar Manu Suresh
Browse files

Revert "FP6: adapt oem tap to wake implementation into powerhal"

This reverts commit 0fbf283d.
parent 8bee705f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ BOARD_USES_QCOM_HARDWARE := true
TARGET_BOARD_PLATFORM := volcano

# Screen tap-to-wake
TARGET_POWERHAL_MODE_EXT := $(DEVICE_PATH)/power/power-mode.cpp
TARGET_TAP_TO_WAKE_NODE := /sys/bus/spi/devices/spi0.0/gesture_wakeup

# Properties
TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop

power/power-mode.cpp

deleted100644 → 0
+0 −54
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The LineageOS Project
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <aidl/android/hardware/power/BnPower.h>
#include <android-base/file.h>
#include <android-base/logging.h>

static const std::string wakeup_node = "/sys/bus/spi/devices/spi0.0/gesture_wakeup";
static const std::string wakeup_node_val_enabled = "2";
static const std::string wakeup_node_val_disabled = "-2";

namespace aidl {
namespace android {
namespace hardware {
namespace power {
namespace impl {

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: {
            if (!::android::base::WriteStringToFile(
                enabled ? wakeup_node_val_enabled : wakeup_node_val_disabled,
                wakeup_node
            )) {
                LOG(ERROR) << "Failed to write " << wakeup_node;
                return false;
            }
            return true;
        }
        default:
            return false;
    }
}

}  // namespace impl
}  // namespace power
}  // namespace hardware
}  // namespace android
}  // namespace aidl
 No newline at end of file