Roll forward to cl/314549634

Change-Id: I4d1e7eacd5fa4078a094571ad6d5f51e422535ff
This commit is contained in:
Himanshu Jaju
2020-06-03 11:18:32 -07:00
committed by Alexey Polyudov
parent ae1c427b99
commit cffbc04508
92 changed files with 3804 additions and 697 deletions
+1
View File
@@ -14,6 +14,7 @@ cc_library(
"//platform:types",
"//platform:utils",
"//platform/api",
"//platform/impl/shared:file",
"//platform/impl/shared/sample:sample_wifi_medium",
"//platform/port:string",
"//absl/time",
+17 -4
View File
@@ -20,6 +20,7 @@
#include "platform/cancelable.h"
#include "platform/impl/sample/atomic_reference_impl.h"
#include "platform/impl/sample/settable_future_impl.h"
#include "platform/impl/shared/file_impl.h"
#include "platform/impl/shared/sample/sample_wifi_medium.h"
#include "platform/port/string.h"
#include "platform/ptr.h"
@@ -30,6 +31,12 @@ namespace location {
namespace nearby {
namespace platform {
namespace {
std::string getPayloadPath(std::int64_t payload_id) {
return "/tmp/sample-" + std::to_string(payload_id);
}
} // namespace
Ptr<ScheduledExecutor> ImplementationPlatform::createScheduledExecutor() {
return Ptr<ScheduledExecutor>{};
}
@@ -80,6 +87,16 @@ Ptr<AtomicBoolean> ImplementationPlatform::createAtomicBoolean(
return Ptr<AtomicBoolean>{};
}
Ptr<InputFile> ImplementationPlatform::createInputFile(
std::int64_t payload_id, std::int64_t total_size) {
return MakePtr(new InputFileImpl(getPayloadPath(payload_id), total_size));
}
Ptr<OutputFile> ImplementationPlatform::createOutputFile(
std::int64_t payload_id) {
return MakePtr(new OutputFileImpl(getPayloadPath(payload_id)));
}
Ptr<BluetoothClassicMedium>
ImplementationPlatform::createBluetoothClassicMedium() {
return Ptr<BluetoothClassicMedium>();
@@ -116,10 +133,6 @@ Ptr<HashUtils> ImplementationPlatform::createHashUtils() {
std::string ImplementationPlatform::getDeviceId() { return "sample"; }
std::string ImplementationPlatform::getPayloadPath(int64_t payload_id) {
return "/tmp/sample-" + std::to_string(payload_id);
}
} // namespace platform
} // namespace nearby
} // namespace location