Determine android STK platform specifically for lobby icon

This commit is contained in:
Benau 2020-07-14 09:10:51 +08:00
parent da64f5eeab
commit ffbf5149cd
2 changed files with 12 additions and 1 deletions

View File

@ -25,6 +25,7 @@
#ifdef ANDROID
#include "SDL_system.h"
#include <jni.h>
std::string g_android_main_user_agent;
extern int android_main(int argc, char *argv[]);
@ -66,6 +67,14 @@ void override_default_params_for_mobile()
#endif
#ifdef ANDROID
// For usage in StringUtils::getUserAgentString
if (SDL_IsAndroidTV())
g_android_main_user_agent = " (AndroidTV)";
else if (SDL_IsChromebook())
g_android_main_user_agent = " (Linux)";
else
g_android_main_user_agent = " (Android)";
// Set multitouch device scale depending on actual screen size
const int SCREENLAYOUT_SIZE_SMALL = 1;
const int SCREENLAYOUT_SIZE_NORMAL = 2;

View File

@ -39,6 +39,8 @@
#include <cwchar>
#include <exception>
extern std::string g_android_main_user_agent;
namespace StringUtils
{
bool hasSuffix(const std::string& lhs, const std::string &rhs)
@ -1391,7 +1393,7 @@ namespace StringUtils
#elif defined(__HAIKU__)
uagent += (std::string)" (Haiku)";
#elif defined(ANDROID)
uagent += (std::string)" (Android)";
uagent += g_android_main_user_agent;
#elif defined(linux)
uagent += (std::string)" (Linux)";
#else