Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Report accurate windows mean
Browse files Browse the repository at this point in the history
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 a491bdb.
  • Loading branch information
keianhzo committed Nov 5, 2019
1 parent 7fcabcb commit b0709fd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,26 @@ private static void queueActiveWindowPctEvent() {
}
}

public static void resetOpenedWindowsCount(int number, boolean isPrivate) {
if (isPrivate) {
for (int i=0; i<openPrivateWindows.length; i++) {
openPrivateWindows[i] = 0;
}
if (number > 0) {
openPrivateWindows[number -1 ] = 1;
}

} else {
for (int i=0; i<openWindows.length; i++) {
openWindows[i] = 0;
}

if (number > 0) {
openWindows[number - 1] = 1;
}
}
}

private static void queueOpenWindowsAvgEvent() {
float weight = 0;
float weightSum = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit b0709fd

Please sign in to comment.