Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff5bbd26 authored by xianfeng.pan's avatar xianfeng.pan Committed by yujinyao
Browse files

Mask phone number log to avoid personal information leakage in logs

[Root Cuase]
someone(like: hacker) may get this phonenumber from logcat log, and this is private personal information.

[Solution]
mask phone number in logs.

Bug: 301369984
Test: atest packages/modules/Bluetooth/system pass

Flag: EXEMPT logs only change
Change-Id: I069b40eb104d55139b620085dad1a83ada4f3012
parent 7f2e59e5
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -552,14 +552,16 @@ static void bta_hf_client_handle_bvra(tBTA_HF_CLIENT_CB* client_cb,

static void bta_hf_client_handle_clip(tBTA_HF_CLIENT_CB* client_cb,
                                      char* numstr, uint32_t type) {
  LOG_VERBOSE("%s: %u %s", __func__, type, numstr);
  std::string cell_number(numstr);
  LOG_VERBOSE("%s: %u %s", __func__, type, PRIVATE_CELL(cell_number));

  bta_hf_client_clip(client_cb, numstr);
}

static void bta_hf_client_handle_ccwa(tBTA_HF_CLIENT_CB* client_cb,
                                      char* numstr, uint32_t type) {
  LOG_VERBOSE("%s: %u %s", __func__, type, numstr);
  std::string cell_number(numstr);
  LOG_VERBOSE("%s: %u %s", __func__, type, PRIVATE_CELL(cell_number));

  bta_hf_client_ccwa(client_cb, numstr);
}
@@ -573,7 +575,8 @@ static void bta_hf_client_handle_cops(tBTA_HF_CLIENT_CB* client_cb, char* opstr,

static void bta_hf_client_handle_binp(tBTA_HF_CLIENT_CB* client_cb,
                                      char* numstr) {
  LOG_VERBOSE("%s: %s", __func__, numstr);
  std::string cell_number(numstr);
  LOG_VERBOSE("%s: %s", __func__, PRIVATE_CELL(cell_number));

  bta_hf_client_binp(client_cb, numstr);
}
@@ -587,7 +590,8 @@ static void bta_hf_client_handle_clcc(tBTA_HF_CLIENT_CB* client_cb,
              dir, status, mode, mpty);

  if (numstr) {
    LOG_VERBOSE("%s: number: %s  type: %u", __func__, numstr, type);
    std::string cell_number(numstr);
    LOG_VERBOSE("%s: number: %s  type: %u", __func__, PRIVATE_CELL(cell_number), type);
  }

  bta_hf_client_clcc(client_cb, idx, dir, status, mpty, numstr);
@@ -596,7 +600,8 @@ static void bta_hf_client_handle_clcc(tBTA_HF_CLIENT_CB* client_cb,
static void bta_hf_client_handle_cnum(tBTA_HF_CLIENT_CB* client_cb,
                                      char* numstr, uint16_t type,
                                      uint16_t service) {
  LOG_VERBOSE("%s: number: %s type: %u service: %u", __func__, numstr, type,
  std::string cell_number(numstr);
  LOG_VERBOSE("%s: number: %s type: %u service: %u", __func__, PRIVATE_CELL(cell_number), type,
              service);

  /* TODO: should number be modified according to type? */