aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordev-harsh1998 <harshit.india@linaro.org>2017-09-06 00:46:11 +0530
committerdev-harsh1998 <harshitjain6751@gmail.com>2017-10-18 12:41:46 +0530
commitaf0544f09026eb018d2f2a93860c5be311bb9c10 (patch)
treebf67af807fe824de9c820127bc2e158be68c9eae
parent427170cd9c15fbacd15be7aa4cf53c715e7fafc8 (diff)
a6000: libshims: Add gps shims to get gps to load and work
* I personally never wanted to add shim but now device is old and our hal requires it to work on oreo * Kanged & Adapted from luca stefni's xiaomi msm8996 repo Change-Id: I4949536417c70aa50cc106ad2304438b922a0b3f
-rw-r--r--libshims/Android.mk36
-rw-r--r--libshims/flp/flp.c10
-rw-r--r--libshims/get_process_name/get_process_name.c21
-rw-r--r--product/qcom-gps.mk4
-rw-r--r--rootdir/etc/init.target.rc3
5 files changed, 73 insertions, 1 deletions
diff --git a/libshims/Android.mk b/libshims/Android.mk
new file mode 100644
index 0000000..5ea84fa
--- /dev/null
+++ b/libshims/Android.mk
@@ -0,0 +1,36 @@
+#
+# 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.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ flp/flp.c
+
+LOCAL_MODULE := libshims_flp
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ get_process_name/get_process_name.c
+
+LOCAL_MODULE := libshims_get_process_name
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/libshims/flp/flp.c b/libshims/flp/flp.c
new file mode 100644
index 0000000..ee6970f
--- /dev/null
+++ b/libshims/flp/flp.c
@@ -0,0 +1,10 @@
+// Logging Improvements
+const char *loc_logger_boolStr[]={"False","True"};
+const char VOID_RET[] = "None";
+const char FROM_AFW[] = "===>";
+const char TO_MODEM[] = "--->";
+const char FROM_MODEM[] = "<---";
+const char TO_AFW[] = "<===";
+const char EXIT_TAG[] = "Exiting";
+const char ENTRY_TAG[] = "Entering";
+const char EXIT_ERROR_TAG[] = "Exiting with error";
diff --git a/libshims/get_process_name/get_process_name.c b/libshims/get_process_name/get_process_name.c
new file mode 100644
index 0000000..a25985c
--- /dev/null
+++ b/libshims/get_process_name/get_process_name.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+static const char* process_name = "unknown";
+
+const char* get_process_name(void) {
+ return process_name;
+}
diff --git a/product/qcom-gps.mk b/product/qcom-gps.mk
index ea9b16b..cd99bdd 100644
--- a/product/qcom-gps.mk
+++ b/product/qcom-gps.mk
@@ -1,7 +1,9 @@
# GPS
PRODUCT_PACKAGES += \
android.hardware.gnss@1.0-impl \
- gps.msm8916
+ gps.msm8916 \
+ libshims_flp \
+ libshims_get_process_name
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/gps/flp.conf:system/etc/flp.conf \
diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc
index b5b9251..619194b 100644
--- a/rootdir/etc/init.target.rc
+++ b/rootdir/etc/init.target.rc
@@ -29,6 +29,9 @@ on early-init
#set non-stand-charger can used
write /sys/module/phy_msm_usb/parameters/floated_charger_enable Y
+on init
+ export LD_SHIM_LIBS /system/vendor/lib64/libflp.so|libshims_flp.so:/system/vendor/lib64/libizat_core.so|libshims_get_process_name.so
+
on boot
# charger
chown system system /sys/bus/i2c/drivers/lc709203/batt_capacity