Closed Bug 1202528 Opened 6 years ago Closed 6 years ago

Every time visibiltiychange from hidden to show, a network activity icon is inserted

Categories

(Firefox OS Graveyard :: Gaia::System::Status bar, Utility tray, Notification, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ting, Assigned: apastor)

References

Details

(Whiteboard: [systemsfe])

Attachments

(1 file)

STR:
1. Press power button on/off several times (my phone has SIM and WiFi enabled)
2. Use WebIDE for system app, in the inspector search #statusbar-network-activity, there'll be many.

Root cause:
In network_activity.js, when document is shown, _handle_visibilitychange() calls BaseIcon.start(), which will render() and insert the view.
This can be fixed by either a) add a customized render() like TimeIcon [1] to render only once, or b) only insert the view if the element is null in BaseIcon.render(). And I prefer b.

How do you think?

[1] http://lxr.mozilla.org/gaia/source/apps/system/js/time_icon.js#26
Flags: needinfo?(apastor)
B is actually the way BaseUI (which BaseIcon inherits from) works https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/base_ui.js#L24.

So yes, it should only inster elements once. Do you want me to take this one?
Flags: needinfo?(apastor) → needinfo?(janus926)
I'm fine for both taking or not taking, if you do not take, I'll fix it next week.
Flags: needinfo?(janus926)
Assignee: nobody → apastor
Whiteboard: [systemsfe]
Attachment #8660731 - Flags: review?(etienne)
Comment on attachment 8660731 [details] [review]
[gaia] albertopq:1202528-base-icon-once > mozilla-b2g:master

Can we remove the special renderer in TimeIcon now? (fine if you want to do it in a follow up).

Anyway, good catch :)
Attachment #8660731 - Flags: review?(etienne) → review+
master: https://github.com/mozilla-b2g/gaia/commit/d130529c626695570c7b5017d9b43955115d68a0
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.