mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Fix telemetry
This commit is contained in:
@@ -71,9 +71,6 @@ public:
|
||||
virtual int numberOfTimers() { return 0; }
|
||||
virtual Timer * timerAtIndex(int i) { assert(false); return nullptr; }
|
||||
virtual Poincare::Context * localContext() { return nullptr; }
|
||||
#if EPSILON_TELEMETRY
|
||||
virtual const char * telemetryId() const { return nullptr; }
|
||||
#endif
|
||||
protected:
|
||||
App(Snapshot * snapshot, ViewController * rootViewController, I18n::Message warningMessage = (I18n::Message)0) :
|
||||
Responder(nullptr),
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#ifndef ESCHER_TELEMETRY_H
|
||||
#define ESCHER_TELEMETRY_H
|
||||
|
||||
#if EPSILON_TELEMETRY
|
||||
#define TELEMETRY_ID(x) const char * telemetryId() const override { return (x); }
|
||||
#else
|
||||
#define TELEMETRY_ID(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -53,12 +53,7 @@ public:
|
||||
virtual void viewDidDisappear() {}
|
||||
virtual DisplayParameter displayParameter() { return DisplayParameter::Default; }
|
||||
protected:
|
||||
#if EPSILON_TELEMETRY
|
||||
virtual const char * telemetryId() const { return nullptr; }
|
||||
void telemetryReportEvent(const char * action, const char * label) const;
|
||||
#else
|
||||
void telemetryReportEvent(const char * action, const char * label) const {}
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,37 +4,6 @@
|
||||
#include <ion/telemetry.h>
|
||||
|
||||
void ViewController::viewWillAppear() {
|
||||
#if EPSILON_TELEMETRY
|
||||
const char * screenId = telemetryId();
|
||||
if (screenId == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
const char * appId = Container::activeApp()->telemetryId();
|
||||
if (appId == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
char reportedName[64];
|
||||
assert(strlen(appId) + 1 + strlen(screenId) < sizeof(reportedName));
|
||||
|
||||
reportedName[0] = 0;
|
||||
strlcat(reportedName, appId, sizeof(reportedName));
|
||||
if (strlen(screenId) > 0) {
|
||||
strlcat(reportedName, ".", sizeof(reportedName));
|
||||
strlcat(reportedName, screenId, sizeof(reportedName));
|
||||
}
|
||||
|
||||
Ion::Telemetry::reportScreen(reportedName);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if EPSILON_TELEMETRY
|
||||
void ViewController::telemetryReportEvent(const char * action, const char * label) const {
|
||||
const char * category = Container::activeApp()->telemetryId();
|
||||
assert(category != nullptr);
|
||||
assert(action != nullptr);
|
||||
assert(label != nullptr);
|
||||
Ion::Telemetry::reportEvent(category, action, label);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,10 +7,6 @@ ion_src += $(addprefix ion/src/simulator/shared/, \
|
||||
dummy/language.cpp \
|
||||
)
|
||||
|
||||
ifeq ($(EPSILON_TELEMETRY),1)
|
||||
ion_src += ion/src/simulator/android/src/cpp/telemetry.cpp
|
||||
endif
|
||||
|
||||
$(call object_for,ion/src/simulator/shared/main.cpp) : SFLAGS += -DEPSILON_SDL_FULLSCREEN=1
|
||||
|
||||
LDFLAGS += -ljnigraphics -llog
|
||||
|
||||
Reference in New Issue
Block a user