mirror of
https://github.com/S3NEO/android_device_samsung_msm8226-common.git
synced 2024-11-06 21:55:45 +00:00
msm8226-common: Build Samsung LiveDisplay service
Change-Id: I74d38aa0df3179bb00b942135e8ff055aa8a5658
This commit is contained in:
parent
805d4f1785
commit
1e8bba9944
7 changed files with 39 additions and 95 deletions
|
@ -55,9 +55,6 @@ BOARD_CHARGING_CMDLINE_VALUE := "charger"
|
||||||
BOARD_CHARGER_ENABLE_SUSPEND := true
|
BOARD_CHARGER_ENABLE_SUSPEND := true
|
||||||
WITH_LINEAGE_CHARGER := false
|
WITH_LINEAGE_CHARGER := false
|
||||||
|
|
||||||
# LineageHW
|
|
||||||
BOARD_HARDWARE_CLASS += device/samsung/msm8226-common/lineagehw
|
|
||||||
|
|
||||||
# Dexpreopt
|
# Dexpreopt
|
||||||
ifeq ($(HOST_OS),linux)
|
ifeq ($(HOST_OS),linux)
|
||||||
ifneq ($(TARGET_BUILD_VARIANT),eng)
|
ifneq ($(TARGET_BUILD_VARIANT),eng)
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
26
manifest.xml
26
manifest.xml
|
@ -207,4 +207,30 @@
|
||||||
<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>IReadingEnhancement</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>vendor.lineage.trust</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IUsbRestrict</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -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.
|
||||||
|
@ -163,6 +163,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 \
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
# executeables
|
# executeables
|
||||||
/(vendor|system/vendor)/bin/hw/android\.hardware\.sensors@1\.0-service.samsung8226 u:object_r:hal_sensors_default_exec:s0
|
/(vendor|system/vendor)/bin/hw/android\.hardware\.sensors@1\.0-service.samsung8226 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
|
||||||
|
|
||||||
# sockets
|
# sockets
|
||||||
|
|
7
sepolicy/common/hal_lineage_livedisplay_default.te
Normal file
7
sepolicy/common/hal_lineage_livedisplay_default.te
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
allow hal_lineage_livedisplay_default {
|
||||||
|
sysfs_graphics
|
||||||
|
}:dir search;
|
||||||
|
|
||||||
|
allow hal_lineage_livedisplay_default {
|
||||||
|
sysfs_graphics
|
||||||
|
}:file rw_file_perms;
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue