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

Commit

Permalink
Avoid duplicated GeckoSession setActive calls (#2392)
Browse files Browse the repository at this point in the history
* Avoid duplicated  GeckoSession setActive calls

* Ensure we save state and call Telemetry
  • Loading branch information
keianhzo authored and MortimerGoro committed Nov 28, 2019
1 parent 143a88a commit e162b3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@ public void setActive(boolean aActive) {
}

if (mState.mSession != null) {
mState.mSession.setActive(aActive);
if (mState.isActive() != aActive) {
mState.mSession.setActive(aActive);
}
mState.setActive(aActive);
} else if (aActive) {
restore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,24 +412,11 @@ public void onPause() {
mIsPaused = true;

saveState();
for (WindowWidget window: mRegularWindows) {
window.onPause();
}
for (WindowWidget window: mPrivateWindows) {
window.onPause();
}
}

public void onResume() {
mIsPaused = false;

for (WindowWidget window: mRegularWindows) {
window.onResume();
}
for (WindowWidget window: mPrivateWindows) {
window.onResume();
}

TelemetryWrapper.resetOpenedWindowsCount(mRegularWindows.size(), false);
TelemetryWrapper.resetOpenedWindowsCount(mPrivateWindows.size(), true);
}
Expand Down

0 comments on commit e162b3a

Please sign in to comment.