diff --git a/android/settings.gradle b/android/settings.gradle index c7b70cfde2..8079cb79fd 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -2,8 +2,8 @@ // Libraries // -include ':oculus' -project(':oculus').projectDir = new File(settingsDir, 'libraries/oculus') +//include ':oculus' +//project(':oculus').projectDir = new File(settingsDir, 'libraries/oculus') include ':qt' project(':qt').projectDir = new File(settingsDir, 'libraries/qt') @@ -18,8 +18,8 @@ if (!getSettings().hasProperty("SUPPRESS_INTERFACE")) { } if (!getSettings().hasProperty("SUPPRESS_QUEST_INTERFACE")) { - include ':questInterface' - project(':questInterface').projectDir = new File(settingsDir, 'apps/questInterface') + // include ':questInterface' + // project(':questInterface').projectDir = new File(settingsDir, 'apps/questInterface') } // @@ -27,11 +27,11 @@ if (!getSettings().hasProperty("SUPPRESS_QUEST_INTERFACE")) { // if (!getSettings().hasProperty("SUPPRESS_FRAME_PLAYER")) { - include ':framePlayer' - project(':framePlayer').projectDir = new File(settingsDir, 'apps/framePlayer') + // include ':framePlayer' + // project(':framePlayer').projectDir = new File(settingsDir, 'apps/framePlayer') } if (!getSettings().hasProperty("SUPPRESS_QUEST_FRAME_PLAYER")) { - include ':questFramePlayer' - project(':questFramePlayer').projectDir = new File(settingsDir, 'apps/questFramePlayer') + //include ':questFramePlayer' + // project(':questFramePlayer').projectDir = new File(settingsDir, 'apps/questFramePlayer') } diff --git a/libraries/platform/src/AndroidPlatform.cpp b/libraries/platform/src/AndroidPlatform.cpp new file mode 100644 index 0000000000..e0a24d365a --- /dev/null +++ b/libraries/platform/src/AndroidPlatform.cpp @@ -0,0 +1,40 @@ +// +// Created by Amer Cerkic 05/02/2019 +// Copyright 2019 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "AndroidPlatform.h" +#include "platformJsonKeys.h" + +#include +#include +using namespace platform; + +void AndroidInstance::enumerateCpu() { + json cpu; + cpu[jsonKeys::cpuBrand] = ""; + cpu[jsonKeys::cpuModel] = ""; + cpu[jsonKeys::cpuClockSpeed] = ""; + cpu[jsonKeys::cpuNumCores] = ""; + _cpu.push_back(cpu); +} + +void AndroidInstance::enumerateGpu() { + GPUIdent* ident = GPUIdent::getInstance(); + json gpu = {}; + gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); + gpu[jsonKeys::gpuMemory] = ident->getMemory(); + gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); + + _gpu.push_back(gpu); + _display = ident->getOutput(); +} + +void AndroidInstance::enumerateMemory() { + json ram = {}; + + _memory.push_back(ram); +} diff --git a/libraries/platform/src/AndroidPlatform.h b/libraries/platform/src/AndroidPlatform.h new file mode 100644 index 0000000000..17efbb45e3 --- /dev/null +++ b/libraries/platform/src/AndroidPlatform.h @@ -0,0 +1,25 @@ +// +// Created by Amer Cerkic 05/02/2019 +// Copyright 2019 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_AndroidPlatform_h +#define hifi_AndroidPlatform_h + +#include "platformInstance.h" + +namespace platform { + class AndroidInstance : public Instance { + + public: + void enumerateCpu() override; + void enumerateMemory() override; + void enumerateGpu() override; + }; + +} // namespace platform + +#endif //hifi_androidplatform_h diff --git a/libraries/platform/src/LinuxPlatform.cpp b/libraries/platform/src/LinuxPlatform.cpp new file mode 100644 index 0000000000..35ee2b1f0f --- /dev/null +++ b/libraries/platform/src/LinuxPlatform.cpp @@ -0,0 +1,42 @@ +// +// Created by Amer Cerkic 05/02/2019 +// Copyright 2019 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "LinuxPlatform.h" +#include "platformJsonKeys.h" +#include +#include + +using namespace platform; +void LinuxInstance::enumerateCpu() { + json cpu = {}; + + cpu[jsonKeys::cpuBrand] = ""; + cpu[jsonKeys::cpuModel] = ""; + cpu[jsonKeys::cpuClockSpeed] = ""; + cpu[jsonKeys::cpuNumCores] = ""; + + _cpu.push_back(cpu); +} + +void LinuxInstance::enumerateGpu() { + GPUIdent* ident = GPUIdent::getInstance(); + json gpu = {}; + gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); + gpu[jsonKeys::gpuMemory] = ident->getMemory(); + gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); + + _gpu.push_back(gpu); + _display = ident->getOutput(); +} + +void LinuxInstance::enumerateMemory() { + json ram = {}; + + + _memory.push_back(ram); +} diff --git a/libraries/platform/src/LinuxPlatform.h b/libraries/platform/src/LinuxPlatform.h new file mode 100644 index 0000000000..1af4ce7444 --- /dev/null +++ b/libraries/platform/src/LinuxPlatform.h @@ -0,0 +1,25 @@ +// +// Created by Amer Cerkic 05/02/2019 +// Copyright 2019 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_LinuxPlatform_h +#define hifi_LinuxPlatform_h + +#include "platformInstance.h" + +namespace platform { + class LinuxInstance : public Instance { + + public: + void enumerateCpu() override; + void enumerateMemory() override; + void enumerateGpu() override; + }; + +} // namespace platform + +#endif //hifi_linuxPlaform_h diff --git a/libraries/platform/src/platform.cpp b/libraries/platform/src/platform.cpp index 496dd164be..f1bcf112fb 100644 --- a/libraries/platform/src/platform.cpp +++ b/libraries/platform/src/platform.cpp @@ -19,7 +19,12 @@ #include "MACOSPlatform.h" #endif +#ifdef Q_OS_ANDROID +#include "AndroidPlatform.h" +#endif + #ifdef Q_OS_LINUX +#include "LinuxPlatform.h" #endif using namespace platform; @@ -31,6 +36,10 @@ void platform::create() { _instance =new WINInstance(); #elif defined(Q_OS_MAC) _instance = new MACOSInstance(); +#elif defined(Q_OS_ANDROID) + _instance= new AndroidInstance(); +#elif defined(Q_OS_LINUX) + _instance= new LinuxInstance(); #endif } diff --git a/libraries/platform/src/platformJsonKeys.h b/libraries/platform/src/platformJsonKeys.h index ea185433f6..b947c3cc06 100644 --- a/libraries/platform/src/platformJsonKeys.h +++ b/libraries/platform/src/platformJsonKeys.h @@ -12,7 +12,6 @@ namespace platform { namespace jsonKeys{ -#if !defined(Q_OS_LINUX) || !defined(Q_OS_ANDROID) //hiding from linux at the moment due to unused variables warning static const char* cpuBrand= "cpuBrand"; static const char* cpuModel = "cpuModel"; static const char* cpuClockSpeed = "clockSpeed"; @@ -27,9 +26,8 @@ namespace platform { static const char* displayCoordsRight = "coordinatesright"; static const char* displayCoordsTop = "coordinatestop"; static const char* displayCoordsBottom = "coordinatesbottom"; -#endif } } // namespace platform -#endif +#endif