!2469 debug default account to bypass disc

Merge pull request !2469 from 刘宝/dev_disc
This commit is contained in:
openharmony_ci 2022-09-28 14:56:38 +00:00 committed by Gitee
commit 23193930a3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 4 additions and 2 deletions

View File

@ -59,7 +59,7 @@ int32_t LnnGetOhosAccountInfo(uint8_t *accountHash, uint32_t len)
accountInfo.second.uid_ == DEFAULT_USER_ID ||
accountInfo.second.uid_ == OHOS::AccountSA::DEFAULT_OHOS_ACCOUNT_UID) {
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "LnnGetOhosAccountInfo get default user id");
return SOFTBUS_ERR;
return SOFTBUS_OK;
}
return ConvertHexStringToBytes((unsigned char *)accountHash, len,

View File

@ -14,6 +14,7 @@
import("//foundation/communication/dsoftbus/dsoftbus.gni")
ble_discovery_inc = [
"$dsoftbus_root_path/core/adapter/bus_center/include",
"$dsoftbus_root_path/core/discovery/ble/include",
"$dsoftbus_root_path/core/common/include",
]

View File

@ -24,6 +24,7 @@
#include "disc_manager.h"
#include "discovery_service.h"
#include "lnn_device_info.h"
#include "lnn_ohos_account.h"
#include "message_handler.h"
#include "securec.h"
#include "softbus_adapter_ble_gatt.h"
@ -362,7 +363,7 @@ static bool ProcessHwHashAccout(DeviceInfo *foundInfo)
SoftBusLog(SOFTBUS_LOG_DISC, SOFTBUS_LOG_ERROR, "DiscBleGetShortUserIdHash error");
return false;
}
if ((accountIdHash[0] & BYTE_MASK) == 0 && (accountIdHash[1] & BYTE_MASK) == 0) {
if (LnnIsDefaultOhosAccount()) {
return false;
}
if (memcmp(accountIdHash, foundInfo->accountHash, SHORT_USER_ID_HASH_LEN) == 0) {