diff options
| author | Sultan Qasim Khan <sultanqasim@gmail.com> | 2016-09-11 12:53:32 -0400 |
|---|---|---|
| committer | Sultan Qasim Khan <sultanqasim@gmail.com> | 2016-09-11 12:53:32 -0400 |
| commit | 7a2a454eba5a5f6e695548474fea9fd8955873aa (patch) | |
| tree | f4d821f32bcb26d345fa1a3903c7c17fa6925ee5 | |
| parent | a3893d8f5728bc0c4b031b4ca9cdfcee74eb3c1b (diff) | |
condor: init: switch to C++ style strings
Change-Id: I37b069810d5a7821144d2b083907136d252e0628
| -rw-r--r-- | init/init_condor.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/init/init_condor.cpp b/init/init_condor.cpp index 893c11b..7bb88b7 100644 --- a/init/init_condor.cpp +++ b/init/init_condor.cpp @@ -35,22 +35,19 @@ #include "log.h" #include "util.h" -#define ISMATCH(a,b) (!strncmp(a,b,PROP_VALUE_MAX)) - void vendor_load_properties() { - char platform[PROP_VALUE_MAX]; - char radio[PROP_VALUE_MAX]; - char device[PROP_VALUE_MAX]; - int rc; + std::string platform; + std::string radio; + std::string device; - rc = property_get("ro.board.platform", platform); - if (!rc || !ISMATCH(platform, ANDROID_TARGET)) + platform = property_get("ro.board.platform"); + if (platform != ANDROID_TARGET) return; property_set("ro.product.model", "Moto E"); - property_get("ro.boot.radio", radio); - if (ISMATCH(radio, "0x1")) { + radio = property_get("ro.boot.radio"); + if (radio == "0x1") { /* xt1021 */ property_set("ro.product.device", "condor_umts"); property_set("ro.build.product", "condor_umts"); @@ -59,7 +56,7 @@ void vendor_load_properties() property_set("ro.mot.build.customerid", "reteu"); property_set("ro.telephony.default_network", "0"); property_set("persist.radio.multisim.config", ""); - } else if (ISMATCH(radio, "0x5")) { + } else if (radio == "0x5") { /* xt1022 */ property_set("ro.product.device", "condor_umtsds"); property_set("ro.build.product", "condor_umtsds"); @@ -71,7 +68,7 @@ void vendor_load_properties() property_set("persist.radio.multisim.config", "dsds"); property_set("persist.radio.dont_use_dsd", "true"); property_set("persist.radio.plmn_name_cmp", "1"); - } else if (ISMATCH(radio, "0x6")) { + } else if (radio == "0x6") { /* xt1023 */ property_set("ro.product.device", "condor_umts"); property_set("ro.build.product", "condor_umts"); @@ -81,6 +78,6 @@ void vendor_load_properties() property_set("ro.telephony.default_network", "0"); property_set("persist.radio.multisim.config", ""); } - property_get("ro.product.device", device); - INFO("Found radio id: %s setting build properties for %s device\n", radio, device); + device = property_get("ro.product.device"); + INFO("Found radio id: %s setting build properties for %s device\n", radio.c_str(), device.c_str()); } |
