mirror of
https://github.com/team-infusion-developers/android_device_samsung_msm8976-common.git
synced 2024-11-07 06:19:20 +00:00
msm8976-common: Build Samsung LiveDisplay service
Change-Id: I74d38aa0df3179bb00b942135e8ff055aa8a5658
This commit is contained in:
parent
c2e3a7b743
commit
74c3327190
7 changed files with 38 additions and 71 deletions
|
@ -169,11 +169,6 @@ TARGET_PLATFORM_DEVICE_BASE := /devices/soc.0/
|
|||
# Keymaster
|
||||
TARGET_PROVIDES_KEYMASTER := true
|
||||
|
||||
# Lineage hardware
|
||||
JAVA_SOURCE_OVERLAYS := \
|
||||
org.lineageos.hardware|hardware/samsung/lineagehw|**/*.java \
|
||||
org.lineageos.hardware|$(VENDOR_PATH)/lineagehw|**/*.java
|
||||
|
||||
# Peripheral manager
|
||||
TARGET_PER_MGR_ENABLED := true
|
||||
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2018 TeamNexus
|
||||
* Copyright (C) 2018 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.
|
||||
*/
|
||||
|
||||
package org.lineageos.hardware;
|
||||
|
||||
import org.lineageos.internal.util.FileUtils;
|
||||
|
||||
/**
|
||||
* Reader mode
|
||||
*/
|
||||
public class ReadingEnhancement {
|
||||
|
||||
private static final String ACCESSIBILITY_FILE =
|
||||
"/sys/devices/virtual/mdnie/mdnie/accessibility";
|
||||
|
||||
/**
|
||||
* Whether device supports Reader Mode
|
||||
*
|
||||
* @return boolean Supported devices must return always true
|
||||
*/
|
||||
public static boolean isSupported() {
|
||||
return FileUtils.isFileWritable(ACCESSIBILITY_FILE) &&
|
||||
FileUtils.isFileReadable(ACCESSIBILITY_FILE);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method return the current activation status of Reader Mode
|
||||
*
|
||||
* @return boolean Must be false when Reader Mode is not supported or not activated,
|
||||
* or the operation failed while reading the status; true in any other case.
|
||||
*/
|
||||
public static boolean isEnabled() {
|
||||
return FileUtils.readOneLine(ACCESSIBILITY_FILE).equals(
|
||||
"Current accessibility : DSI0 : GRAYSCALE ");
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows to setup Reader Mode
|
||||
*
|
||||
* @param status The new Reader Mode status
|
||||
* @return boolean Must be false if Reader Mode is not supported or the operation
|
||||
* failed; true in any other case.
|
||||
*/
|
||||
public static boolean setEnabled(boolean status) {
|
||||
return FileUtils.writeLine(ACCESSIBILITY_FILE, status ? "4" : "0");
|
||||
}
|
||||
|
||||
}
|
25
manifest.xml
25
manifest.xml
|
@ -210,6 +210,31 @@
|
|||
<instance>default</instance>
|
||||
</interface>
|
||||
</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">
|
||||
<name>vendor.lineage.power</name>
|
||||
<transport>hwbinder</transport>
|
||||
|
|
|
@ -201,6 +201,10 @@ PRODUCT_PACKAGES += \
|
|||
android.hardware.light@2.0-service \
|
||||
lights.MSM8952
|
||||
|
||||
# LiveDisplay
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.lineage.livedisplay@2.0-service.samsung-qcom
|
||||
|
||||
# Media
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
|
||||
|
|
2
sepolicy/comhal_lineage_livedisplay_default.te
Normal file
2
sepolicy/comhal_lineage_livedisplay_default.te
Normal file
|
@ -0,0 +1,2 @@
|
|||
allow hal_lineage_livedisplay_default { sysfs_graphics sysfs_mdnie }:dir search;
|
||||
allow hal_lineage_livedisplay_default { sysfs_graphics sysfs_mdnie }:file rw_file_perms;
|
|
@ -20,12 +20,17 @@
|
|||
/dev/vfsspi u:object_r:vfsspi_device:s0
|
||||
/data/biometrics(/.*)? u:object_r:biometrics_data_file:s0
|
||||
|
||||
# Graphics
|
||||
/sys/devices/virtual/lcd/panel(/.*)? u:object_r:sysfs_graphics:s0
|
||||
|
||||
# Lights
|
||||
/sys/devices/virtual/sec/sec_touchkey/brightness u:object_r:sysfs_leds:s0
|
||||
|
||||
# LiveDisplay
|
||||
/(vendor|system/vendor)/bin/hw/vendor\.lineage\.livedisplay@2\.0-service\.samsung-qcom u:object_r:hal_lineage_livedisplay_default_exec:s0
|
||||
|
||||
# mDNIe
|
||||
/sys/devices/virtual/mdnie/mdnie/mode u:object_r:sysfs_mdnie:s0
|
||||
/sys/devices/virtual/mdnie/mdnie/scenario u:object_r:sysfs_mdnie:s0
|
||||
/sys/devices/virtual/mdnie/mdnie(/.*)? u:object_r:sysfs_mdnie:s0
|
||||
|
||||
# SEC
|
||||
/sys/devices/virtual/sec/sec_key(/.*)? u:object_r:sysfs_sec_key:s0
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
allow system_server sensors_data_file:file rw_file_perms;
|
||||
allow system_server iio_device:chr_file r_file_perms;
|
||||
|
||||
allow system_server sysfs_mdnie:file rw_file_perms;
|
||||
|
||||
r_dir_file(system_server, app_efs_file)
|
||||
|
|
Loading…
Reference in a new issue