Skip to content

Commit

Permalink
falcon init: Kill ISMATCH
Browse files Browse the repository at this point in the history
* Let's use c++ std::string

Change-Id: If2fc2c235e227008984308ea37c24f32876d66c8
  • Loading branch information
luca020400 authored and Gabriele M committed Sep 6, 2016
1 parent 5fdcc9c commit ca2691d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions init/init_falcon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include "log.h"
#include "util.h"

#define ISMATCH(a,b) (!strncmp(a,b,PROP_VALUE_MAX))

enum supported_carrier {
UNKNOWN = -1,
VERIZON,
Expand All @@ -63,7 +61,7 @@ static enum supported_carrier detect_sprint_mvno(void)
static enum supported_carrier detect_carrier(void)
{
std::string carrier = property_get("ro.boot.carrier");
if (ISMATCH(carrier.c_str(), "vzw")) {
if (carrier == "vzw") {
return VERIZON;
} else if (access("/pds/public/usc", F_OK) != -1) {
return USC;
Expand All @@ -77,13 +75,13 @@ static enum supported_carrier detect_carrier(void)
void vendor_load_properties()
{
std::string platform = property_get("ro.board.platform");
if (!ISMATCH(platform.c_str(), ANDROID_TARGET))
if (platform != ANDROID_TARGET)
return;

property_set("ro.product.model", "Moto G");

std::string radio = property_get("ro.boot.radio");
if (ISMATCH(radio.c_str(), "0x1")) {
if (radio == "0x1") {
if (access("/dev/block/platform/msm_sdcc.1/by-name/metadata", F_OK) != -1) {
/* xt1032 GPE */
property_set("ro.product.device", "falcon_gpe");
Expand All @@ -103,7 +101,7 @@ void vendor_load_properties()
property_set("ro.telephony.default_network", "0");
property_set("persist.radio.multisim.config", "");
}
} else if (ISMATCH(radio.c_str(), "0x3")) {
} else if (radio == "0x3") {
switch (detect_carrier()) {
case VERIZON:
property_set("ro.build.description", "falcon_verizon-user 5.1 LPB23.13-33.7 7 release-keys");
Expand Down Expand Up @@ -172,7 +170,7 @@ void vendor_load_properties()
property_set("ro.gsm.data_retry_config", "default_randomization=2000,max_retries=infinite,1000,1000,80000,125000,485000,905000");
property_set("ro.mot.ignore_csim_appid", "true");
property_set("telephony.lteOnCdmaDevice", "0");
} else if (ISMATCH(radio.c_str(), "0x5")) {
} else if (radio == "0x5") {
/* xt1033 */
property_set("ro.product.device", "falcon_umtsds");
property_set("ro.build.description", "falcon_retbr_ds-user 5.1 LPB23.13-56 58 release-keys");
Expand All @@ -184,7 +182,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.c_str(), "0x6")) {
} else if (radio == "0x6") {
/* xt1034 */
property_set("ro.product.device", "falcon_umts");
property_set("ro.build.description", "falcon_retuaws-user 5.1 LPB23.13-58 61 release-keys");
Expand Down

0 comments on commit ca2691d

Please sign in to comment.