2019-12-26 15:32:37 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2014-04-23 16:36:54 -04:00
/*=============================================================================
IAndroidDeviceDetection.h: Declares the IAndroidDeviceDetection interface.
=============================================================================*/
# pragma once
2016-11-23 15:48:37 -05:00
# include "Containers/UnrealString.h"
# include "HAL/CriticalSection.h"
template < typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs > class TMap ;
2014-04-23 16:36:54 -04:00
struct FAndroidDeviceInfo
{
2014-09-30 23:41:01 -04:00
// Device serial number, used to route ADB commands to a specific device
2014-04-23 16:36:54 -04:00
FString SerialNumber ;
2014-09-30 23:41:01 -04:00
// Device model name
2014-04-23 16:36:54 -04:00
FString Model ;
2014-09-30 23:41:01 -04:00
// Device name
2014-04-23 16:36:54 -04:00
FString DeviceName ;
2014-09-30 23:41:01 -04:00
// User-visible version of android installed (ro.build.version.release)
FString HumanAndroidVersion ;
// Android SDK version supported by the device (ro.build.version.sdk - note: deprecated in 4 according to docs, but version 4 devices return an empty string when querying the 'replacement' SDK_INT)
int32 SDKVersion ;
// List of supported OpenGL extensions (retrieved via SurfaceFlinger)
FString GLESExtensions ;
// Supported GLES version (ro.opengles.version)
int32 GLESVersion ;
// Is the device authorized for USB communication? If not, then none of the other properties besides the serial number will be valid
2016-06-13 12:20:22 -04:00
bool bAuthorizedDevice ;
2014-09-30 23:41:01 -04:00
2016-07-19 19:13:01 -04:00
// TCP port number on our local host forwarded over adb to the device
uint16 HostMessageBusPort ;
2018-09-03 06:52:19 -04:00
// Holds pixel per inch value.
int32 DeviceDPI = 0 ;
// Holds the display resolution for the device
int32 ResolutionX = 0 ;
int32 ResolutionY = 0 ;
// Holds the reported OpenGLES version.
FString OpenGLVersionString ;
2021-08-04 17:46:20 -04:00
// device's vulkan version, in major.minor.patch format.
FString VulkanVersion ;
2018-09-03 06:52:19 -04:00
// Holds the GPU family name.
FString GPUFamilyString ;
// Holds the name of the manufacturer
FString DeviceBrand ;
2021-08-04 17:46:20 -04:00
// device Hardware field. (or hardware.chipset for qcom)
FString Hardware ;
// device's total mem (as reported from /proc/meminfo)
uint32 TotalPhysicalKB = 0 ;
// device BuildNumber field
FString BuildNumber ;
2014-09-30 23:41:01 -04:00
FAndroidDeviceInfo ( )
: SDKVersion ( INDEX_NONE )
, GLESVersion ( INDEX_NONE )
2016-06-13 12:20:22 -04:00
, bAuthorizedDevice ( true )
2016-07-19 19:13:01 -04:00
, HostMessageBusPort ( 0 )
2014-09-30 23:41:01 -04:00
{
}
2014-04-23 16:36:54 -04:00
} ;
/**
* Interface for AndroidDeviceDetection module.
*/
class IAndroidDeviceDetection
{
public :
2021-08-24 19:27:11 -04:00
virtual void Initialize ( const TCHAR * SDKDirectoryEnvVar , const TCHAR * SDKRelativeExePath , const TCHAR * GetPropCommand , bool bGetExtensionsViaSurfaceFlinger ) = 0 ;
2014-04-23 16:36:54 -04:00
virtual const TMap < FString , FAndroidDeviceInfo > & GetDeviceMap ( ) = 0 ;
virtual FCriticalSection * GetDeviceMapLock ( ) = 0 ;
2015-01-20 10:05:42 -05:00
virtual void UpdateADBPath ( ) = 0 ;
2017-07-13 10:13:07 -04:00
virtual FString GetADBPath ( ) = 0 ;
2018-09-03 06:52:19 -04:00
virtual void ExportDeviceProfile ( const FString & OutPath , const FString & DeviceName ) = 0 ;
2014-04-23 16:36:54 -04:00
protected :
/**
* Virtual destructor
*/
virtual ~ IAndroidDeviceDetection ( ) { }
} ;