Per experiment, deviceorientation event is triggered periodically (per 0.5s).
Adding listener when app open is just too late. The transition was broken when I did that.
IMO we can detach it when screen is turned off then attach it when screen is turned on.

I think the most ideal solution is having a synchronous deviceorientation API that I can get the orientation instantly.
Otherwise we need such an observer listening to deviceorientation.