I see my comment was not clear, sorry. I'm talking about the implementation of the "locking in an orientation".

The functionality of "not rotating the actual window" should be implemented in the NativeWindowApp object, not on the extension.

In the current code the NativeWindowApp tracks the orientation change on the device and rotate accordingly. We want to add a new member variable to control whether the window is locked in a certain orientation, so the rule will be: "if I'm not locked, I can rotate, otherwise, keep as I am" (rule will be slightly complicated, this just to illustrate.

Then, the extension will use this feature of NativeAppWindow to ask it to lock at certain orientation.