Report device name on Android.

This commit is contained in:
Bartosz Taudul 2021-10-26 18:09:56 +02:00
parent 1cbd6950cf
commit 1ecdb8aa2a
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -38,6 +38,7 @@
#ifdef __ANDROID__
# include <sys/mman.h>
# include <sys/system_properties.h>
# include <stdio.h>
# include <stdint.h>
# include <algorithm>
@ -618,6 +619,13 @@ static const char* GetHostInfo()
#else
ptr += sprintf( ptr, "CPU: unknown\n" );
#endif
#ifdef __ANDROID__
char deviceModel[PROP_VALUE_MAX+1];
char deviceManufacturer[PROP_VALUE_MAX+1];
__system_property_get( "ro.product.model", deviceModel );
__system_property_get( "ro.product.manufacturer", deviceManufacturer );
ptr += sprintf( ptr, "Device: %s %s\n", deviceManufacturer, deviceModel );
#endif
ptr += sprintf( ptr, "CPU cores: %i\n", std::thread::hardware_concurrency() );