msm8974-common: Build Samsung LiveDisplay service

Change-Id: I74d38aa0df3179bb00b942135e8ff055aa8a5658
This commit is contained in:
Kevin F. Haggerty 2019-02-19 07:40:21 -07:00
parent c036f18fe2
commit 66b282da2e
No known key found for this signature in database
GPG Key ID: 6D95512933112729
7 changed files with 41 additions and 96 deletions

View File

@ -1,5 +1,5 @@
# Copyright (C) 2012 The CyanogenMod Project # Copyright (C) 2012 The CyanogenMod Project
# Copyright (C) 2017-2018 The LineageOS Project # Copyright (C) 2017-2019 The LineageOS Project
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -47,9 +47,6 @@ BOARD_CHARGING_CMDLINE_NAME := "androidboot.bootchg"
BOARD_CHARGING_CMDLINE_VALUE := "true" BOARD_CHARGING_CMDLINE_VALUE := "true"
WITH_LINEAGE_CHARGER := false WITH_LINEAGE_CHARGER := false
# CMHW
BOARD_HARDWARE_CLASS += device/samsung/msm8974-common/lineagehw
# Dexpreopt # Dexpreopt
ifeq ($(HOST_OS),linux) ifeq ($(HOST_OS),linux)
ifneq ($(TARGET_BUILD_VARIANT),eng) ifneq ($(TARGET_BUILD_VARIANT),eng)

View File

@ -1,89 +0,0 @@
/*
* Copyright (C) 2016 The CyanogenMod 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.
*/
package org.lineageos.hardware;
import org.lineageos.internal.util.FileUtils;
/**
* Sunlight Readability Enhancement support, aka Facemelt Mode.
*
* Brightens up the screen via image processing or other tricks when
* under aggressive lighting conditions. Usually depends on CABC
* support.
*/
public class SunlightEnhancement {
private static final String FILE_SRE = "/sys/class/mdnie/mdnie/outdoor";
private static final String FILE_HBM = "/sys/class/lcd/panel/panel/auto_brightness";
/**
* Whether device supports SRE
*
* @return boolean Supported devices must return always true
*/
public static boolean isSupported() {
return FileUtils.isFileWritable(FILE_SRE) &&
FileUtils.isFileReadable(FILE_SRE) &&
FileUtils.isFileWritable(FILE_HBM) &&
FileUtils.isFileReadable(FILE_HBM);
}
/**
* This method return the current activation status of SRE
*
* @return boolean Must be false when SRE is not supported or not activated, or
* the operation failed while reading the status; true in any other case.
*/
public static boolean isEnabled() {
return "1".equals(FileUtils.readOneLine(FILE_SRE)) &&
"6".equals(FileUtils.readOneLine(FILE_HBM));
}
/**
* This method allows to setup SRE.
*
* @param status The new SRE status
* @return boolean Must be false if SRE is not supported or the operation
* failed; true in any other case.
*/
public static boolean setEnabled(boolean status) {
return FileUtils.writeLine(FILE_SRE, status ? "1" : "0") &&
FileUtils.writeLine(FILE_HBM, status ? "6" : "0");
}
/**
* Whether adaptive backlight (CABL / CABC) is required to be enabled
*
* @return boolean false if adaptive backlight is not a dependency
*/
public static boolean isAdaptiveBacklightRequired() {
return false;
}
/**
* Set this to true if the implementation is self-managed and does
* it's own ambient sensing. In this case, setEnabled is assumed
* to toggle the feature on or off, but not activate it. If set
* to false, LiveDisplay will call setEnabled when the ambient lux
* threshold is crossed.
*
* @return true if this enhancement is self-managed
*/
public static boolean isSelfManaged() {
return false;
}
}

View File

@ -216,6 +216,31 @@
<instance>default</instance> <instance>default</instance>
</interface> </interface>
</hal> </hal>
<hal format="hidl">
<name>vendor.lineage.livedisplay</name>
<transport>hwbinder</transport>
<version>2.0</version>
<interface>
<name>IAdaptiveBacklight</name>
<instance>default</instance>
</interface>
<interface>
<name>IDisplayColorCalibration</name>
<instance>default</instance>
</interface>
<interface>
<name>IDisplayModes</name>
<instance>default</instance>
</interface>
<interface>
<name>IReadingEnhancement</name>
<instance>default</instance>
</interface>
<interface>
<name>ISunlightEnhancement</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl"> <hal format="hidl">
<name>vendor.lineage.trust</name> <name>vendor.lineage.trust</name>
<transport>hwbinder</transport> <transport>hwbinder</transport>

View File

@ -1,5 +1,5 @@
# Copyright (C) 2012 The CyanogenMod Project # Copyright (C) 2012 The CyanogenMod Project
# Copyright (C) 2017-2018 The LineageOS Project # Copyright (C) 2017-2019 The LineageOS Project
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -141,6 +141,10 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.keymaster@3.0-impl android.hardware.keymaster@3.0-impl
# LiveDisplay
PRODUCT_PACKAGES += \
vendor.lineage.livedisplay@2.0-service.samsung-qcom
# Media # Media
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \ frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \

View File

@ -21,6 +21,7 @@
# executeables # executeables
/system/vendor/bin/macloader u:object_r:macloader_exec:s0 /system/vendor/bin/macloader u:object_r:macloader_exec:s0
/(vendor|system/vendor)/bin/hw/android\.hardware\.sensors@1\.0-service.samsung8974 u:object_r:hal_sensors_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.sensors@1\.0-service.samsung8974 u:object_r:hal_sensors_default_exec:s0
/(vendor|system/vendor)/bin/hw/vendor\.lineage\.livedisplay@2\.0-service\.samsung-qcom u:object_r:hal_lineage_livedisplay_default_exec:s0
/(vendor|system/vendor)/bin/hw/vendor\.lineage\.touch@1\.0-service\.samsung u:object_r:hal_lineage_touch_default_exec:s0 /(vendor|system/vendor)/bin/hw/vendor\.lineage\.touch@1\.0-service\.samsung u:object_r:hal_lineage_touch_default_exec:s0
# firmware # firmware

View File

@ -0,0 +1,9 @@
allow hal_lineage_livedisplay_default {
sysfs_graphics
sysfs_mdnie
}:dir search;
allow hal_lineage_livedisplay_default {
sysfs_graphics
sysfs_mdnie
}:file rw_file_perms;

View File

@ -1,5 +1,3 @@
allow system_server sysfs_mdnie:file rw_file_perms;
allow system_server { allow system_server {
efs_file efs_file
mpctl_data_file mpctl_data_file