Commit b5774cec authored by Blaster4385's avatar Blaster4385
Browse files

nicky: Drop livedisplay

parent 4db1230c
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -249,10 +249,6 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
    android.hardware.light-service.nicky

# LiveDisplay
PRODUCT_PACKAGES += \
    vendor.lineage.livedisplay@2.1-service.nicky

# Media
PRODUCT_PACKAGES += \
    libavservices_minijail \

livedisplay/Android.bp

deleted100644 → 0
+0 −57
Original line number Diff line number Diff line
// Copyright (C) 2019-2021 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.

filegroup {
    name: "vendor.lineage.livedisplay@2.1-nicky-af",
    srcs: ["AntiFlicker.cpp"],
}

filegroup {
    name: "vendor.lineage.livedisplay@2.1-nicky-se",
    srcs: ["SunlightEnhancement.cpp"],
}

cc_library_headers {
    name: "vendor.lineage.livedisplay@2.1-nicky-headers",
    vendor_available: true,
    export_include_dirs: ["include"],
}

cc_binary {
    name: "vendor.lineage.livedisplay@2.1-service.nicky",
    defaults: ["hidl_defaults"],
    init_rc: ["vendor.lineage.livedisplay@2.1-service.nicky.rc"],
    vintf_fragments: ["vendor.lineage.livedisplay@2.1-service.nicky.xml"],
    relative_install_path: "hw",
    srcs: [
        ":vendor.lineage.livedisplay@2.0-sdm-pa",
        ":vendor.lineage.livedisplay@2.0-sdm-utils",
        ":vendor.lineage.livedisplay@2.1-nicky-af",
        ":vendor.lineage.livedisplay@2.1-nicky-se",
        "service.cpp",
    ],
    shared_libs: [
        "libbase",
        "libbinder",
        "libhidlbase",
        "libutils",
        "vendor.lineage.livedisplay@2.0",
        "vendor.lineage.livedisplay@2.1",
    ],
    header_libs: [
        "vendor.lineage.livedisplay@2.0-sdm-headers",
        "vendor.lineage.livedisplay@2.1-nicky-headers",
    ],
    proprietary: true,
}

livedisplay/AntiFlicker.cpp

deleted100644 → 0
+0 −51
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.
 */

#define LOG_TAG "AntiFlickerService"

#include <livedisplay/nicky/AntiFlicker.h>
#include <android-base/logging.h>
#include <fstream>

namespace vendor {
namespace lineage {
namespace livedisplay {
namespace V2_1 {
namespace implementation {

static constexpr const char* kDcDimmingPath =
    "/sys/kernel/oppo_display/dimlayer_bl_en";

Return<bool> AntiFlicker::isEnabled() {
    std::ifstream file(kDcDimmingPath);
    int result = -1;
    file >> result;
    LOG(DEBUG) << "Got result " << result << " fail " << file.fail();
    return !file.fail() && result > 0;
}

Return<bool> AntiFlicker::setEnabled(bool enabled) {
    std::ofstream file(kDcDimmingPath);
    file << (enabled ? "1" : "0");
    LOG(DEBUG) << "setEnabled fail " << file.fail();
    return !file.fail();
}

}  // namespace implementation
}  // namespace V2_1
}  // namespace livedisplay
}  // namespace lineage
}  // namespace vendor
+0 −51
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019-2021 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.
 */

#define LOG_TAG "SunlightEnhancementService"

#include <livedisplay/nicky/SunlightEnhancement.h>
#include <android-base/logging.h>
#include <fstream>

namespace vendor {
namespace lineage {
namespace livedisplay {
namespace V2_1 {
namespace implementation {

static constexpr const char* kHbmPath =
    "/sys/kernel/oppo_display/hbm";

Return<bool> SunlightEnhancement::isEnabled() {
    std::ifstream file(kHbmPath);
    int result = -1;
    file >> result;
    LOG(DEBUG) << "Got result " << result << " fail " << file.fail();
    return !file.fail() && result > 0;
}

Return<bool> SunlightEnhancement::setEnabled(bool enabled) {
    std::ofstream file(kHbmPath);
    file << (enabled ? "5" : "0");
    LOG(DEBUG) << "setEnabled fail " << file.fail();
    return !file.fail();
}

}  // namespace implementation
}  // namespace V2_1
}  // namespace livedisplay
}  // namespace lineage
}  // namespace vendor
+0 −44
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021-2022 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.
 */

#pragma once

#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <vendor/lineage/livedisplay/2.1/IAntiFlicker.h>

namespace vendor {
namespace lineage {
namespace livedisplay {
namespace V2_1 {
namespace implementation {

using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;

class AntiFlicker : public IAntiFlicker {
  public:
    // Methods from ::vendor::lineage::livedisplay::V2_1::IAntiFlicker follow.
    Return<bool> isEnabled() override;
    Return<bool> setEnabled(bool enabled) override;
};

}  // namespace implementation
}  // namespace V2_1
}  // namespace livedisplay
}  // namespace lineage
}  // namespace vendor
Loading