raphael: Remove livedisplay
This commit is contained in:
@@ -364,10 +364,6 @@ $(call soong_config_set,lineage_health,charging_control_charging_enabled,0)
|
||||
$(call soong_config_set,lineage_health,charging_control_charging_path,/sys/class/power_supply/battery/input_suspend)
|
||||
$(call soong_config_set,lineage_health,charging_control_supports_bypass,false)
|
||||
|
||||
# Livedisplay
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.lineage.livedisplay@2.1-service.raphael
|
||||
|
||||
# Logging
|
||||
SPAMMY_LOG_TAGS := \
|
||||
MiStcImpl \
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
//
|
||||
// Copyright (C) 2019-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.
|
||||
|
||||
cc_binary {
|
||||
name: "vendor.lineage.livedisplay@2.1-service.raphael",
|
||||
defaults: ["hidl_defaults"],
|
||||
vintf_fragments: ["vendor.lineage.livedisplay@2.1-service.raphael.xml"],
|
||||
init_rc: ["vendor.lineage.livedisplay@2.1-service.raphael.rc"],
|
||||
relative_install_path: "hw",
|
||||
srcs: [
|
||||
":vendor.lineage.livedisplay@2.0-sdm-utils",
|
||||
"AntiFlicker.cpp",
|
||||
"SunlightEnhancement.cpp",
|
||||
"service.cpp",
|
||||
],
|
||||
vendor: true,
|
||||
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",
|
||||
],
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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 "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/devices/platform/soc/soc:qcom,dsi-display-primary/dc_dim";
|
||||
|
||||
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
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef VENDOR_LINEAGE_LIVEDISPLAY_V2_1_ANTIFLICKER_H
|
||||
#define VENDOR_LINEAGE_LIVEDISPLAY_V2_1_ANTIFLICKER_H
|
||||
|
||||
#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
|
||||
|
||||
#endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_1_ANTIFLICKER_H
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019-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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "SunlightEnhancementService"
|
||||
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/strings.h>
|
||||
|
||||
#include "SunlightEnhancement.h"
|
||||
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace livedisplay {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
static constexpr const char* kHbmStatusPath =
|
||||
"/sys/devices/platform/soc/soc:qcom,dsi-display-primary/hbm";
|
||||
|
||||
Return<bool> SunlightEnhancement::isEnabled() {
|
||||
std::string buf;
|
||||
if (!android::base::ReadFileToString(kHbmStatusPath, &buf)) {
|
||||
LOG(ERROR) << "Failed to read " << kHbmStatusPath;
|
||||
return false;
|
||||
}
|
||||
return std::stoi(android::base::Trim(buf)) == 1;
|
||||
}
|
||||
|
||||
Return<bool> SunlightEnhancement::setEnabled(bool enabled) {
|
||||
if (!android::base::WriteStringToFile((enabled ? "1" : "0"), kHbmStatusPath)) {
|
||||
LOG(ERROR) << "Failed to write " << kHbmStatusPath;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace livedisplay
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019-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.
|
||||
*/
|
||||
|
||||
#ifndef VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H
|
||||
#define VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H
|
||||
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <vendor/lineage/livedisplay/2.1/ISunlightEnhancement.h>
|
||||
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace livedisplay {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
|
||||
class SunlightEnhancement : public ISunlightEnhancement {
|
||||
public:
|
||||
// Methods from ::vendor::lineage::livedisplay::V2_1::ISunlightEnhancement follow.
|
||||
Return<bool> isEnabled() override;
|
||||
Return<bool> setEnabled(bool enabled) override;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace livedisplay
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
||||
|
||||
#endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019-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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "vendor.lineage.livedisplay@2.1-service.raphael"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <binder/ProcessState.h>
|
||||
#include <hidl/HidlTransportSupport.h>
|
||||
|
||||
#include "AntiFlicker.h"
|
||||
#include "SunlightEnhancement.h"
|
||||
#include "livedisplay/sdm/SDMController.h"
|
||||
|
||||
using android::OK;
|
||||
using android::sp;
|
||||
using android::status_t;
|
||||
|
||||
using ::vendor::lineage::livedisplay::V2_0::sdm::SDMController;
|
||||
using ::vendor::lineage::livedisplay::V2_1::IAntiFlicker;
|
||||
using ::vendor::lineage::livedisplay::V2_1::ISunlightEnhancement;
|
||||
using ::vendor::lineage::livedisplay::V2_1::implementation::AntiFlicker;
|
||||
using ::vendor::lineage::livedisplay::V2_1::implementation::SunlightEnhancement;
|
||||
|
||||
int main() {
|
||||
status_t status = OK;
|
||||
std::shared_ptr<SDMController> controller = std::make_shared<SDMController>();
|
||||
sp<AntiFlicker> af = new AntiFlicker();
|
||||
sp<SunlightEnhancement> se = new SunlightEnhancement();
|
||||
android::hardware::configureRpcThreadpool(1, true /*callerWillJoin*/);
|
||||
|
||||
// AntiFlicker service
|
||||
status = af->registerAsService();
|
||||
if (status != OK) {
|
||||
LOG(ERROR) << "Could not register service for LiveDisplay HAL AntiFlicker Iface ("
|
||||
<< status << ")";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// SunlightEnhancement service
|
||||
status = se->registerAsService();
|
||||
if (status != OK) {
|
||||
LOG(ERROR) << "Could not register service for LiveDisplay HAL SunlightEnhancement Iface ("
|
||||
<< status << ")";
|
||||
return 1;
|
||||
}
|
||||
|
||||
LOG(INFO) << "LiveDisplay HAL service is ready.";
|
||||
|
||||
android::hardware::joinRpcThreadpool();
|
||||
|
||||
LOG(ERROR) << "LiveDisplay HAL service failed to join thread pool.";
|
||||
return 1;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
on boot
|
||||
chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/hbm
|
||||
chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dc_dim
|
||||
chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/hbm
|
||||
chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dc_dim
|
||||
|
||||
service vendor.livedisplay-hal-2-1 /vendor/bin/hw/vendor.lineage.livedisplay@2.1-service.raphael
|
||||
class hal
|
||||
user system
|
||||
group system
|
||||
@@ -1,8 +0,0 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="hidl">
|
||||
<name>vendor.lineage.livedisplay</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@2.1::IAntiFlicker/default</fqname>
|
||||
<fqname>@2.1::ISunlightEnhancement/default</fqname>
|
||||
</hal>
|
||||
</manifest>
|
||||
3
sepolicy/vendor/file_contexts
vendored
3
sepolicy/vendor/file_contexts
vendored
@@ -47,9 +47,6 @@
|
||||
# LEDs
|
||||
/sys/devices/platform/soc/[a-z0-9]+.qcom,spmi/spmi-[0-1]/spmi0-0[0-9]/[a-z0-9]+.qcom,spmi:qcom,[a-z0-9]+@[0-9]:qcom,leds@d000/leds(/.*)? u:object_r:sysfs_leds:s0
|
||||
|
||||
# Livedisplay
|
||||
/vendor/bin/hw/vendor\.lineage\.livedisplay@2\.1-service\.raphael u:object_r:hal_lineage_livedisplay_qti_exec:s0
|
||||
|
||||
# MAC
|
||||
/vendor/bin/nv_mac u:object_r:vendor_wcnss_service_exec:s0
|
||||
/data/vendor/mac_addr(/.*)? u:object_r:vendor_wifi_vendor_data_file:s0
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
allow hal_lineage_livedisplay_qti vendor_sysfs_hbm:file rw_file_perms;
|
||||
allow hal_lineage_livedisplay_qti vendor_sysfs_graphics:dir r_dir_perms;
|
||||
allow hal_lineage_livedisplay_qti vendor_sysfs_graphics:file rw_file_perms;
|
||||
Reference in New Issue
Block a user