/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/Platform/Android/UuidGenerator_Android.cpp
27 строк
923 B
Jan Krassnigg
Refactor of platform specific includes (#1414)
23 окт 2024, 10:09
Не верифицирован
23 окт 2024, 10:09
74f6d97
Код
Авторство
О чём код?
#include <Foundation/FoundationPCH.h> #if EZ_ENABLED(EZ_PLATFORM_ANDROID) # include <Foundation/Types/Uuid.h> # include <Foundation/Platform/Android/Utils/AndroidJni.h> # include <Foundation/Platform/Android/Utils/AndroidUtils.h> # include <android_native_app_glue.h> ezUuid ezUuid::MakeUuid() { ezJniAttachment attachment; ezJniClass uuidClass("java/util/UUID"); EZ_ASSERT_DEBUG(!uuidClass.IsNull(), "UUID class not found."); ezJniObject javaUuid = uuidClass.CallStatic<ezJniObject>("randomUUID"); jlong mostSignificant = javaUuid.Call<jlong>("getMostSignificantBits"); jlong leastSignificant = javaUuid.Call<jlong>("getLeastSignificantBits"); return ezUuid(leastSignificant, mostSignificant); // #TODO maybe faster to read /proc/sys/kernel/random/uuid, but that can't be done via ezOSFile // see https://stackoverflow.com/questions/11888055/include-uuid-h-into-android-ndk-project } #endif