Last Comment Bug 679733 - Widget Qt should send system notifications (display, taskswitcher, flight modes)
: Widget Qt should send system notifications (display, taskswitcher, flight modes)
Status: RESOLVED FIXED
:
Product: Core Graveyard
Classification: Graveyard
Component: Widget: Qt (show other bugs)
: Trunk
: ARM Maemo
: -- normal (vote)
: mozilla9
Assigned To: Oleg Romashin (:romaxa)
:
Mentors:
Depends on: 679923
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-17 08:55 PDT by Oleg Romashin (:romaxa)
Modified: 2016-07-11 21:54 PDT (History)
5 users (show)
Ms2ger: in‑testsuite-
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Listen device system states and send observe notifications (8.27 KB, patch)
2011-08-17 08:59 PDT, Oleg Romashin (:romaxa)
doug.turner: review+
azakai: feedback+
jeremias.bosch: feedback+
Details | Diff | Splinter Review
Deactivate last visible tab when fennec go into bg, or system inactive (3.77 KB, patch)
2011-08-17 16:12 PDT, Oleg Romashin (:romaxa)
no flags Details | Diff | Splinter Review
Child process suspend/resume API (SIGSTOP/SIGCONT) (8.75 KB, patch)
2011-08-17 18:18 PDT, Oleg Romashin (:romaxa)
doug.turner: feedback-
Details | Diff | Splinter Review
[TOPUSH] Listen device system states and send observe notifications, fixed copyright (8.27 KB, patch)
2011-08-18 17:53 PDT, Oleg Romashin (:romaxa)
no flags Details | Diff | Splinter Review
[TOPUSH] Listen device system states and send observe notifications, fixed copyright (9.39 KB, patch)
2011-08-21 10:57 PDT, Oleg Romashin (:romaxa)
mark.finkle: approval‑mozilla‑aurora-
Details | Diff | Splinter Review

Description Oleg Romashin (:romaxa) 2011-08-17 08:55:45 PDT
We need to listen qmsystem2 (in future QtMobility API) for displayState, Activity, device mode notifications and generate related observer notifications.
Comment 1 Oleg Romashin (:romaxa) 2011-08-17 08:59:36 PDT
Created attachment 553792 [details] [diff] [review]
Listen device system states and send observe notifications

I've reused old notification states from maemo5, and added ts-background, ts-foreground notifications which notify us when browser goes into taskswitcher mode (in that case we should make last active tab/docshell inactive)
Comment 2 Oleg Romashin (:romaxa) 2011-08-17 09:57:28 PDT
Comment on attachment 553792 [details] [diff] [review]
Listen device system states and send observe notifications

if you have better observe name than "ts-background", otherwise it good to go as system part
Comment 3 Alon Zakai (:azakai) 2011-08-17 10:10:55 PDT
Who for example would be listening to these notifications?
Comment 4 Oleg Romashin (:romaxa) 2011-08-17 13:44:32 PDT
1) ts-background/foreground - right now when fennec moved to background, top fennec docshell is staying active, and we should add listener possibly in fennec UI or in DocShell and set current visible tab as inactive (that should cause animations suspend et.c.)

2) As an option we can completely suspend child process when fennec goes to taskswitcher in order to suspend all possible JS activity on page.

3) system-active/inactive - practically fennec child process should be suspended

2-3) suspension can be canceled in case if there are some audio activity on the page...
Comment 5 Oleg Romashin (:romaxa) 2011-08-17 16:12:00 PDT
Created attachment 553942 [details] [diff] [review]
Deactivate last visible tab when fennec go into bg, or system inactive

Here is example which is deactivating last selected tab when fennec goes into background or system go to locked/inactive state or when display is off...
Comment 6 Oleg Romashin (:romaxa) 2011-08-17 18:15:00 PDT
Comment on attachment 553942 [details] [diff] [review]
Deactivate last visible tab when fennec go into bg, or system inactive

new bug created for this implementation
Comment 7 Oleg Romashin (:romaxa) 2011-08-17 18:18:02 PDT
Created attachment 553973 [details] [diff] [review]
Child process suspend/resume API (SIGSTOP/SIGCONT)

