Convert LDT Rust to a normal define

PiperOrigin-RevId: 531318262
This commit is contained in:
Anay Wadhera
2023-05-11 15:09:04 -07:00
committed by Copybara-Service
parent b19d4fb279
commit 9dff873424
6 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ cc_library(
"service_controller_impl.h",
],
defines = select({
":norust_or_windows_or_android": ["USE_RUST_LDT=0"],
":norust_or_windows_or_android": [],
"//conditions:default": ["USE_RUST_LDT=1"],
}),
visibility = [
@@ -38,7 +38,6 @@ using ::nearby::ByteArray; // NOLINT
using ::nearby::internal::IdentityType;
using ::nearby::internal::SharedCredential; // NOLINT
using ::testing::ElementsAre;
using ::protobuf_matchers::EqualsProto;
using ::testing::Matcher;
using ::testing::Pointwise;
using ::testing::Return;
@@ -55,7 +54,7 @@ ScanRequest GetScanRequest() {
IdentityType::IDENTITY_TYPE_PROVISIONED}};
}
#if USE_RUST_LDT == 1
#ifdef USE_RUST_LDT
ScanRequest GetScanRequest(std::vector<SharedCredential> credentials) {
LegacyPresenceScanFilter scan_filter = {.remote_public_credentials =
credentials};
@@ -40,7 +40,7 @@ using ::testing::NiceMock;
using ::testing::Return;
using ::testing::status::StatusIs;
#if USE_RUST_LDT == 1
#ifdef USE_RUST_LDT
LocalCredential CreateLocalCredential(IdentityType identity_type) {
// Values copied from LDT tests
ByteArray seed({204, 219, 36, 137, 233, 252, 172, 66, 179, 147, 72,
+1 -1
View File
@@ -22,7 +22,7 @@
#include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#if USE_RUST_LDT == 1
#ifdef USE_RUST_LDT
#include "third_party/beto-core/src/nearby/presence/ldt_np_adv_ffi/include/np_ldt.h"
#else
#include "presence/implementation/np_ldt.h"
+1 -1
View File
@@ -20,7 +20,7 @@
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#if USE_RUST_LDT == 1
#ifdef USE_RUST_LDT
#include "third_party/beto-core/src/nearby/presence/ldt_np_adv_ffi/include/np_ldt.h"
#else
#include "presence/implementation/np_ldt.h"
+1 -1
View File
@@ -29,7 +29,7 @@ namespace {
using ::nearby::ByteArray;
using ::nearby::internal::SharedCredential;
#if USE_RUST_LDT == 1
#ifdef USE_RUST_LDT
// Test data from Android tests.
constexpr absl::string_view kKeySeedBase16 =