Closed Bug 1303507 Opened 7 years ago Closed 7 years ago

Screen orientation of lockscreen not locked


(Firefox OS Graveyard :: Gaia::System::Window Mgmt, defect)

Gonk (Firefox OS)
Not set


(Not tracked)



(Reporter: asppsa, Unassigned)




(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160824215626

Steps to reproduce:

1. Launch B2G OS on my mobile device (Nexus 4), holding the device in portrait orientation
2. Once the lockscreen appears, turn the device to landscape orientation

Actual results:

The screen orientation starts in portrait, and then switches to landscape when the screen is tilted

Expected results:

The screen orientation should remain in portrait orientation.  This was the behaviour in Firefox OS.
Blocks: 1245091
I'm going to try to fix this bug.  Any help is appreciated though.
What you need to do is:

apply the gecko patch from Bug 1283799
and then replace the mozOrientation API with screen.orientation
Thanks Jovan!
Attached patch lock-orientation.patch (obsolete) — Splinter Review
This patch was written by Fabrice Desré, and attached to the now closed Bug 1283799.  It allows anything served from the "gaia" domain to lock the screen orientation.
Attachment #8792282 - Flags: review?(fabrice)
I've tested this patch on my Nexus 4 and it seems to fix this bug without any need for changes in Gaia.  Perhaps it would be good to additionally make sure that the URI scheme is chrome?

The screen.mozOrientation property seems to still be available in Gecko, although presumably on the way out, given that screen.orientation is available too.  Would it be better to make a separate bug for replacing screen.mozOrientation?  I am happy to do either if someone can advise the best course of action.
Comment on attachment 8792282 [details] [diff] [review]

I can't review a patch I authored ;)

And yes, we should also check that scheme is "chrome".
Attachment #8792282 - Flags: review?(fabrice)
It is important that we update the API, but I don't know if it matters if you do that in this bug or a new one :)
Please file another bug for the gaia change. is the bug for the ScreenOrientation API.
Here's a proposed patch based on Fabrice's one that additionally checks if the scheme of the URL is "chrome".  Tested on my Nexus 4 device.

I'm rather rusty when it comes to C++, and will appreciate any pointers on how I should be doing this properly.
Attachment #8792282 - Attachment is obsolete: true
Attachment #8793558 - Flags: review?(lissyx+mozillians)
That is sadly not something I am entitled to review :/
Comment on attachment 8793558 [details] [diff] [review]

Gabriele, maybe you have the credentials to review this?
Attachment #8793558 - Flags: review?(lissyx+mozillians) → review?(gsvelto)
(In reply to Alexandre LISSY :gerard-majax from comment #12)
> Gabriele, maybe you have the credentials to review this?

Nope, I'm not a DOM peer yet :(
If getting this change reviewed is very difficult, is there some other way that we could fix this, without adding #ifdefs into the dom code?  Perhaps we fix things so that docShell->ItemType() == nsIDocShellTreeItem::typeChrome returns true?
You can try that, yes. Let's see what this would look like.
Comment on attachment 8793558 [details] [diff] [review]

Clearing the review flag since I doubt we'll be able to land any more B2G-specific code on mozilla-central. We have to figure out how to keep the project going first...
Attachment #8793558 - Flags: review?(gsvelto)
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.