Changeset View
Changeset View
Standalone View
Standalone View
native/android/app/src/cpp/PlatformSpecificTools.cpp
#include "jniHelpers.h" | |||||
#include <Tools/Logger.h> | #include <Tools/Logger.h> | ||||
#include <Tools/PlatformSpecificTools.h> | #include <Tools/PlatformSpecificTools.h> | ||||
#include <fbjni/fbjni.h> | #include <fbjni/fbjni.h> | ||||
using namespace facebook::jni; | using namespace facebook::jni; | ||||
class PlatformSpecificToolsJavaClass | class PlatformSpecificToolsJavaClass | ||||
: public JavaClass<PlatformSpecificToolsJavaClass> { | : public JavaClass<PlatformSpecificToolsJavaClass> { | ||||
Show All 16 Lines | public: | ||||
} | } | ||||
}; | }; | ||||
namespace comm { | namespace comm { | ||||
void PlatformSpecificTools::generateSecureRandomBytes( | void PlatformSpecificTools::generateSecureRandomBytes( | ||||
crypto::OlmBuffer &buffer, | crypto::OlmBuffer &buffer, | ||||
size_t size) { | size_t size) { | ||||
NativeAndroidAccessProvider::runTask([&buffer, size]() { | |||||
buffer = PlatformSpecificToolsJavaClass::generateSecureRandomBytes(size); | buffer = PlatformSpecificToolsJavaClass::generateSecureRandomBytes(size); | ||||
}); | |||||
} | } | ||||
std::string PlatformSpecificTools::getDeviceOS() { | std::string PlatformSpecificTools::getDeviceOS() { | ||||
return std::string{"android"}; | return std::string{"android"}; | ||||
} | } | ||||
} // namespace comm | } // namespace comm |