mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-18 06:56:39 +02:00
Merge pull request #12718 from gcalero/tester_flag
Detect if Interface is running on an android testing device
This commit is contained in:
commit
4cab805392
1 changed files with 13 additions and 1 deletions
|
@ -387,6 +387,9 @@ static const QString ACTIVE_DISPLAY_PLUGIN_SETTING_NAME = "activeDisplayPlugin";
|
|||
static const QString SYSTEM_TABLET = "com.highfidelity.interface.tablet.system";
|
||||
static const QString KEEP_ME_LOGGED_IN_SETTING_NAME = "keepMeLoggedIn";
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
static const QString TESTER_FILE = "/sdcard/_hifi_test_device.txt";
|
||||
#endif
|
||||
const std::vector<std::pair<QString, Application::AcceptURLMethod>> Application::_acceptedExtensions {
|
||||
{ SVO_EXTENSION, &Application::importSVOFromURL },
|
||||
{ SVO_JSON_EXTENSION, &Application::importSVOFromURL },
|
||||
|
@ -1445,6 +1448,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
// Make sure we don't time out during slow operations at startup
|
||||
updateHeartbeat();
|
||||
|
||||
static const QString TESTER = "HIFI_TESTER";
|
||||
bool isTester = false;
|
||||
#if defined (Q_OS_ANDROID)
|
||||
// Since we cannot set environment variables in Android we use a file presence
|
||||
// to denote that this is a testing device
|
||||
QFileInfo check_tester_file(TESTER_FILE);
|
||||
isTester = check_tester_file.exists() && check_tester_file.isFile();
|
||||
#endif
|
||||
|
||||
constexpr auto INSTALLER_INI_NAME = "installer.ini";
|
||||
auto iniPath = QDir(applicationDirPath()).filePath(INSTALLER_INI_NAME);
|
||||
QFile installerFile { iniPath };
|
||||
|
@ -1499,7 +1511,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
auto glContextData = getGLContextData();
|
||||
QJsonObject properties = {
|
||||
{ "version", applicationVersion() },
|
||||
{ "tester", QProcessEnvironment::systemEnvironment().contains(TESTER) },
|
||||
{ "tester", QProcessEnvironment::systemEnvironment().contains(TESTER) || isTester },
|
||||
{ "installer_campaign", installerCampaign },
|
||||
{ "installer_type", installerType },
|
||||
{ "build_type", BuildInfo::BUILD_TYPE_STRING },
|
||||
|
|
Loading…
Reference in a new issue