[System] Only start the idle timer until the boot is complete

NEW
Assigned to

Status

Firefox OS
Gaia::System
--
blocker
3 years ago
a year ago

People

(Reporter: tzimmermann, Assigned: alive)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

There's a timeout of 60 sec after which the System app switches off the screen by releasing a wakelock. The emulator-{jb,kk} requires five to six minutes for startup, two of them in Gaia (no kidding).

Consequently, the system suspends during startup. Automated testing fails in this case with a timeout.
I think this should be solved by keeping suspending disabled unconditionally until startup has been finished.
Tim, can your team take this one?
Flags: needinfo?(timdream)
Yeah I can put this in my queue. Is this urgent?
Assignee: nobody → timdream
Flags: needinfo?(timdream)
Update the title to make it more descriptive.
Summary: FxOS suspends during startup → [System] Only start the idle timer until the boot is complete
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #3)
> Yeah I can put this in my queue. Is this urgent?

It's not urgent, but should have priority over regular features. We want to get emulator-kk ready and this is currently the one unresolved blocker.
See Also: → bug 1000063
See Also: → bug 1062786
(In reply to Thomas Zimmermann (on PTO) [:tzimmermann] [:tdz] from comment #5)
> (In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from
> comment #3)
> > Yeah I can put this in my queue. Is this urgent?
> 
> It's not urgent, but should have priority over regular features. We want to
> get emulator-kk ready and this is currently the one unresolved blocker.

The system app start-up patch is current a mess, it would be hard for the part of the system (specifically, ScreenManager) to realize the time the phone actually boots.

The quick workaround is to set mozSettings value "screen.timeout" of the profile-to-test to 0, which will make the screen never sleeps. We should do that first to unblock your work.
See Also: → bug 905324
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #6)
> The system app start-up patch is current a mess, it would be hard for the
> part of the system (specifically, ScreenManager) to realize the time the
> phone actually boots.
> 
> The quick workaround is to set mozSettings value "screen.timeout" of the
> profile-to-test to 0, which will make the screen never sleeps. We should do
> that first to unblock your work.

Greg,

Does lock screen / lock screen window manager currently emits events to the System app scope saying either

"Hey, the main panel is shown."

or

"Hey, I am loaded but lock screen is not enabled."

during System app boot-up?

I think these are the two events needed for this bug.
Flags: needinfo?(gweng)
Main panel is a part of the index.html of System app, if your 'shown' means HTML is ready, it's implicit done by loading the page at bootstraping. If you mean the initialization code of LockScreen has been executed, we need to create it. However, since there is a 'lockscreen-appopened' which means the app window animation is done, I think it should be 'lockscreen-appready' or something like that, which is similar to the idea of allowing app to dispatch an event through API or IAC that I've sent a mail to dev-gaia and then been totally ignored.
Flags: needinfo?(gweng)
Blocks: 989048

Updated

3 years ago
Status: NEW → ASSIGNED

Updated

3 years ago
Flags: needinfo?(timdream)
Please read comment 6.
Status: ASSIGNED → NEW
Flags: needinfo?(timdream)
See Also: → bug 860594
Hi

This bug blocks any progress with automated tests on emulator-kk. Can we find a solution in the foreseeable future?
Severity: normal → blocker
Hi Thomas,

I thought changing the "screen.timeout" value will unblock? Is that not the case?
Flags: needinfo?(tzimmermann)
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #11)
> Hi Thomas,
> 
> I thought changing the "screen.timeout" value will unblock? Is that not the
> case?

Hi

Is there a way to make this the default on emulators? We'd like to run automated tests on emulator-kk.
Flags: needinfo?(tzimmermann) → needinfo?(timdream)
You can do something like this, pass a SCREEN_TIMEOUT=0 from BoardConfig.mk:

https://github.com/mozilla-b2g/device-rpi/blob/ab404c/BoardConfig.mk#L54

If DEVICE_DEBUG=1 (I don't know where is it being set), the timeout will be changed to 300 sec

https://github.com/mozilla-b2g/gaia/blob/05f8670/Makefile#L125
Flags: needinfo?(timdream)

Updated

3 years ago
Blocks: 1107678

Updated

3 years ago
Flags: needinfo?(tzimmermann)

Updated

3 years ago
Blocks: 1124557

Updated

3 years ago
No longer blocks: 1124557
Hi all,

This bug is focusing on a long-term solution for system app. I just filed bug 1124567 for a quick workaround for emulator-kk. Let's move there for kk discussion :)

I will adjust bug dependency accordingly.

Updated

3 years ago
No longer blocks: 989048, 1090359, 1107678

Updated

3 years ago
Don't know why ni
Flags: needinfo?(tzimmermann)
Probably something doable once bug 1094759 lands.
Depends on: 1094759
Write down my idea here:

We could only set the idle timer in ScreenManager when it knows the system is fully loaded.
Now there's no this event, but after bug 1094759, we could make system/js/app.js to dispatch an event, or even register a service and in ScreenManager.start() we could:

Service.request("fullyLoaded").then(() => {
  this.setIdleTimeout();
});

Comment 18

3 years ago
Created attachment 8613440 [details] [review]
[gaia] alivedise:bugzilla/1108271/set-idle-timeout-once-fullyloaded > mozilla-b2g:master
Comment on attachment 8613440 [details] [review]
[gaia] alivedise:bugzilla/1108271/set-idle-timeout-once-fullyloaded > mozilla-b2g:master

Hi Thomas, could you make sure this work for you or not? Thanks.
Attachment #8613440 - Flags: feedback?(tzimmermann)
Assignee: timdream → alive
(In reply to Alive Kuo [:alive][NEEDINFO!] from comment #17)
> Write down my idea here:
> 
> We could only set the idle timer in ScreenManager when it knows the system
> is fully loaded.
> Now there's no this event, but after bug 1094759, we could make
> system/js/app.js to dispatch an event, or even register a service and in
> ScreenManager.start() we could:
> 
> Service.request("fullyLoaded").then(() => {
>   this.setIdleTimeout();
> });

Insteadly, I am using visuallyLoaded (Service.request('schedule')) in the WIP. If it's not working for emulator I will implement the fullyLoaded version.
Note: I am working on reland bug 1094759. Will back to this later
Thanks for all your work! There's no need to rush in a patch for this bug, as we currently have a workaround in place.
Comment on attachment 8613440 [details] [review]
[gaia] alivedise:bugzilla/1108271/set-idle-timeout-once-fullyloaded > mozilla-b2g:master

I don't know enough about the code to give good feedback on the patch itself.

What we need is to keep the emulator running until the automated tests have been started. We currently have a workaround in the emulator's board config, [1] but a solution in gecko/gaia would certainly be better.

I'd guess that the automated tests only start after the system sent 'fullyLoaded' and a timeout of 60 seconds might not be enough to reach this state on the emulator. (Booting takes 5+ minutes.) Using 'fullyLoaded' might be safer.

There's no good way of testing, because failures only show up as connection timeouts in the test logs. In any case, I'd give a try to any solution you propose.

[1] https://github.com/mozilla-b2g/platform_build/pull/97/files
Attachment #8613440 - Flags: feedback?(tzimmermann)
You need to log in before you can comment on or make changes to this bug.