mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-22 04:05:31 -04:00
universal7885: run clang-format based on system-clang-format
* On every *.cpp *.h files Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
parent
6bc1c25485
commit
098179eabb
47 changed files with 1545 additions and 1709 deletions
|
|
@ -30,8 +30,8 @@
|
|||
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
|
||||
#include <sys/_system_properties.h>
|
||||
|
||||
#include <android-base/properties.h>
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/properties.h>
|
||||
|
||||
#include "property_service.h"
|
||||
#include "vendor_init.h"
|
||||
|
|
@ -40,28 +40,23 @@ using android::base::GetProperty;
|
|||
using std::string;
|
||||
|
||||
std::vector<std::string> ro_props_default_source_order = {
|
||||
"",
|
||||
"odm.",
|
||||
"product.",
|
||||
"system.",
|
||||
"system_ext.",
|
||||
"vendor.",
|
||||
"", "odm.", "product.", "system.", "system_ext.", "vendor.",
|
||||
};
|
||||
|
||||
void property_override(char const prop[], char const value[], bool add = true) {
|
||||
prop_info *pi;
|
||||
prop_info* pi;
|
||||
|
||||
pi = (prop_info*) __system_property_find(prop);
|
||||
pi = (prop_info*)__system_property_find(prop);
|
||||
if (pi)
|
||||
__system_property_update(pi, value, strlen(value));
|
||||
else if (add)
|
||||
__system_property_add(prop, strlen(prop), value, strlen(value));
|
||||
}
|
||||
|
||||
void set_ro_build_prop(const std::string &prop, const std::string &value, bool product = true) {
|
||||
void set_ro_build_prop(const std::string& prop, const std::string& value, bool product = true) {
|
||||
string prop_name;
|
||||
|
||||
for (const auto &source : ro_props_default_source_order) {
|
||||
for (const auto& source : ro_props_default_source_order) {
|
||||
if (product)
|
||||
prop_name = "ro.product." + source + prop;
|
||||
else
|
||||
|
|
@ -71,10 +66,11 @@ void set_ro_build_prop(const std::string &prop, const std::string &value, bool p
|
|||
}
|
||||
}
|
||||
|
||||
bool hasEnding (std::string const &fullString, std::string const &ending) {
|
||||
bool hasEnding(std::string const& fullString, std::string const& ending) {
|
||||
if (fullString.length() >= ending.length()) {
|
||||
return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending));
|
||||
} else {
|
||||
return (0 ==
|
||||
fullString.compare(fullString.length() - ending.length(), ending.length(), ending));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -83,12 +79,13 @@ void vendor_load_properties() {
|
|||
string model;
|
||||
|
||||
model = GetProperty("ro.boot.product.model", "");
|
||||
if(model.empty()){
|
||||
if (model.empty()) {
|
||||
model = GetProperty("ro.boot.em.model", "");
|
||||
}
|
||||
|
||||
if (hasEnding(model, "N") || hasEnding(model, "S") || hasEnding(model, "K") || model == "SM-A202F") {
|
||||
property_override("ro.boot.product.hardware.sku", "NFC");
|
||||
if (hasEnding(model, "N") || hasEnding(model, "S") || hasEnding(model, "K") ||
|
||||
model == "SM-A202F") {
|
||||
property_override("ro.boot.product.hardware.sku", "NFC");
|
||||
}
|
||||
|
||||
set_ro_build_prop("model", model);
|
||||
|
|
|
|||
Loading…
Reference in a new issue