RM6785: Build dummy libmtkperf_client library
* Required for some vendor blobs that refuse to work without mtkpower
Signed-off-by: bengris32 <bengris32@protonmail.ch>
Change-Id: I5a3664d982b909a3b126f38d83bea6a5a14ef177
diff --git a/device.mk b/device.mk
index ab08056..3c5a2e3 100644
--- a/device.mk
+++ b/device.mk
@@ -234,6 +234,10 @@
android.hardware.power-service.RM6785-libperfmgr \
android.hardware.power@1.3.vendor:64
+PRODUCT_PACKAGES += \
+ libmtkperf_client_vendor \
+ libmtkperf_client
+
# Properties
include $(LOCAL_PATH)/vendor_prop.mk
PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true
diff --git a/libmtkperf_client/Android.bp b/libmtkperf_client/Android.bp
new file mode 100644
index 0000000..86bfcb5
--- /dev/null
+++ b/libmtkperf_client/Android.bp
@@ -0,0 +1,22 @@
+//
+// Copyright (C) 2022 The LineageOS Project
+//
+// SPDX-License-Identifier: Apache-2.0
+//
+
+cc_defaults {
+ name: "libmtkperf_client_defaults",
+ srcs: ["client.c"],
+ shared_libs: ["liblog"],
+}
+
+cc_library_shared {
+ name: "libmtkperf_client_vendor",
+ vendor: true,
+ defaults: ["libmtkperf_client_defaults"],
+}
+
+cc_library_shared {
+ name: "libmtkperf_client",
+ defaults: ["libmtkperf_client_defaults"],
+}
diff --git a/libmtkperf_client/client.c b/libmtkperf_client/client.c
new file mode 100644
index 0000000..8bf820a
--- /dev/null
+++ b/libmtkperf_client/client.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2022 The LineageOS Project
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#define LOG_TAG "libmtkperf_client"
+
+#include <log/log.h>
+
+int perf_lock_acq(int hdl, int dur, long num, unsigned int tid) {
+ ALOGI("[%s] hdl: %d, dur: %d, num: %ld, tid: %u",
+ __func__, hdl, dur, num, tid);
+ if (hdl > 0)
+ return hdl;
+
+ return 233;
+}
+
+int perf_lock_rel(int hdl) {
+ ALOGI("[%s] hdl: %d", __func__, hdl);
+ return 0;
+}
+
+int perf_cus_lock_hint(int hint, int dur) {
+ ALOGI("[%s], hint: %d, dur: %d", __func__, hint, dur);
+ return 233;
+}
diff --git a/proprietary-files.txt b/proprietary-files.txt
index 3a46216..a925a2a 100644
--- a/proprietary-files.txt
+++ b/proprietary-files.txt
@@ -1577,13 +1577,11 @@
-odm/lib64/vendor.oplus.hardware.orms@1.0.so
# Power - from RMX2151_11_F.01
--vendor/lib/libmtkperf_client_vendor.so|a9ed1c2fc43418acff7649e0c473cc7e6181d794
-vendor/lib/vendor.mediatek.hardware.mtkpower@1.0.so|f350c31eb955fc3e20f330454098cebc415699ce
-vendor/lib/vendor.mediatek.hardware.mtkpower@1.1.so|249c6ea84b1ccfc5f9ff3a001ef484f236dcd1a5
-vendor/lib/vendor.mediatek.hardware.mtkpower@1.2.so|aa65a5f207947403b300779e947f642e66bd133d
-vendor/lib/vendor.mediatek.hardware.power@1.1.so|d0c5a57a7a864791d5278551f7b5d61d9ad127d8
-vendor/lib/vendor.mediatek.hardware.power@2.0.so|455d3022046a7acba0401e87ae1b3c6527531cc1
--vendor/lib64/libmtkperf_client_vendor.so|fd4dc0543991f1d69845b6db7872067eeca687a9
-vendor/lib64/vendor.mediatek.hardware.mtkpower@1.0.so|6e42e6b98d765ca7b3d494e8ff4b6749fb4d4161
-vendor/lib64/vendor.mediatek.hardware.mtkpower@1.1.so|9e4c12340077570b34f76749d43934e3977553bf
-vendor/lib64/vendor.mediatek.hardware.mtkpower@1.2.so|9f74a72428b077d9c1016805727ed169eef7e593
@@ -1808,7 +1806,6 @@
etc/init/init.vtservice.rc|abcbc3ffc316b8f1cedffa949aac3b46670d64bc
-lib/libmtk_vt_wrapper.so|f83f677349f369dbe52a310250b93bf66993652e
-lib/libmtkavenhancements.so|675c10ceb669661fcd9fcb7f1f4001a641c4dbd0
--lib/libmtkperf_client.so|94780076b9a39bffde43870d50ba306d6a89fd96
-lib/libvcodec_cap.so|829cd1d4f0e73fbefd38e4818896f162f7e10472
-lib/libvcodec_capenc.so|24d1236c6027f07b2a258410aa9a331d68c56112
-lib/libvsim-adaptor-client.so|7bbcbe504de8b115b6bc5e0d7b16c62769885c6e
@@ -1820,7 +1817,6 @@
-lib64/libmtk_vt_service.so|aab169313bb8dffe44747c7bdbf5ebb33c75b91c
-lib64/libmtk_vt_wrapper.so|63fff84c494281b02b362706ea9495aa12fbd0d1
-lib64/libmtkavenhancements.so|24237b8f7c835696d3147c66464316b1ec5e84ae
--lib64/libmtkperf_client.so|e25e5af60b58f390ad46832e9dcfb9a298b62fec
-lib64/libsignal.so|305fff9001375c02fb8c41967666eb51bb14d478
-lib64/libsink.so|df2585e4acd91613e29e93bef6a25855d296bbb2
-lib64/libsource.so|407a73931c1dbe8bd16ceca664099b5bd77e4769