revamp android backend initialization error handling and bump the senseglove libraries to the latest experimental ble builds

This commit is contained in:
Mamadou Babaei
2025-05-09 16:35:04 +02:00
parent 06ce43de6f
commit 524a828e71
72 changed files with 135 additions and 111 deletions
@@ -137,7 +137,7 @@ void USGAndroidPermissions::OnPermissionsGranted(const TArray<FString>& Permissi
return;
}
for (int32 i = 0; i < Permissions.Num(); i++)
for (int32 i = 0; i < Permissions.Num(); ++i)
{
if (GrantResults[i])
{
@@ -54,7 +54,7 @@
int32 FSGConnectJNI::Initialize()
{
int32 Result = -999999;
int32 Result = -1000;
#if PLATFORM_ANDROID
static constexpr char SGCONNECT_JAVA_CLASS_NAME[] = "com.senseglove.sgconnect.SGConnect";
@@ -66,7 +66,7 @@ int32 FSGConnectJNI::Initialize()
if (!Env)
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android JNI environmnet!");
return -1999999;
return -1001;
}
FSGIC_JNIEnv_Ptr InEnvContainer{Env};
@@ -77,7 +77,7 @@ int32 FSGConnectJNI::Initialize()
if (Env->IsSameObject(Class, nullptr))
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android Java class!");
return -2999999;
return -1002;
}
Class = (jclass)Env->NewGlobalRef(Class);
FSGIC_jclass InClassContainer{Class};
@@ -89,7 +89,7 @@ int32 FSGConnectJNI::Initialize()
if (!InitMethodID)
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android JNI method 'Init'!");
return -3999999;
return -1003;
}
FSGIC_jmethodID InInitMethodIDContainer{InitMethodID};
@@ -100,7 +100,7 @@ int32 FSGConnectJNI::Initialize()
if (!DisposeMethodID)
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android JNI method 'Dispose'!");
return -4999999;
return -1004;
}
FSGIC_jmethodID InDisposeMethodIDContainer{DisposeMethodID};
@@ -111,7 +111,7 @@ int32 FSGConnectJNI::Initialize()
if (!GetLibraryVersionMethodID)
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android JNI method 'GetLibraryVersion'!");
return -5999999;
return -1005;
}
FSGIC_jmethodID InGetLibraryVersionMethodIDContainer{GetLibraryVersionMethodID};
@@ -54,7 +54,7 @@
int32 FSGCoreJNI::Initialize()
{
int32 Result = -999999;
int32 Result = -1000;
#if PLATFORM_ANDROID
static constexpr char SGCONNECT_JAVA_CLASS_NAME[] = "com.senseglove.sgconnect.SGConnect";
@@ -66,7 +66,7 @@ int32 FSGCoreJNI::Initialize()
if (!Env)
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android JNI environmnet!");
return -1999999;
return -1001;
}
FSGIC_JNIEnv_Ptr InEnvContainer{Env};
@@ -77,7 +77,7 @@ int32 FSGCoreJNI::Initialize()
if (Env->IsSameObject(Class, nullptr))
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android Java class!");
return -2999999;
return -1002;
}
Class = (jclass)Env->NewGlobalRef(Class);
FSGIC_jclass InClassContainer{Class};
@@ -89,7 +89,7 @@ int32 FSGCoreJNI::Initialize()
if (!ActiveDevicesMethodID)
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android JNI method 'ActiveDevices'!");
return -3999999;
return -1003;
}
FSGIC_jmethodID InActiveDevicesMethodIDContainer{ActiveDevicesMethodID};
@@ -100,7 +100,7 @@ int32 FSGCoreJNI::Initialize()
if (!GetDeviceStringMethodID)
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android JNI method 'GetDeviceString'!");
return -4999999;
return -1004;
}
FSGIC_jmethodID InGetDeviceStringMethodIDContainer{GetDeviceStringMethodID};
@@ -111,7 +111,7 @@ int32 FSGCoreJNI::Initialize()
if (!GetSensorStringMethodID)
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android JNI method 'GetSensorString'!");
return -5999999;
return -1005;
}
FSGIC_jmethodID InGetSensorStringMethodIDContainer{GetSensorStringMethodID};
@@ -122,7 +122,7 @@ int32 FSGCoreJNI::Initialize()
if (!WriteHapticsMethodID)
{
SGLOG_ERROR("FSGCoreJNI: failed to get the Android JNI method 'WriteHaptics'!");
return -6999999;
return -1006;
}
FSGIC_jmethodID InWriteHapticsMethodIDContainer{WriteHapticsMethodID};