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
This commit is contained in:
Makoto Kato 2022-01-14 05:53:34 +00:00
Родитель 598758c576
Коммит 71bbf38c5a
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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();
}
/*