sm7325-common: Drop support for AdaptiveBacklight from livedisplay

* Neither berlin nor dubai supports it.

Change-Id: I22842a489b1cfcb3f32ea3464338597473df912e
This commit is contained in:
AdarshGrewal 2022-09-24 11:17:04 +05:30 committed by Nolen Johnson
parent 4f164b2fd2
commit edad8ae1cf
6 changed files with 0 additions and 142 deletions

View File

@ -1,77 +0,0 @@
/*
* Copyright (C) 2019-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.
*/
#include "AdaptiveBacklight.h"
#include <android-base/file.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
using ::android::base::GetBoolProperty;
using ::android::base::ReadFileToString;
using ::android::base::Trim;
using ::android::base::WriteStringToFile;
namespace {
constexpr const char *kFileAcl = "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_acl";
constexpr const char *kFileCabc = "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_cabc";
constexpr const char *kFossProperty = "ro.vendor.display.foss";
} // anonymous namespace
namespace vendor {
namespace lineage {
namespace livedisplay {
namespace V2_1 {
namespace implementation {
AdaptiveBacklight::AdaptiveBacklight() {
if (!access(kFileAcl, R_OK | W_OK)) {
file_ = kFileAcl;
} else if (!access(kFileCabc, R_OK | W_OK)) {
file_ = kFileCabc;
} else {
file_ = nullptr;
}
}
bool AdaptiveBacklight::isSupported() {
if (GetBoolProperty(kFossProperty, false) || file_ == nullptr) {
return false;
}
return true;
}
// Methods from ::vendor::lineage::livedisplay::V2_1::IAdaptiveBacklight follow.
Return<bool> AdaptiveBacklight::isEnabled() {
std::string tmp;
int32_t contents = 0;
if (ReadFileToString(file_, &tmp)) {
contents = std::stoi(Trim(tmp));
}
return contents > 0;
}
Return<bool> AdaptiveBacklight::setEnabled(bool enabled) {
return WriteStringToFile(std::to_string(enabled), file_, true);
}
} // namespace implementation
} // namespace V2_1
} // namespace livedisplay
} // namespace lineage
} // namespace vendor

View File

@ -1,46 +0,0 @@
/*
* Copyright (C) 2019-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 <vendor/lineage/livedisplay/2.1/IAdaptiveBacklight.h>
namespace vendor {
namespace lineage {
namespace livedisplay {
namespace V2_1 {
namespace implementation {
using ::android::hardware::Return;
class AdaptiveBacklight : public IAdaptiveBacklight {
public:
AdaptiveBacklight();
bool isSupported();
// Methods from ::vendor::lineage::livedisplay::V2_1::IAdaptiveBacklight follow.
Return<bool> isEnabled() override;
Return<bool> setEnabled(bool enabled) override;
private:
const char* file_;
};
} // namespace implementation
} // namespace V2_1
} // namespace livedisplay
} // namespace lineage
} // namespace vendor

View File

@ -19,7 +19,6 @@ cc_defaults {
srcs: [ srcs: [
":vendor.lineage.livedisplay@2.0-sdm-pa", ":vendor.lineage.livedisplay@2.0-sdm-pa",
":vendor.lineage.livedisplay@2.0-sdm-utils", ":vendor.lineage.livedisplay@2.0-sdm-utils",
"AdaptiveBacklight.cpp",
"AntiFlicker.cpp", "AntiFlicker.cpp",
"SunlightEnhancement.cpp", "SunlightEnhancement.cpp",
"service.cpp", "service.cpp",

View File

@ -21,7 +21,6 @@
#include <hidl/HidlTransportSupport.h> #include <hidl/HidlTransportSupport.h>
#include <livedisplay/sdm/PictureAdjustment.h> #include <livedisplay/sdm/PictureAdjustment.h>
#include <vendor/lineage/livedisplay/2.1/IPictureAdjustment.h> #include <vendor/lineage/livedisplay/2.1/IPictureAdjustment.h>
#include "AdaptiveBacklight.h"
#include "AntiFlicker.h" #include "AntiFlicker.h"
#include "SunlightEnhancement.h" #include "SunlightEnhancement.h"
@ -34,23 +33,12 @@ using ::android::hardware::joinRpcThreadpool;
using ::vendor::lineage::livedisplay::V2_0::sdm::PictureAdjustment; using ::vendor::lineage::livedisplay::V2_0::sdm::PictureAdjustment;
using ::vendor::lineage::livedisplay::V2_0::sdm::SDMController; using ::vendor::lineage::livedisplay::V2_0::sdm::SDMController;
using ::vendor::lineage::livedisplay::V2_1::IPictureAdjustment; using ::vendor::lineage::livedisplay::V2_1::IPictureAdjustment;
using ::vendor::lineage::livedisplay::V2_1::implementation::AdaptiveBacklight;
using ::vendor::lineage::livedisplay::V2_1::implementation::AntiFlicker; using ::vendor::lineage::livedisplay::V2_1::implementation::AntiFlicker;
using ::vendor::lineage::livedisplay::V2_1::implementation::SunlightEnhancement; using ::vendor::lineage::livedisplay::V2_1::implementation::SunlightEnhancement;
status_t RegisterAsServices() { status_t RegisterAsServices() {
status_t status = OK; status_t status = OK;
sp<AdaptiveBacklight> ab = new AdaptiveBacklight();
if (ab->isSupported()) {
status = ab->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for LiveDisplay HAL AdaptiveBacklight Iface ("
<< status << ")";
return status;
}
}
sp<SunlightEnhancement> se = new SunlightEnhancement(); sp<SunlightEnhancement> se = new SunlightEnhancement();
if (se->isSupported()) { if (se->isSupported()) {
status = se->registerAsService(); status = se->registerAsService();

View File

@ -1,9 +1,5 @@
on init on init
# LiveDisplay sysfs # LiveDisplay sysfs
chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_acl
chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_acl
chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_cabc
chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_cabc
chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_hbm chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_hbm
chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_hbm chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_hbm
chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_dc chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_dc

View File

@ -8,8 +8,6 @@ genfscon sysfs /devices/virtual/input
genfscon sysfs /devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8350c@2:qcom,leds@ef00/leds/charging u:object_r:sysfs_leds:s0 genfscon sysfs /devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8350c@2:qcom,leds@ef00/leds/charging u:object_r:sysfs_leds:s0
# LiveDisplay # LiveDisplay
genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_acl u:object_r:sysfs_livedisplay_tuneable:s0
genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_cabc u:object_r:sysfs_livedisplay_tuneable:s0
genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_hbm u:object_r:sysfs_livedisplay_tuneable:s0 genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_hbm u:object_r:sysfs_livedisplay_tuneable:s0
genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_dc u:object_r:sysfs_livedisplay_tuneable:s0 genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_dc u:object_r:sysfs_livedisplay_tuneable:s0