Another example is suspend child process by hard (SIGSTOP) but only if it is not playing any audio stuff (case with lastfm et.c.)

And feedback on this?
Comment 8 Alon Zakai (:azakai) 2011-08-18 11:12:45 PDT
(In reply to Oleg Romashin (:romaxa) from comment #7)
> Created attachment 553973 [details] [diff] [review]
> Child process suspend/resume API (SIGSTOP/SIGCONT)
> 
> Another example is suspend child process by hard (SIGSTOP) but only if it is
> not playing any audio stuff (case with lastfm et.c.)
> 
> And feedback on this?

There was opposition to this when we considered it last year, due to a lot of potential problems with it. It can probably be done, but is risky - probably better to figure out why we need to suspend the child and fix that problem (are there unnecessary timers, etc.).
Comment 9 Oleg Romashin (:romaxa) 2011-08-18 11:31:39 PDT
> There was opposition to this when we considered it last year, due to a lot
> of potential problems with it. It can probably be done, but is risky -
> probably better to figure out why we need to suspend the child and fix that
> problem (are there unnecessary timers, etc.).

Practically this is short term fix for all timers in content process (Page JS mostly).

Possibly more elegant fix for that is to call Window->Suspend/Resume timeouts, that suspend all JS timers.

For me both ways are having + and -
SIGSTOP:
 + will not cause some conflicts in content process caused by components which are trying to use/create JS timers and those are not working.
 - May cause some undiscovered problems of Fenenc which is trying to interact with STOPPED child process

JS Suspend/Resume timeouts:
 + Keep child process in alive state, helps to catch other timers for long term fixing
 + problem described in SIGSTOP as "+" here is minus... such pages like gmail intentionally broken after such suspend..
Comment 10 Doug Turner (:dougt) 2011-08-18 17:18:14 PDT
Comment on attachment 553792 [details] [diff] [review]
Listen device system states and send observe notifications

please adjust the copyright date.
Comment 11 Doug Turner (:dougt) 2011-08-18 17:18:56 PDT
Comment on attachment 553973 [details] [diff] [review]
Child process suspend/resume API (SIGSTOP/SIGCONT)

please put this in a different bug (one fix per bug).
Comment 12 Oleg Romashin (:romaxa) 2011-08-18 17:50:29 PDT
this was example of possible usage
> please put this in a different bug (one fix per bug).
will do that next
Comment 13 Oleg Romashin (:romaxa) 2011-08-18 17:53:59 PDT
Created attachment 554274 [details] [diff] [review]
[TOPUSH] Listen device system states and send observe notifications, fixed copyright
Comment 16 Oleg Romashin (:romaxa) 2011-08-21 10:57:16 PDT
Created attachment 554737 [details] [diff] [review]
[TOPUSH] Listen device system states and send observe notifications, fixed copyright

Ok, this compiles fine on other Qt builds
http://tbpl.allizom.org/?tree=Try&usebuildbot=1&rev=86f78f470d87
Comment 18 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-08-22 04:44:53 PDT
http://hg.mozilla.org/mozilla-central/rev/b51e7241dd13
Comment 19 Oleg Romashin (:romaxa) 2011-08-22 08:23:47 PDT
This patch does not make big sense without 679923
Comment 20 Oleg Romashin (:romaxa) 2011-08-22 08:32:35 PDT
Comment on attachment 554737 [details] [diff] [review]
[TOPUSH] Listen device system states and send observe notifications, fixed copyright

This patch is needed as backend for bug 679923, affecting only Qt Maemo6 port, more details about whole change is in https://bugzilla.mozilla.org/show_bug.cgi?id=679923#c37
Comment 21 Mark Finkle (:mfinkle) (use needinfo?) 2011-08-23 14:45:56 PDT
Comment on attachment 554737 [details] [diff] [review]
[TOPUSH] Listen device system states and send observe notifications, fixed copyright

Leaving in fx9.

Note You need to log in before you can comment on or make changes to this bug.