aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2024-10-13 14:21:42 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2024-10-13 14:21:42 +0530
commite394d17751ded0dbb60b2d75b4f6d4cca5e61bc1 (patch)
tree3b723581b08be2218898b6c67a6f4ef3988e6549
parent4d671fec381d5159b4112868cad40b72b50ec2c1 (diff)
get compilation working
-rw-r--r--Android.mk38
-rw-r--r--BoardConfigCommon.mk12
-rw-r--r--camera/QCamera2/HAL3/QCamera3HWI.cpp2
-rw-r--r--camera/QCamera2/HAL3/QCamera3PostProc.cpp12
-rw-r--r--camera/QCamera2/stack/mm-camera-interface/src/mm_camera_stream.c2
-rw-r--r--compatibility_matrix.xml78
-rw-r--r--config.fs13
-rw-r--r--configpanel/Android.mk1
-rw-r--r--configpanel/AndroidManifest.xml1
-rw-r--r--configpanel/src/org/lineageos/settings/device/ButtonSettingsActivity.java4
-rw-r--r--doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java4
-rw-r--r--framework_manifest.xml2
-rw-r--r--gps/pla/android/loc_pla.h1
-rw-r--r--gps/pla/oe/loc_pla.h1
-rw-r--r--light/Android.bp31
-rw-r--r--light/Light.cpp264
-rw-r--r--light/Light.h94
-rw-r--r--light/android.hardware.light@2.0-service.zuk_8996.rc70
-rw-r--r--light/android.hardware.light@2.0-service.zuk_8996.xml11
-rw-r--r--light/service.cpp255
-rw-r--r--manifest.xml121
-rwxr-xr-xmsm8996.mk69
-rw-r--r--rootdir/etc/init.qcom.rc44
-rw-r--r--vendor_prop.mk6
24 files changed, 101 insertions, 1035 deletions
diff --git a/Android.mk b/Android.mk
index 91a2620..94b7452 100644
--- a/Android.mk
+++ b/Android.mk
@@ -65,44 +65,6 @@ $(IMS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
ALL_DEFAULT_INSTALLED_MODULES += $(IMS_SYMLINKS)
-RFS_MSM_ADSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/adsp/
-$(RFS_MSM_ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
- @echo "Creating RFS MSM ADSP folder structure: $@"
- @rm -rf $@/*
- @mkdir -p $(dir $@)/readonly/vendor
- $(hide) ln -sf /data/vendor/tombstones/rfs/lpass $@/ramdumps
- $(hide) ln -sf /mnt/vendor/persist/rfs/msm/adsp $@/readwrite
- $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
- $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
- $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
- $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
-
-RFS_MSM_MPSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/mpss/
-$(RFS_MSM_MPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
- @echo "Creating RFS MSM MPSS folder structure: $@"
- @rm -rf $@/*
- @mkdir -p $(dir $@)/readonly/vendor
- $(hide) ln -sf /data/vendor/tombstones/rfs/modem $@/ramdumps
- $(hide) ln -sf /mnt/vendor/persist/rfs/msm/mpss $@/readwrite
- $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
- $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
- $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
- $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
-
-RFS_MSM_SLPI_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/slpi/
-$(RFS_MSM_SLPI_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
- @echo "Creating RFS MSM SLPI folder structure: $@"
- @rm -rf $@/*
- @mkdir -p $(dir $@)/readonly/vendor
- $(hide) ln -sf /data/vendor/tombstones/rfs/slpi $@/ramdumps
- $(hide) ln -sf /mnt/vendor/persist/rfs/msm/slpi $@/readwrite
- $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
- $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
- $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
- $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
-
-ALL_DEFAULT_INSTALLED_MODULES += $(RFS_MSM_ADSP_SYMLINKS) $(RFS_MSM_MPSS_SYMLINKS) $(RFS_MSM_SLPI_SYMLINKS)
-
WCNSS_INI_SYMLINK := $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini
$(WCNSS_INI_SYMLINK): $(LOCAL_INSTALLED_MODULE)
@echo "WCNSS config ini link: $@"
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 4e53352..d027ba1 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -38,11 +38,13 @@ TARGET_NO_BOOTLOADER := true
# Kernel
BOARD_KERNEL_BASE := 0x80000000
-BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom ehci-hcd.park=3 lpm_levels.sleep_disabled=1 cma=32M@0-0xffffffff androidboot.usbconfigfs=true
+BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom ehci-hcd.park=3 lpm_levels.sleep_disabled=1 cma=32M@0-0xffffffff androidboot.usbconfigfs=true androidboot.selinux=permissive
BOARD_KERNEL_CMDLINE += firmware_class.path=/vendor/firmware_mnt/image
+BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/624000.ufshc
BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb
BOARD_KERNEL_PAGESIZE := 4096
TARGET_KERNEL_SOURCE := kernel/zuk/msm8996
+TARGET_KERNEL_CONFIG := kernel/zuk/msm8996/arch/arm64/configs/z2_plus_defconfig
# Platform
TARGET_BOARD_PLATFORM := msm8996
@@ -106,9 +108,13 @@ BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET := true
DEVICE_SPECIFIC_GPS_PATH := $(VENDOR_PATH)/gps
# HIDL
+DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
+ hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml \
+ hardware/qcom-caf/common/vendor_framework_compatibility_matrix_legacy.xml \
+ vendor/lineage/config/device_framework_matrix.xml
DEVICE_FRAMEWORK_MANIFEST_FILE := $(VENDOR_PATH)/framework_manifest.xml
DEVICE_MANIFEST_FILE := $(VENDOR_PATH)/manifest.xml
-DEVICE_MATRIX_FILE := $(VENDOR_PATH)/compatibility_matrix.xml
+DEVICE_MATRIX_FILE := hardware/qcom-caf/common/compatibility_matrix.xml
# Partitions
BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864
@@ -137,7 +143,7 @@ TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true
# RIL
-TARGET_USES_OLD_MNC_FORMAT := true
+ENABLE_VENDOR_RIL_SERVICE := true
# Security patch level
VENDOR_SECURITY_PATCH := 2018-11-05
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 754a60e..228fee5 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -5927,7 +5927,7 @@ void QCamera3HardwareInterface::dumpMetadataToFile(tuning_params_t &meta,
type,
frameNumber);
filePath.append(buf);
- int file_fd = open(filePath.string(), O_RDWR | O_CREAT, 0777);
+ int file_fd = open(filePath.c_str(), O_RDWR | O_CREAT, 0777);
if (file_fd >= 0) {
ssize_t written_len = 0;
meta.tuning_data_version = TUNING_DATA_VERSION;
diff --git a/camera/QCamera2/HAL3/QCamera3PostProc.cpp b/camera/QCamera2/HAL3/QCamera3PostProc.cpp
index be53d4a..6405d76 100644
--- a/camera/QCamera2/HAL3/QCamera3PostProc.cpp
+++ b/camera/QCamera2/HAL3/QCamera3PostProc.cpp
@@ -2625,17 +2625,17 @@ QCamera3Exif *QCamera3PostProcessor::getExifData(metadata_buffer_t *metadata,
rc = getExifDateTime(dateTime, subsecTime);
if (rc == NO_ERROR) {
exif->addEntry(EXIFTAGID_DATE_TIME, EXIF_ASCII,
- (uint32_t)(dateTime.length() + 1), (void *)dateTime.string());
+ (uint32_t)(dateTime.length() + 1), (void *)dateTime.c_str());
exif->addEntry(EXIFTAGID_EXIF_DATE_TIME_ORIGINAL, EXIF_ASCII,
- (uint32_t)(dateTime.length() + 1), (void *)dateTime.string());
+ (uint32_t)(dateTime.length() + 1), (void *)dateTime.c_str());
exif->addEntry(EXIFTAGID_EXIF_DATE_TIME_DIGITIZED, EXIF_ASCII,
- (uint32_t)(dateTime.length() + 1), (void *)dateTime.string());
+ (uint32_t)(dateTime.length() + 1), (void *)dateTime.c_str());
exif->addEntry(EXIFTAGID_SUBSEC_TIME, EXIF_ASCII,
- (uint32_t)(subsecTime.length() + 1), (void *)subsecTime.string());
+ (uint32_t)(subsecTime.length() + 1), (void *)subsecTime.c_str());
exif->addEntry(EXIFTAGID_SUBSEC_TIME_ORIGINAL, EXIF_ASCII,
- (uint32_t)(subsecTime.length() + 1), (void *)subsecTime.string());
+ (uint32_t)(subsecTime.length() + 1), (void *)subsecTime.c_str());
exif->addEntry(EXIFTAGID_SUBSEC_TIME_DIGITIZED, EXIF_ASCII,
- (uint32_t)(subsecTime.length() + 1), (void *)subsecTime.string());
+ (uint32_t)(subsecTime.length() + 1), (void *)subsecTime.c_str());
} else {
LOGW("getExifDateTime failed");
}
diff --git a/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_stream.c b/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_stream.c
index b9223d8..974cb14 100644
--- a/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_stream.c
+++ b/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_stream.c
@@ -812,7 +812,7 @@ int32_t mm_stream_fsm_reg(mm_stream_t * my_obj,
pthread_mutex_lock(&my_obj->cmd_lock);
if (has_cb) {
- snprintf(my_obj->cmd_thread.threadName, THREAD_NAME_SIZE, "CAM_StrmAppData");
+ snprintf(my_obj->cmd_thread.threadName, THREAD_NAME_SIZE, "CAM_StrmAppDat");
mm_camera_cmd_thread_launch(&my_obj->cmd_thread,
mm_stream_dispatch_app_data,
(void *)my_obj);
diff --git a/compatibility_matrix.xml b/compatibility_matrix.xml
deleted file mode 100644
index 5fa60b3..0000000
--- a/compatibility_matrix.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<compatibility-matrix version="1.0" type="device">
- <hal format="hidl" optional="false">
- <name>android.frameworks.displayservice</name>
- <version>1.0</version>
- <interface>
- <name>IDisplayService</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl" optional="false">
- <name>android.frameworks.schedulerservice</name>
- <version>1.0</version>
- <interface>
- <name>ISchedulingPolicyService</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl" optional="false">
- <name>android.frameworks.sensorservice</name>
- <version>1.0</version>
- <interface>
- <name>ISensorManager</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl" optional="false">
- <name>android.hidl.allocator</name>
- <version>1.0</version>
- <interface>
- <name>IAllocator</name>
- <instance>ashmem</instance>
- </interface>
- </hal>
- <hal format="hidl" optional="false">
- <name>android.hidl.manager</name>
- <version>1.1</version>
- <interface>
- <name>IServiceManager</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl" optional="false">
- <name>android.hidl.memory</name>
- <version>1.0</version>
- <interface>
- <name>IMapper</name>
- <instance>ashmem</instance>
- </interface>
- </hal>
- <hal format="hidl" optional="false">
- <name>android.hidl.token</name>
- <version>1.0</version>
- <interface>
- <name>ITokenManager</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl" optional="false">
- <name>android.system.net.netd</name>
- <version>1.1</version>
- <interface>
- <name>INetd</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl" optional="false">
- <name>android.system.wifi.keystore</name>
- <version>1.0</version>
- <interface>
- <name>IKeystore</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="native" optional="false">
- <name>netutils-wrapper</name>
- <version>1.0</version>
- </hal>
-</compatibility-matrix>
diff --git a/config.fs b/config.fs
index cd4c6c5..f94b3ea 100644
--- a/config.fs
+++ b/config.fs
@@ -13,6 +13,15 @@ value:2904
[AID_VENDOR_ADPL_ODL]
value:2905
+[AID_VENDOR_QRTR]
+value:2906
+
+[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
+mode: 0755
+user: AID_BLUETOOTH
+group: AID_BLUETOOTH
+caps: BLOCK_SUSPEND NET_ADMIN
+
[vendor/bin/pm-service]
mode: 0755
user: AID_SYSTEM
@@ -87,7 +96,7 @@ caps: 0
[vendor/firmware_mnt/image/*]
mode: 0771
-user: AID_ROOT
+user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
@@ -97,7 +106,7 @@ user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
-[mnt/vendor/persist/]
+[persist/]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
diff --git a/configpanel/Android.mk b/configpanel/Android.mk
index c44d4ca..bb603c8 100644
--- a/configpanel/Android.mk
+++ b/configpanel/Android.mk
@@ -12,7 +12,6 @@ LOCAL_PRODUCT_MODULE := true
LOCAL_USE_AAPT2 := true
LOCAL_STATIC_ANDROID_LIBRARIES := \
- androidx.core_core \
org.lineageos.settings.resources
LOCAL_STATIC_JAVA_LIBRARIES := \
diff --git a/configpanel/AndroidManifest.xml b/configpanel/AndroidManifest.xml
index b7c7905..35c466d 100644
--- a/configpanel/AndroidManifest.xml
+++ b/configpanel/AndroidManifest.xml
@@ -17,6 +17,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.lineageos.settings.device"
+ xmlns:tools="http://schemas.android.com/tools"
android:versionCode="6"
android:versionName="2.5"
android:sharedUserId="android.uid.system">
diff --git a/configpanel/src/org/lineageos/settings/device/ButtonSettingsActivity.java b/configpanel/src/org/lineageos/settings/device/ButtonSettingsActivity.java
index 98e1e2e..aca9793 100644
--- a/configpanel/src/org/lineageos/settings/device/ButtonSettingsActivity.java
+++ b/configpanel/src/org/lineageos/settings/device/ButtonSettingsActivity.java
@@ -20,13 +20,13 @@ package org.lineageos.settings.device;
import android.os.Bundle;
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
-import com.android.settingslib.widget.R;
public class ButtonSettingsActivity extends CollapsingToolbarBaseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getFragmentManager().beginTransaction().replace(R.id.content_frame,
+ getFragmentManager().beginTransaction().replace(
+ com.android.settingslib.collapsingtoolbar.R.id.content_frame,
new ButtonSettingsFragment()).commit();
}
}
diff --git a/doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java b/doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java
index d684298..efc2376 100644
--- a/doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java
+++ b/doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java
@@ -20,7 +20,6 @@ package org.lineageos.settings.doze;
import android.os.Bundle;
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
-import com.android.settingslib.widget.R;
public class DozeSettingsActivity extends CollapsingToolbarBaseActivity {
@@ -30,7 +29,8 @@ public class DozeSettingsActivity extends CollapsingToolbarBaseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getFragmentManager().beginTransaction().replace(R.id.content_frame,
+ getFragmentManager().beginTransaction().replace(
+ com.android.settingslib.collapsingtoolbar.R.id.content_frame,
new DozeSettingsFragment(), TAG_DOZE).commit();
}
}
diff --git a/framework_manifest.xml b/framework_manifest.xml
index b2276a5..377874d 100644
--- a/framework_manifest.xml
+++ b/framework_manifest.xml
@@ -25,7 +25,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
-<manifest version="1.0" type="framework">
+<manifest version="2.0" type="framework">
<!-- atfwd -->
<hal format="hidl">
<name>vendor.qti.hardware.radio.atcmdfwd</name>
diff --git a/gps/pla/android/loc_pla.h b/gps/pla/android/loc_pla.h
index 9caae73..74bc2f2 100644
--- a/gps/pla/android/loc_pla.h
+++ b/gps/pla/android/loc_pla.h
@@ -39,7 +39,6 @@ extern "C" {
#endif
#include <cutils/properties.h>
-#include <cutils/threads.h>
#include <cutils/sched_policy.h>
#define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf"
diff --git a/gps/pla/oe/loc_pla.h b/gps/pla/oe/loc_pla.h
index 3ca1964..6c6dde9 100644
--- a/gps/pla/oe/loc_pla.h
+++ b/gps/pla/oe/loc_pla.h
@@ -37,7 +37,6 @@ extern "C" {
#endif
#include <cutils/properties.h>
-#include <cutils/threads.h>
#include <cutils/sched_policy.h>
#include <sys/time.h>
#include <string.h>
diff --git a/light/Android.bp b/light/Android.bp
deleted file mode 100644
index 821dc0d..0000000
--- a/light/Android.bp
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// Copyright (C) 2018,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: "android.hardware.light@2.0-service.zuk_8996",
- relative_install_path: "hw",
- init_rc: ["android.hardware.light@2.0-service.zuk_8996.rc"],
- vintf_fragments: ["android.hardware.light@2.0-service.zuk_8996.xml"],
- srcs: ["service.cpp", "Light.cpp"],
- shared_libs: [
- "libbase",
- "libcutils",
- "libhardware",
- "libhidlbase",
- "libutils",
- "android.hardware.light@2.0",
- ],
- proprietary: true,
-}
diff --git a/light/Light.cpp b/light/Light.cpp
deleted file mode 100644
index 85df5f8..0000000
--- a/light/Light.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * 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.
- */
-
-#define LOG_TAG "LightService"
-
-#include "Light.h"
-
-#include <android-base/logging.h>
-
-namespace {
-using android::hardware::light::V2_0::LightState;
-
-static constexpr int RAMP_SIZE = 8;
-static constexpr int RAMP_STEP_DURATION = 50;
-
-static constexpr int BRIGHTNESS_RAMP[RAMP_SIZE] = {0, 12, 25, 37, 50, 72, 85, 100};
-static constexpr int DEFAULT_MAX_BRIGHTNESS = 255;
-
-static uint32_t rgbToBrightness(const LightState& state) {
- uint32_t color = state.color & 0x00ffffff;
- return ((77 * ((color >> 16) & 0xff)) + (150 * ((color >> 8) & 0xff)) +
- (29 * (color & 0xff))) >> 8;
-}
-
-static bool isLit(const LightState& state) {
- return (state.color & 0x00ffffff);
-}
-
-static std::string getScaledDutyPcts(int brightness) {
- std::string buf, pad;
-
- for (auto i : BRIGHTNESS_RAMP) {
- buf += pad;
- buf += std::to_string(i * brightness / 255);
- pad = ",";
- }
-
- return buf;
-}
-} // anonymous namespace
-
-namespace android {
-namespace hardware {
-namespace light {
-namespace V2_0 {
-namespace implementation {
-
-Light::Light(std::pair<std::ofstream, uint32_t>&& lcd_backlight,
- std::ofstream&& red_led, std::ofstream&& green_led, std::ofstream&& blue_led,
- std::ofstream&& red_duty_pcts, std::ofstream&& green_duty_pcts, std::ofstream&& blue_duty_pcts,
- std::ofstream&& red_start_idx, std::ofstream&& green_start_idx, std::ofstream&& blue_start_idx,
- std::ofstream&& red_pause_lo, std::ofstream&& green_pause_lo, std::ofstream&& blue_pause_lo,
- std::ofstream&& red_pause_hi, std::ofstream&& green_pause_hi, std::ofstream&& blue_pause_hi,
- std::ofstream&& red_ramp_step_ms, std::ofstream&& green_ramp_step_ms, std::ofstream&& blue_ramp_step_ms,
- std::ofstream&& red_blink, std::ofstream&& green_blink, std::ofstream&& blue_blink,
- std::ofstream&& rgb_blink)
- : mLcdBacklight(std::move(lcd_backlight)),
- mRedLed(std::move(red_led)),
- mGreenLed(std::move(green_led)),
- mBlueLed(std::move(blue_led)),
- mRedDutyPcts(std::move(red_duty_pcts)),
- mGreenDutyPcts(std::move(green_duty_pcts)),
- mBlueDutyPcts(std::move(blue_duty_pcts)),
- mRedStartIdx(std::move(red_start_idx)),
- mGreenStartIdx(std::move(green_start_idx)),
- mBlueStartIdx(std::move(blue_start_idx)),
- mRedPauseLo(std::move(red_pause_lo)),
- mGreenPauseLo(std::move(green_pause_lo)),
- mBluePauseLo(std::move(blue_pause_lo)),
- mRedPauseHi(std::move(red_pause_hi)),
- mGreenPauseHi(std::move(green_pause_hi)),
- mBluePauseHi(std::move(blue_pause_hi)),
- mRedRampStepMs(std::move(red_ramp_step_ms)),
- mGreenRampStepMs(std::move(green_ramp_step_ms)),
- mBlueRampStepMs(std::move(blue_ramp_step_ms)),
- mRedBlink(std::move(red_blink)),
- mGreenBlink(std::move(green_blink)),
- mBlueBlink(std::move(blue_blink)),
- mRgbBlink(std::move(rgb_blink)) {
- auto attnFn(std::bind(&Light::setAttentionLight, this, std::placeholders::_1));
- auto backlightFn(std::bind(&Light::setLcdBacklight, this, std::placeholders::_1));
- auto batteryFn(std::bind(&Light::setBatteryLight, this, std::placeholders::_1));
- auto notifFn(std::bind(&Light::setNotificationLight, this, std::placeholders::_1));
- mLights.emplace(std::make_pair(Type::ATTENTION, attnFn));
- mLights.emplace(std::make_pair(Type::BACKLIGHT, backlightFn));
- mLights.emplace(std::make_pair(Type::BATTERY, batteryFn));
- mLights.emplace(std::make_pair(Type::NOTIFICATIONS, notifFn));
-}
-
-// Methods from ::android::hardware::light::V2_0::ILight follow.
-Return<Status> Light::setLight(Type type, const LightState& state) {
- auto it = mLights.find(type);
-
- if (it == mLights.end()) {
- return Status::LIGHT_NOT_SUPPORTED;
- }
-
- it->second(state);
-
- return Status::SUCCESS;
-}
-
-Return<void> Light::getSupportedTypes(getSupportedTypes_cb _hidl_cb) {
- std::vector<Type> types;
-
- for (auto const& light : mLights) {
- types.push_back(light.first);
- }
-
- _hidl_cb(types);
-
- return Void();
-}
-
-void Light::setAttentionLight(const LightState& state) {
- std::lock_guard<std::mutex> lock(mLock);
- mAttentionState = state;
- setSpeakerBatteryLightLocked();
-}
-
-void Light::setLcdBacklight(const LightState& state) {
- std::lock_guard<std::mutex> lock(mLock);
-
- uint32_t brightness = rgbToBrightness(state);
-
- // If max panel brightness is not the default (255),
- // apply linear scaling across the accepted range.
- if (mLcdBacklight.second != DEFAULT_MAX_BRIGHTNESS) {
- int old_brightness = brightness;
- brightness = brightness * mLcdBacklight.second / DEFAULT_MAX_BRIGHTNESS;
- LOG(VERBOSE) << "scaling brightness " << old_brightness << " => " << brightness;
- }
-
- mLcdBacklight.first << brightness << std::endl;
-}
-
-void Light::setBatteryLight(const LightState& state) {
- std::lock_guard<std::mutex> lock(mLock);
- mBatteryState = state;
- setSpeakerBatteryLightLocked();
-}
-
-void Light::setNotificationLight(const LightState& state) {
- std::lock_guard<std::mutex> lock(mLock);
- mNotificationState = state;
- setSpeakerBatteryLightLocked();
-}
-
-void Light::setSpeakerBatteryLightLocked() {
- if (isLit(mNotificationState)) {
- setSpeakerLightLocked(mNotificationState);
- } else if (isLit(mAttentionState)) {
- setSpeakerLightLocked(mAttentionState);
- } else if (isLit(mBatteryState)) {
- setSpeakerLightLocked(mBatteryState);
- } else {
- // Lights off
- mRedLed << 0 << std::endl;
- mGreenLed << 0 << std::endl;
- mBlueLed << 0 << std::endl;
- mRedBlink << 0 << std::endl;
- mGreenBlink << 0 << std::endl;
- mBlueBlink << 0 << std::endl;
- }
-}
-
-void Light::setSpeakerLightLocked(const LightState& state) {
- int red, green, blue, blink;
- int onMs, offMs, stepDuration, pauseHi;
- uint32_t alpha;
-
- // Extract brightness from AARRGGBB
- alpha = (state.color >> 24) & 0xff;
-
- // Retrieve each of the RGB colors
- red = (state.color >> 16) & 0xff;
- green = (state.color >> 8) & 0xff;
- blue = state.color & 0xff;
-
- // Scale RGB colors if a brightness has been applied by the user
- if (alpha != 0xff) {
- red = (red * alpha) / 0xff;
- green = (green * alpha) / 0xff;
- blue = (blue * alpha) / 0xff;
- }
-
- switch (state.flashMode) {
- case Flash::TIMED:
- onMs = state.flashOnMs;
- offMs = state.flashOffMs;
- break;
- case Flash::NONE:
- default:
- onMs = 0;
- offMs = 0;
- break;
- }
- blink = onMs > 0 && offMs > 0;
-
- // Disable all blinking to start
- mRgbBlink << 0 << std::endl;
-
- if (blink) {
- stepDuration = RAMP_STEP_DURATION;
- pauseHi = onMs - (stepDuration * RAMP_SIZE * 2);
-
- if (stepDuration * RAMP_SIZE * 2 > onMs) {
- stepDuration = onMs / (RAMP_SIZE * 2);
- pauseHi = 0;
- }
-
- // Red
- mRedStartIdx << 0 << std::endl;
- mRedDutyPcts << getScaledDutyPcts(red) << std::endl;
- mRedPauseLo << offMs << std::endl;
- mRedPauseHi << pauseHi << std::endl;
- mRedRampStepMs << stepDuration << std::endl;
-
- // Green
- mGreenStartIdx << RAMP_SIZE << std::endl;
- mGreenDutyPcts << getScaledDutyPcts(green) << std::endl;
- mGreenPauseLo << offMs << std::endl;
- mGreenPauseHi << pauseHi << std::endl;
- mGreenRampStepMs << stepDuration << std::endl;
-
- // Blue
- mBlueStartIdx << RAMP_SIZE * 2 << std::endl;
- mBlueDutyPcts << getScaledDutyPcts(blue) << std::endl;
- mBluePauseLo << offMs << std::endl;
- mBluePauseHi << pauseHi << std::endl;
- mBlueRampStepMs << stepDuration << std::endl;
-
- // Start the party
- mRgbBlink << 1 << std::endl;
- } else {
- if (red == 0 && green == 0 && blue == 0) {
- mRedBlink << 0 << std::endl;
- mGreenBlink << 0 << std::endl;
- mBlueBlink << 0 << std::endl;
- }
- mRedLed << red << std::endl;
- mGreenLed << green << std::endl;
- mBlueLed << blue << std::endl;
- }
-}
-
-} // namespace implementation
-} // namespace V2_0
-} // namespace light
-} // namespace hardware
-} // namespace android
diff --git a/light/Light.h b/light/Light.h
deleted file mode 100644
index 958d215..0000000
--- a/light/Light.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
-#define ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
-
-#include <android/hardware/light/2.0/ILight.h>
-#include <hidl/Status.h>
-
-#include <fstream>
-#include <mutex>
-#include <unordered_map>
-
-namespace android {
-namespace hardware {
-namespace light {
-namespace V2_0 {
-namespace implementation {
-
-struct Light : public ILight {
- Light(std::pair<std::ofstream, uint32_t>&& lcd_backlight,
- std::ofstream&& red_led, std::ofstream&& green_led, std::ofstream&& blue_led,
- std::ofstream&& red_duty_pcts, std::ofstream&& green_duty_pcts, std::ofstream&& blue_duty_pcts,
- std::ofstream&& red_start_idx, std::ofstream&& green_start_idx, std::ofstream&& blue_start_idx,
- std::ofstream&& red_pause_lo, std::ofstream&& green_pause_lo, std::ofstream&& blue_pause_lo,
- std::ofstream&& red_pause_hi, std::ofstream&& green_pause_hi, std::ofstream&& blue_pause_hi,
- std::ofstream&& red_ramp_step_ms, std::ofstream&& green_ramp_step_ms, std::ofstream&& blue_ramp_step_ms,
- std::ofstream&& red_blink, std::ofstream&& green_blink, std::ofstream&& blue_blink,
- std::ofstream&& rgb_blink);
-
- // Methods from ::android::hardware::light::V2_0::ILight follow.
- Return<Status> setLight(Type type, const LightState& state) override;
- Return<void> getSupportedTypes(getSupportedTypes_cb _hidl_cb) override;
-
- private:
- void setAttentionLight(const LightState& state);
- void setBatteryLight(const LightState& state);
- void setLcdBacklight(const LightState& state);
- void setNotificationLight(const LightState& state);
- void setSpeakerBatteryLightLocked();
- void setSpeakerLightLocked(const LightState& state);
-
- std::pair<std::ofstream, uint32_t> mLcdBacklight;
- std::ofstream mRedLed;
- std::ofstream mGreenLed;
- std::ofstream mBlueLed;
- std::ofstream mRedDutyPcts;
- std::ofstream mGreenDutyPcts;
- std::ofstream mBlueDutyPcts;
- std::ofstream mRedStartIdx;
- std::ofstream mGreenStartIdx;
- std::ofstream mBlueStartIdx;
- std::ofstream mRedPauseLo;
- std::ofstream mGreenPauseLo;
- std::ofstream mBluePauseLo;
- std::ofstream mRedPauseHi;
- std::ofstream mGreenPauseHi;
- std::ofstream mBluePauseHi;
- std::ofstream mRedRampStepMs;
- std::ofstream mGreenRampStepMs;
- std::ofstream mBlueRampStepMs;
- std::ofstream mRedBlink;
- std::ofstream mGreenBlink;
- std::ofstream mBlueBlink;
- std::ofstream mRgbBlink;
-
- LightState mAttentionState;
- LightState mBatteryState;
- LightState mNotificationState;
-
- std::unordered_map<Type, std::function<void(const LightState&)>> mLights;
- std::mutex mLock;
-};
-
-} // namespace implementation
-} // namespace V2_0
-} // namespace light
-} // namespace hardware
-} // namespace android
-
-#endif // ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
diff --git a/light/android.hardware.light@2.0-service.zuk_8996.rc b/light/android.hardware.light@2.0-service.zuk_8996.rc
deleted file mode 100644
index f34de8c..0000000
--- a/light/android.hardware.light@2.0-service.zuk_8996.rc
+++ /dev/null
@@ -1,70 +0,0 @@
-on init
- # RGB lights
- chown system system /sys/class/leds/red/brightness
- chown system system /sys/class/leds/green/brightness
- chown system system /sys/class/leds/blue/brightness
-
- chown system system /sys/class/leds/red/pause_lo
- chown system system /sys/class/leds/green/pause_lo
- chown system system /sys/class/leds/blue/pause_lo
-
- chown system system /sys/class/leds/red/pause_hi
- chown system system /sys/class/leds/green/pause_hi
- chown system system /sys/class/leds/blue/pause_hi
-
- chown system system /sys/class/leds/red/blink
- chown system system /sys/class/leds/green/blink
- chown system system /sys/class/leds/blue/blink
-
- chown system system /sys/class/leds/rgb/rgb_blink
-
- chown system system /sys/class/leds/red/ramp_step_ms
- chown system system /sys/class/leds/green/ramp_step_ms
- chown system system /sys/class/leds/blue/ramp_step_ms
-
- chown system system /sys/class/leds/red/duty_pcts
- chown system system /sys/class/leds/green/duty_pcts
- chown system system /sys/class/leds/blue/duty_pcts
-
- chown system system /sys/class/leds/red/start_idx
- chown system system /sys/class/leds/green/start_idx
- chown system system /sys/class/leds/blue/start_idx
-
- chown system system /sys/class/leds/blue/lut_flags
- chown system system /sys/class/leds/red/lut_flags
- chown system system /sys/class/leds/green/lut_flags
-
- chmod 660 /sys/class/leds/red/brightness
- chmod 660 /sys/class/leds/green/brightness
- chmod 660 /sys/class/leds/blue/brightness
-
- chmod 660 /sys/class/leds/red/ramp_step_ms
- chmod 660 /sys/class/leds/green/ramp_step_ms
- chmod 660 /sys/class/leds/blue/ramp_step_ms
-
- chmod 660 /sys/class/leds/red/duty_pcts
- chmod 660 /sys/class/leds/green/duty_pcts
- chmod 660 /sys/class/leds/blue/duty_pcts
-
- chmod 660 /sys/class/leds/red/start_idx
- chmod 660 /sys/class/leds/green/start_idx
- chmod 660 /sys/class/leds/blue/start_idx
-
- chmod 660 /sys/class/leds/blue/lut_flags
- chmod 660 /sys/class/leds/red/lut_flags
- chmod 660 /sys/class/leds/green/lut_flags
-
- chmod 660 /sys/class/leds/blue/pause_lo
- chmod 660 /sys/class/leds/red/pause_lo
- chmod 660 /sys/class/leds/green/pause_lo
-
- chmod 660 /sys/class/leds/rgb/rgb_blink
-
-service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.zuk_8996
- interface android.hardware.light@2.0::ILight default
- class hal
- user system
- group system
- # shutting off lights while powering-off
- shutdown critical
- writepid /dev/cpuset/system-background/tasks
diff --git a/light/android.hardware.light@2.0-service.zuk_8996.xml b/light/android.hardware.light@2.0-service.zuk_8996.xml
deleted file mode 100644
index 6bf62e9..0000000
--- a/light/android.hardware.light@2.0-service.zuk_8996.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<manifest version="1.0" type="device">
- <hal format="hidl">
- <name>android.hardware.light</name>
- <transport>hwbinder</transport>
- <version>2.0</version>
- <interface>
- <name>ILight</name>
- <instance>default</instance>
- </interface>
- </hal>
-</manifest>
diff --git a/light/service.cpp b/light/service.cpp
deleted file mode 100644
index 6eae236..0000000
--- a/light/service.cpp
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * 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.
- */
-
-#define LOG_TAG "android.hardware.light@2.0-service.zuk_8996"
-
-#include <android-base/logging.h>
-#include <hidl/HidlTransportSupport.h>
-#include <utils/Errors.h>
-
-#include "Light.h"
-
-using android::hardware::configureRpcThreadpool;
-using android::hardware::joinRpcThreadpool;
-
-// Generated HIDL files
-using android::hardware::light::V2_0::ILight;
-using android::hardware::light::V2_0::implementation::Light;
-
-const static std::string kLcdBacklightPath = "/sys/class/leds/lcd-backlight/brightness";
-const static std::string kLcdMaxBacklightPath = "/sys/class/leds/lcd-backlight/max_brightness";
-const static std::string kRedLedPath = "/sys/class/leds/red/brightness";
-const static std::string kGreenLedPath = "/sys/class/leds/green/brightness";
-const static std::string kBlueLedPath = "/sys/class/leds/blue/brightness";
-const static std::string kRedDutyPctsPath = "/sys/class/leds/red/duty_pcts";
-const static std::string kGreenDutyPctsPath = "/sys/class/leds/green/duty_pcts";
-const static std::string kBlueDutyPctsPath = "/sys/class/leds/blue/duty_pcts";
-const static std::string kRedStartIdxPath = "/sys/class/leds/red/start_idx";
-const static std::string kGreenStartIdxPath = "/sys/class/leds/green/start_idx";
-const static std::string kBlueStartIdxPath = "/sys/class/leds/blue/start_idx";
-const static std::string kRedPauseLoPath = "/sys/class/leds/red/pause_lo";
-const static std::string kGreenPauseLoPath = "/sys/class/leds/green/pause_lo";
-const static std::string kBluePauseLoPath = "/sys/class/leds/blue/pause_lo";
-const static std::string kRedPauseHiPath = "/sys/class/leds/red/pause_hi";
-const static std::string kGreenPauseHiPath = "/sys/class/leds/green/pause_hi";
-const static std::string kBluePauseHiPath = "/sys/class/leds/blue/pause_hi";
-const static std::string kRedRampStepMsPath = "/sys/class/leds/red/ramp_step_ms";
-const static std::string kGreenRampStepMsPath = "/sys/class/leds/green/ramp_step_ms";
-const static std::string kBlueRampStepMsPath = "/sys/class/leds/blue/ramp_step_ms";
-const static std::string kRedBlinkPath = "/sys/class/leds/red/blink";
-const static std::string kGreenBlinkPath = "/sys/class/leds/green/blink";
-const static std::string kBlueBlinkPath = "/sys/class/leds/blue/blink";
-const static std::string kRgbBlinkPath = "/sys/class/leds/rgb/rgb_blink";
-
-int main() {
- uint32_t lcdMaxBrightness = 255;
-
- std::ofstream lcdBacklight(kLcdBacklightPath);
- if (!lcdBacklight) {
- LOG(ERROR) << "Failed to open " << kLcdBacklightPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ifstream lcdMaxBacklight(kLcdMaxBacklightPath);
- if (!lcdMaxBacklight) {
- LOG(ERROR) << "Failed to open " << kLcdMaxBacklightPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- } else {
- lcdMaxBacklight >> lcdMaxBrightness;
- }
-
- std::ofstream redLed(kRedLedPath);
- if (!redLed) {
- LOG(ERROR) << "Failed to open " << kRedLedPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream greenLed(kGreenLedPath);
- if (!greenLed) {
- LOG(ERROR) << "Failed to open " << kGreenLedPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream blueLed(kBlueLedPath);
- if (!blueLed) {
- LOG(ERROR) << "Failed to open " << kBlueLedPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream redDutyPcts(kRedDutyPctsPath);
- if (!redDutyPcts) {
- LOG(ERROR) << "Failed to open " << kRedDutyPctsPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream greenDutyPcts(kGreenDutyPctsPath);
- if (!greenDutyPcts) {
- LOG(ERROR) << "Failed to open " << kGreenDutyPctsPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream blueDutyPcts(kBlueDutyPctsPath);
- if (!blueDutyPcts) {
- LOG(ERROR) << "Failed to open " << kBlueDutyPctsPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream redStartIdx(kRedStartIdxPath);
- if (!redStartIdx) {
- LOG(ERROR) << "Failed to open " << kRedStartIdxPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream greenStartIdx(kGreenStartIdxPath);
- if (!greenStartIdx) {
- LOG(ERROR) << "Failed to open " << kGreenStartIdxPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream blueStartIdx(kBlueStartIdxPath);
- if (!blueStartIdx) {
- LOG(ERROR) << "Failed to open " << kBlueStartIdxPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream redPauseLo(kRedPauseLoPath);
- if (!redPauseLo) {
- LOG(ERROR) << "Failed to open " << kRedPauseLoPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream greenPauseLo(kGreenPauseLoPath);
- if (!greenPauseLo) {
- LOG(ERROR) << "Failed to open " << kGreenPauseLoPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream bluePauseLo(kBluePauseLoPath);
- if (!bluePauseLo) {
- LOG(ERROR) << "Failed to open " << kBluePauseLoPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream redPauseHi(kRedPauseHiPath);
- if (!redPauseHi) {
- LOG(ERROR) << "Failed to open " << kRedPauseHiPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream greenPauseHi(kGreenPauseHiPath);
- if (!greenPauseHi) {
- LOG(ERROR) << "Failed to open " << kGreenPauseHiPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream bluePauseHi(kBluePauseHiPath);
- if (!bluePauseHi) {
- LOG(ERROR) << "Failed to open " << kBluePauseHiPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream redRampStepMs(kRedRampStepMsPath);
- if (!redRampStepMs) {
- LOG(ERROR) << "Failed to open " << kRedRampStepMsPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream greenRampStepMs(kGreenRampStepMsPath);
- if (!greenRampStepMs) {
- LOG(ERROR) << "Failed to open " << kGreenRampStepMsPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream blueRampStepMs(kBlueRampStepMsPath);
- if (!blueRampStepMs) {
- LOG(ERROR) << "Failed to open " << kBlueRampStepMsPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream redBlink(kRedBlinkPath);
- if (!redBlink) {
- LOG(ERROR) << "Failed to open " << kRedBlinkPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream greenBlink(kGreenBlinkPath);
- if (!greenBlink) {
- LOG(ERROR) << "Failed to open " << kGreenBlinkPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream blueBlink(kBlueBlinkPath);
- if (!blueBlink) {
- LOG(ERROR) << "Failed to open " << kBlueBlinkPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- std::ofstream rgbBlink(kRgbBlinkPath);
- if (!rgbBlink) {
- LOG(ERROR) << "Failed to open " << kRgbBlinkPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- return -errno;
- }
-
- android::sp<ILight> service = new Light(
- {std::move(lcdBacklight), lcdMaxBrightness},
- std::move(redLed), std::move(greenLed), std::move(blueLed),
- std::move(redDutyPcts), std::move(greenDutyPcts), std::move(blueDutyPcts),
- std::move(redStartIdx), std::move(greenStartIdx), std::move(blueStartIdx),
- std::move(redPauseLo), std::move(greenPauseLo), std::move(bluePauseLo),
- std::move(redPauseHi), std::move(greenPauseHi), std::move(bluePauseHi),
- std::move(redRampStepMs), std::move(greenRampStepMs), std::move(blueRampStepMs),
- std::move(redBlink), std::move(greenBlink), std::move(blueBlink),
- std::move(rgbBlink));
-
- configureRpcThreadpool(1, true);
-
- android::status_t status = service->registerAsService();
-
- if (status != android::OK) {
- LOG(ERROR) << "Cannot register Light HAL service";
- return 1;
- }
-
- LOG(INFO) << "Light HAL Ready.";
- joinRpcThreadpool();
- // Under normal cases, execution will not reach this line.
- LOG(ERROR) << "Light HAL failed to join thread pool.";
- return 1;
-}
diff --git a/manifest.xml b/manifest.xml
index 5f19bd5..e6cf4ea 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -23,7 +23,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
-<manifest version="1.0" type="device" target-level="3">
+<manifest version="2.0" type="device" target-level="5">
<hal format="hidl">
<name>android.hardware.audio</name>
<transport>hwbinder</transport>
@@ -70,21 +70,10 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</interface>
</hal>
<hal format="hidl">
- <name>android.hardware.configstore</name>
- <transport>hwbinder</transport>
- <version>1.1</version>
- <interface>
- <name>ISurfaceFlingerConfigs</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
<name>android.hardware.drm</name>
<transport>hwbinder</transport>
<fqname>@1.2::ICryptoFactory/clearkey</fqname>
<fqname>@1.2::IDrmFactory/clearkey</fqname>
- <fqname>@1.2::ICryptoFactory/widevine</fqname>
- <fqname>@1.2::IDrmFactory/widevine</fqname>
</hal>
<hal format="hidl">
<name>android.hardware.gatekeeper</name>
@@ -96,17 +85,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</interface>
</hal>
<hal format="hidl">
- <name>android.hardware.gnss</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IGnss</name>
- <instance>default</instance>
- </interface>
- <fqname>@1.0::IGnss/default</fqname>
- <fqname>@1.0::IGnss/gnss_vendor</fqname>
- </hal>
- <hal format="hidl">
<name>android.hardware.graphics.allocator</name>
<transport>hwbinder</transport>
<version>2.0</version>
@@ -167,17 +145,10 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<hal format="hidl">
<name>android.hardware.radio</name>
<transport>hwbinder</transport>
- <version>1.1</version>
- <interface>
- <name>IRadio</name>
- <instance>slot1</instance>
- <instance>slot2</instance>
- </interface>
- <interface>
- <name>ISap</name>
- <instance>slot1</instance>
- <instance>slot2</instance>
- </interface>
+ <fqname>@1.2::ISap/slot1</fqname>
+ <fqname>@1.2::ISap/slot2</fqname>
+ <fqname>@1.4::IRadio/slot1</fqname>
+ <fqname>@1.4::IRadio/slot2</fqname>
</hal>
<hal format="hidl">
<name>android.hardware.sensors</name>
@@ -216,15 +187,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</interface>
</hal>
<hal format="hidl">
- <name>android.hardware.vibrator</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IVibrator</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
<name>com.qualcomm.qti.dpm.api</name>
<transport>hwbinder</transport>
<version>1.0</version>
@@ -234,24 +196,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</interface>
</hal>
<hal format="hidl">
- <name>com.qualcomm.qti.imscmservice</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IImsCmService</name>
- <instance>qti.ims.connectionmanagerservice</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>com.qualcomm.qti.uceservice</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IUceService</name>
- <instance>com.qualcomm.qti.uceservice</instance>
- </interface>
- </hal>
- <hal format="hidl">
<name>vendor.display.color</name>
<transport>hwbinder</transport>
<version>1.0</version>
@@ -288,35 +232,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</interface>
</hal>
<hal format="hidl">
- <name>vendor.qti.data.factory</name>
- <transport>hwbinder</transport>
- <version>1.1</version>
- <interface>
- <name>IFactory</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>vendor.qti.gnss</name>
- <transport>hwbinder</transport>
- <version>1.2</version>
- <interface>
- <name>ILocHidlGnss</name>
- <instance>gnss_vendor</instance>
- </interface>
- <fqname>@1.2::ILocHidlGnss/gnss_vendor</fqname>
- </hal>
- <hal format="hidl">
- <name>vendor.qti.gnss</name>
- <transport>hwbinder</transport>
- <version>2.0</version>
- <interface>
- <name>ILocHidlGnss</name>
- <instance>gnss_vendor</instance>
- </interface>
- <fqname>@2.0::ILocHidlGnss/gnss_vendor</fqname>
- </hal>
- <hal format="hidl">
<name>vendor.qti.hardware.alarm</name>
<transport>hwbinder</transport>
<version>1.0</version>
@@ -335,11 +250,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</interface>
</hal>
<hal format="hidl">
- <name>vendor.qti.hardware.iop</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- </hal>
- <hal format="hidl">
<name>vendor.qti.hardware.perf</name>
<transport>hwbinder</transport>
<version>1.0</version>
@@ -400,7 +310,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<hal format="hidl">
<name>vendor.qti.hardware.radio.qtiradio</name>
<transport>hwbinder</transport>
- <version>1.0</version>
+ <version>2.3</version>
<interface>
<name>IQtiRadio</name>
<instance>slot1</instance>
@@ -408,16 +318,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</interface>
</hal>
<hal format="hidl">
- <name>vendor.qti.hardware.radio.uim</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IUim</name>
- <instance>Uim0</instance>
- <instance>Uim1</instance>
- </interface>
- </hal>
- <hal format="hidl">
<name>vendor.qti.hardware.radio.uim_remote_client</name>
<transport>hwbinder</transport>
<version>1.0</version>
@@ -446,13 +346,14 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl">
- <name>vendor.qti.imsrtpservice</name>
+ <hal format="hidl">
+ <name>com.qualcomm.qti.uceservice</name>
<transport>hwbinder</transport>
<version>1.0</version>
+ <version>2.1</version>
<interface>
- <name>IRTPService</name>
- <instance>imsrtpservice</instance>
+ <name>IUceService</name>
+ <instance>com.qualcomm.qti.uceservice</instance>
</interface>
</hal>
</manifest>
diff --git a/msm8996.mk b/msm8996.mk
index f787598..a97ee7d 100755
--- a/msm8996.mk
+++ b/msm8996.mk
@@ -23,6 +23,9 @@
#
$(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_m.mk)
+# Add common definitions for Qualcomm
+$(call inherit-product, hardware/qcom-caf/common/common.mk)
+
# Get non-open-source specific aspects
$(call inherit-product, vendor/zuk/msm8996-common/msm8996-common-vendor.mk)
@@ -138,9 +141,12 @@ PRODUCT_PACKAGES += \
# Camera
PRODUCT_PACKAGES += \
+ android.hardware.camera.device@3.4:64 \
android.hardware.camera.provider@2.4-impl:32 \
android.hardware.camera.provider@2.4-service \
- camera.msm8996
+ android.hardware.camera.provider@2.5:64 \
+ camera.msm8996 \
+ libion.vendor
# Common init scripts
PRODUCT_PACKAGES += \
@@ -155,8 +161,8 @@ PRODUCT_PACKAGES += \
ueventd.qcom.rc
# ConfigPanel
-PRODUCT_PACKAGES += \
- ConfigPanel
+#PRODUCT_PACKAGES += \
+# ConfigPanel
# Display
PRODUCT_PACKAGES += \
@@ -178,8 +184,8 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/calib.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/calib.cfg
# Doze mode
-PRODUCT_PACKAGES += \
- ZukDoze
+#PRODUCT_PACKAGES += \
+# ZukDoze
# DPM
PRODUCT_PACKAGES += \
@@ -187,8 +193,7 @@ PRODUCT_PACKAGES += \
# DRM
PRODUCT_PACKAGES += \
- android.hardware.drm@1.2.vendor \
- android.hardware.drm@1.4-service.clearkey
+ android.hardware.drm@1.2.vendor
# fwk-detect
PRODUCT_PACKAGES += \
@@ -231,6 +236,7 @@ PRODUCT_PACKAGES += \
android.hidl.manager@1.0 \
android.hidl.manager@1.0.vendor \
android.hidl.memory@1.0.vendor \
+ libhidlmemory.vendor \
libhidltransport \
libhwbinder \
libhidltransport.vendor \
@@ -264,8 +270,8 @@ PRODUCT_PACKAGES += \
android.hardware.keymaster@3.0-service
# Lights
-PRODUCT_PACKAGES += \
- android.hardware.light@2.0-service.zuk_8996
+#PRODUCT_PACKAGES += \
+# android.hardware.light-service.zuk
# LiveDisplay
PRODUCT_PACKAGES += \
@@ -316,8 +322,8 @@ PRODUCT_COPY_FILES += \
# Protobuf
PRODUCT_PACKAGES += \
- libprotobuf-cpp-full-vendorcompat \
- libprotobuf-cpp-lite-vendorcompat
+ libprotobuf-cpp-full-vendorcompat \
+ libprotobuf-cpp-lite-vendorcompat
# QCOM
PRODUCT_COPY_FILES += \
@@ -333,9 +339,12 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.radio@1.4 \
android.hardware.radio@1.4.vendor \
- android.hardware.radio.config@1.0 \
- android.hardware.radio.config@1.0.vendor \
- librmnetctl
+ android.hardware.radio.config@1.2 \
+ android.hardware.radio.deprecated@1.0.vendor \
+ android.hardware.secure_element@1.0.vendor \
+ librmnetctl \
+ libnetutils.vendor \
+ libsqlite.vendor
# Seccomp policy
PRODUCT_COPY_FILES += \
@@ -343,8 +352,10 @@ PRODUCT_COPY_FILES += \
# Sensors
PRODUCT_PACKAGES += \
+ android.frameworks.sensorservice@1.0.vendor \
android.hardware.sensors@1.0-impl:64 \
- android.hardware.sensors@1.0-service
+ android.hardware.sensors@1.0-service \
+ libpower.vendor
# Telephony
PRODUCT_PACKAGES += \
@@ -367,33 +378,39 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
vendor.lineage.touch@1.0-service.zuk_8996
-# Trust HAL
-PRODUCT_PACKAGES += \
- vendor.lineage.trust@1.0-service
-
# USB
PRODUCT_PACKAGES += \
- android.hardware.usb@1.0-service
+ android.hardware.usb@1.3-service.basic
# Verity
-PRODUCT_SYSTEM_VERITY_PARTITION=/dev/block/bootdevice/by-name/system
-PRODUCT_VENDOR_VERITY_PARTITION=/dev/block/bootdevice/by-name/factory
-$(call inherit-product, build/target/product/verity.mk)
+# PRODUCT_SYSTEM_VERITY_PARTITION=/dev/block/bootdevice/by-name/system
+# PRODUCT_VENDOR_VERITY_PARTITION=/dev/block/bootdevice/by-name/factory
+# $(call inherit-product, build/target/product/verity.mk)
# Vibrator
PRODUCT_PACKAGES += \
- android.hardware.vibrator@1.0-impl:64 \
- android.hardware.vibrator@1.0-service
+ vendor.qti.hardware.vibrator.service
+
+PRODUCT_COPY_FILES += \
+ prebuilts/vndk/v29/arm64/arch-arm64-armv8-a/shared/vndk-sp/libcutils.so:$(TARGET_COPY_OUT_SYSTEM_EXT)/lib64/libcutils-v29.so \
+ prebuilts/vndk/v32/arm64/arch-arm64-armv8-a/shared/vndk-sp/libhidlbase.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libhidlbase-v32.so \
+ prebuilts/vndk/v32/arm64/arch-arm64-armv8-a/shared/vndk-sp/libhidlbase.so:$(TARGET_COPY_OUT_SYSTEM_EXT)/lib64/libhidlbase-v32.so \
+ prebuilts/vndk/v32/arm64/arch-arm64-armv8-a/shared/vndk-sp/libhidlbase.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libhidlbase-v32.so \
+ prebuilts/vndk/v33/arm64/arch-arm64-armv8-a/shared/vndk-sp/libutils.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libutils-v33.so
# WiFi
PRODUCT_PACKAGES += \
- android.hardware.wifi@1.0-service \
+ android.hardware.wifi-service \
libwpa_client \
hostapd \
WifiOverlay \
wpa_supplicant \
wpa_supplicant.conf
+# Configstore
+PRODUCT_PACKAGES += \
+ disable_configstore
+
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/wifi/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf \
$(LOCAL_PATH)/wifi/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf
diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc
index 17d7dd3..9c1f81e 100644
--- a/rootdir/etc/init.qcom.rc
+++ b/rootdir/etc/init.qcom.rc
@@ -117,10 +117,6 @@ on post-fs-data
mkdir /data/vendor/wifi/wpa 0770 wifi wifi
mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
- # Create netmgr log dir
- mkdir /data/vendor/netmgr 0770 radio radio
- chmod 0770 /data/vendor/netmgr
-
# Create the directories used by CnE subsystem
mkdir /data/vendor/connectivity 0771 radio radio
chown radio radio /data/vendor/connectivity
@@ -274,9 +270,6 @@ on boot
mkdir /mnt/vendor/persist/audio 0777 media audio
mkdir /mnt/vendor/persist/display 0770 system graphics
- # Create NETMGR daemon socket area
- mkdir /dev/socket/netmgr 0750 radio radio
-
# LED torch permissions
chown system system /sys/class/leds/led:torch_0/brightness
chmod 0666 /sys/class/leds/led:torch_0/brightness
@@ -297,11 +290,6 @@ on boot
chmod 0664 /sys/class/graphics/fb0/mode
chmod 0664 /sys/class/graphics/fb0/msm_cmd_autorefresh_en
- # Assign TCP buffer thresholds to be ceiling value of technology maximums
- # Increased technology maximums should be reflected here.
- write /proc/sys/net/core/rmem_max 8388608
- write /proc/sys/net/core/wmem_max 8388608
-
# Enable default router information in RA
write /proc/sys/net/ipv6/conf/default/accept_ra_defrtr 1
@@ -333,6 +321,9 @@ on boot
# Wifi firmware reload path
chown wifi wifi /sys/module/wlan/parameters/fwpath
+ start vendor.qcrild
+ start vendor.qcrild2
+
on property:sys.boot_completed=1
# Enable ZRAM on boot_complete
swapon_all /vendor/etc/fstab.qcom
@@ -377,18 +368,6 @@ service vendor.atfwd /vendor/bin/ATFWD-daemon
group system radio
writepid /dev/cpuset/system-background/tasks
-service vendor.netmgrd /vendor/bin/netmgrd
- class main
- user root
- group root wifi wakelock radio inet
- writepid /dev/cpuset/system-background/tasks
-
-service vendor.dataqti /vendor/bin/qti
- class main
- user radio
- group radio oem_2901 usb
- writepid /dev/cpuset/system-background/tasks
-
service vendor.sensors.qti /vendor/bin/sensors.qti
class core
user system
@@ -398,10 +377,6 @@ service vendor.sensors.qti /vendor/bin/sensors.qti
capabilities NET_BIND_SERVICE
writepid /dev/cpuset/system-background/tasks
-on property:ro.vendor.use_data_netmgrd=false
- # netmgr not supported on specific target
- stop vendor.netmgrd
-
# Adjust socket buffer to enlarge TCP receive window for high bandwidth
# but only if ro.data.large_tcp_window_size property is set.
on property:ro.data.large_tcp_window_size=true
@@ -410,6 +385,12 @@ on property:ro.data.large_tcp_window_size=true
on property:sys.sysctl.tcp_adv_win_scale=*
write /proc/sys/net/ipv4/tcp_adv_win_scale ${sys.sysctl.tcp_adv_win_scale}
+service vendor.qrtr-ns /vendor/bin/qrtr-ns -f
+ class core
+ user vendor_qrtr
+ group vendor_qrtr
+ capabilities NET_BIND_SERVICE
+
service loc_launcher /vendor/bin/loc_launcher
class late_start
user gps
@@ -432,13 +413,6 @@ on property:ro.data.large_tcp_window_size=true
# Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB)
write /proc/sys/net/ipv4/tcp_adv_win_scale 2
-service ril-daemon2 /vendor/bin/hw/rild -c 2
- class main
- user radio
- group radio cache inet misc audio log readproc wakelock
- capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW
- writepid /dev/cpuset/system-background/tasks
-
service vendor.qseecomd /vendor/bin/qseecomd
class core
user root
diff --git a/vendor_prop.mk b/vendor_prop.mk
index 25346d6..abddf20 100644
--- a/vendor_prop.mk
+++ b/vendor_prop.mk
@@ -85,7 +85,8 @@ PRODUCT_PROPERTY_OVERRIDES += \
persist.vendor.data.mode=concurrent \
persist.radio.aosp_usr_pref_sel=true \
persist.data.netmgrd.qos.enable=true \
- ro.vendor.use_data_netmgrd=true
+ ro.vendor.use_data_netmgrd=true \
+ persist.vendor.data.mode=concurrent
# Display
PRODUCT_PROPERTY_OVERRIDES += \
@@ -102,6 +103,7 @@ PRODUCT_PROPERTY_OVERRIDES += \
# Graphics
PRODUCT_PROPERTY_OVERRIDES += \
+ ro.hardware.egl=adreno \
debug.egl.hw=1 \
debug.renderengine.backend=skiaglthreaded \
debug.sf.hw=1 \
@@ -135,9 +137,9 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_PROPERTY_OVERRIDES += \
DEVICE_PROVISIONED=1 \
rild.libpath=/vendor/lib64/libril-qc-qmi-1.so \
- vendor.rild.libpath=/vendor/lib64/libril-qc-qmi-1.so \
ril.subscription.types=NV,RUIM \
ro.telephony.default_network=10 \
+ persist.vendor.radio.apm_sim_not_pwdn=1 \
telephony.lteOnCdmaDevice=1 \
android.telephony.apn-restore=24000 \
persist.vendor.qti.telephony.vt_cam_interface=1 \