universal7885: Major (de)commonize due to prev commit

This commit is contained in:
roynatech2544 2021-12-02 20:00:00 +09:00
commit 07b209df81
No known key found for this signature in database
GPG key ID: 9675C32163D88D30
31 changed files with 606 additions and 66 deletions

View file

@ -13,10 +13,10 @@
// limitations under the License.
cc_library_static {
name: "libinit_universal7884B",
name: "libinit_universal7885",
recovery_available: true,
whole_static_libs: ["libbase"],
header_libs: ["libbase_headers"],
srcs: ["init_universal7884B.cpp"],
srcs: ["init_universal7885.cpp"],
include_dirs: ["system/core/init"]
}

View file

@ -71,6 +71,14 @@ 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) {
if (fullString.length() >= ending.length()) {
return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending));
} else {
return false;
}
}
void vendor_load_properties() {
string model;
@ -79,8 +87,8 @@ void vendor_load_properties() {
model = GetProperty("ro.boot.em.model", "");
}
if (model == "SM-A205FN" || model == "SM-A205GN" || model == "SM-A202K" || model == "SM-A205YN") {
property_override("ro.boot.product.hardware.sku", "NFC");
if (hasEnding(model, "N") || hasEnding(model, "S") || hasEnding(model, "K")) {
property_override("ro.boot.product.hardware.sku", "NFC");
}
set_ro_build_prop("model", model);