From 70c6f3833b38891ae904307a88a61735f2d30ab2 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Sun, 21 Feb 2016 02:57:44 +0200 Subject: [PATCH] msm8974-common: Allow vendor init to override props Change-Id: Iee06664aee1e59596aa12e2da11319f82767193a --- init/init_msm8974.cpp | 14 ++++++++++++++ init/init_msm8974.h | 1 + 2 files changed, 15 insertions(+) diff --git a/init/init_msm8974.cpp b/init/init_msm8974.cpp index 0807d89..c331bf4 100644 --- a/init/init_msm8974.cpp +++ b/init/init_msm8974.cpp @@ -34,6 +34,9 @@ #include #include +#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ +#include + #include "vendor_init.h" #include "property_service.h" #include "log.h" @@ -46,6 +49,17 @@ void init_target_properties() { } +void property_override(char const prop[], char const value[]) +{ + prop_info *pi; + + pi = (prop_info*) __system_property_find(prop); + if (pi) + __system_property_update(pi, value, strlen(value)); + else + __system_property_add(prop, strlen(prop), value, strlen(value)); +} + static int read_file2(const char *fname, char *data, int max_size) { int fd, rc; diff --git a/init/init_msm8974.h b/init/init_msm8974.h index 587b76e..2c11511 100644 --- a/init/init_msm8974.h +++ b/init/init_msm8974.h @@ -31,5 +31,6 @@ #define __INIT_MSM8974__H__ void init_target_properties(); +void property_override(char const prop[], char const value[]); #endif /* __INIT_MSM8974__H__ */