Commit 71bbf38c authored by Makoto Kato's avatar Makoto Kato
Browse files

Bug 1747039 - We should notify Gecko of current orientation information to all...

Bug 1747039 - We should notify Gecko of current orientation information to all process when enableNotifications is called. r=calu

`OrientationDelegateTest#orientationLockedExistingOrientation` often timed out
since Gecko's orientation information and GeckoView's aren't same value.

If `GeckoScreenOrientation.update()` is called during `mShouldNotify` is false,
GeckoView doesn't notify Gecko of current orientation information.
Then, `GeckoScreenOrientation.enableNotifications()` also doesn't notify it
since `mShouldNotify` was false.  So then, when `update()` is called by lock
screen, since cached orientation information in GeckoView is same value,
GeckoView doesn't notify it even if Gecko's orientation information and
GeckoView's information aren't same value.

So we should notify Gecko of current orientation information to all processes
when `enableNotifications` is called.

Differential Revision: https://phabricator.services.mozilla.com/D135855
parent 598758c5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -99,8 +99,10 @@ public class GeckoScreenOrientation {
   * Enable Gecko screen orientation events on update.
   */
  public void enableNotifications() {
    update();
    // We should notify Gecko of current orientation information at force.
    mScreenOrientation = ScreenOrientation.NONE;
    mShouldNotify = true;
    update();
  }

  /*