From b0709fdd9014c0d3016f322861bb9ea500605db7 Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Tue, 5 Nov 2019 22:41:21 +0100 Subject: [PATCH] Report accurate windows mean Reset the windows count when resuming the app to report a more accurate mean. Force send the telemetry status every time the app starts Revert "Force send the telemetry status every time the app starts" This reverts commit a491bdbfca810574299793d5eec1069d452a8a03. --- .../vrbrowser/telemetry/TelemetryWrapper.java | 20 +++++++++++++++++++ .../mozilla/vrbrowser/ui/widgets/Windows.java | 3 +++ 2 files changed, 23 insertions(+) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/telemetry/TelemetryWrapper.java b/app/src/common/shared/org/mozilla/vrbrowser/telemetry/TelemetryWrapper.java index 574c73667..9f43f4677 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/telemetry/TelemetryWrapper.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/telemetry/TelemetryWrapper.java @@ -595,6 +595,26 @@ private static void queueActiveWindowPctEvent() { } } + public static void resetOpenedWindowsCount(int number, boolean isPrivate) { + if (isPrivate) { + for (int i=0; i 0) { + openPrivateWindows[number -1 ] = 1; + } + + } else { + for (int i=0; i 0) { + openWindows[number - 1] = 1; + } + } + } + private static void queueOpenWindowsAvgEvent() { float weight = 0; float weightSum = 0; diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java index 33c5abe4f..2d863a009 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java @@ -426,6 +426,9 @@ public void onResume() { for (WindowWidget window: mPrivateWindows) { window.onResume(); } + + TelemetryWrapper.resetOpenedWindowsCount(mRegularWindows.size(), false); + TelemetryWrapper.resetOpenedWindowsCount(mPrivateWindows.size(), true); } public void onDestroy() {