Closed
Bug 1167465
Opened 9 years ago
Closed 9 years ago
Exposing Allowed Audio Channels in System App's Window
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: evanxd, Assigned: baku)
References
Details
(Keywords: dev-doc-needed)
Attachments
(2 files)
1.09 KB,
patch
|
Details | Diff | Splinter Review | |
16.62 KB,
patch
|
alwu
:
review+
fabrice
:
review+
alwu
:
feedback+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•9 years ago
|
||
Reporter | ||
Comment 2•9 years ago
|
||
STR: 1. Install the below patches: * For Gaia: https://github.com/evanxd/gaia/commit/9b56248655edcbf1e25fcf6a463b42270c4fc555 * For Gecko: The debug-bug-1167465.patch attachment(https://bugzilla.mozilla.org/attachment.cgi?id=8609114) 2. Reboot FxOS. 3. Run `adb logcat | grep 1167465` to see the log. Expected log: I/GeckoConsole( 2043): Content JS LOG: Bug 1167465 - Send MozContentEvent to get audio channels I/GeckoDump( 2043): Bug 1167465 - Send audio channel list to System app I/GeckoConsole( 2043): Content JS LOG: Bug 1167465 - Receive audioChannels: normal,notification,telephony Actual log: I/GeckoConsole( 2557): Content JS LOG: Bug 1167465 - Send MozContentEvent to get audio channels I/GeckoDump( 2557): Bug 1167465 - Send audio channel list to System app The environment: Build ID 20150521160241 Gaia Revision 1126d8bee559f7cde675df2fcc6c196da9cfeba1 Gaia Date 2015-05-21 21:23:56 Gecko Revision https://hg.mozilla.org/mozilla-central/rev/3e737d30f842 Gecko Version 41.0a1 Device Name flame Firmware(Release) 4.4.2 Firmware(Incremental) eng.cltbld.20141204.004231 Firmware Date Thu Dec 4 00:42:42 EST 2014 Bootloader L1TC00011880
Comment 4•9 years ago
|
||
I haven't looked into this yet, but could you try to send the event after document "load"?
Comment 5•9 years ago
|
||
Can't reproduce. The output is correct 1087:I/GeckoConsole( 2316): Content JS LOG: Bug 1167465 - Send MozContentEvent to get audio channels 1090:I/GeckoDump( 2316): Bug 1167465 - Send audio channel list to System app 1091:I/GeckoConsole( 2316): Content JS LOG: Bug 1167465 - Receive audioChannels: normal,notification,telephony Build ID 20150610181819 Gaia Revision 27e4c1af0be302150a5f6e428666e0e3daf2a4ea Gaia Date 2015-06-10 09:46:07 Gecko Revision n/a Gecko Version 41.0a1 Device Name flame Firmware(Release) 4.4.2 Firmware(Incremental) eng.cltbld.20150427.192938 Firmware Date Mon Apr 27 19:29:49 EDT 2015 Bootloader L1TC00011880
Flags: needinfo?(kchen)
Comment 6•9 years ago
|
||
gecko rev 516ac5b38c9ae90a5323b528ed9a09a4c87b1598
Reporter | ||
Comment 7•9 years ago
|
||
Maybe the issues is about the implementation of Audio Channel Management APIs. So we need a specific gecko rev to reproduce. The below are the steps to install the gecko in the device. How to enable the AudioChannelManager. 1. To install the gecko module to enable the APIs: * Unzip the b2g.tar.gz attachment[1]. * Run `adb shell mount -o remount,rw /system` to have capability to write file system if you don't have it. * Run `adb push path/to/the/attachment/directory/b2g /system/b2g/` 2. Restart the device. 3. Done. [1]: https://drive.google.com/open?id=0B3MxK4_nj3bpcnZwUFdNWlM3Nkk&authuser=1
Reporter | ||
Comment 8•9 years ago
|
||
And I'll try to reproduce the bug again. If I can do it successfully, I'll do needinfo and let you know. Thanks for the help.
Reporter | ||
Updated•9 years ago
|
Flags: needinfo?(evanxd)
Reporter | ||
Comment 9•9 years ago
|
||
New STR: 1. Add the gaia patch[1] 2. Reboot FxOS. 3. Run `adb logcat | grep 1167465` to see the log. Expected result: See the log: `I/GeckoConsole( 2191): Content JS LOG: Bug 1167465: get audio channels: normal,content,notification,ringer` Actual result: Cannot see the log: `I/GeckoConsole( 2191): Content JS LOG: Bug 1167465: get audio channels: normal,content,notification,ringer` If we wait for a while and send the content event with the patch[2], then we can see the excepted log. [1]: https://github.com/evanxd/gaia/commit/e0387eab1227da58e2b88731dbf973937ba3ff11 [2]: https://github.com/evanxd/gaia/commit/74d42719472533ec491df4281613c4111ab2e249
Flags: needinfo?(evan)
Reporter | ||
Comment 10•9 years ago
|
||
The Comment 9 is based on the environment[1]. [1]: Build ID 20150803150205 Gaia Revision dbacf8364f4505d021b7d8fb9cabea325004dbcc Gaia Date 2015-08-03 16:38:49 Gecko Revision https://hg.mozilla.org/mozilla-central/rev/abc56d57f6e1 Gecko Version 42.0a1 Device Name flame Firmware(Release) 4.4.2 Firmware(Incremental) eng.cltbld.20150622.193834 Firmware Date Mon Jun 22 19:38:45 EDT 2015 Bootloader L1TC00011880
Reporter | ||
Comment 11•9 years ago
|
||
Hi Kan-Ru, We have a new STR in comment 9, and the reproduce-able environment is listed in comment 10. And this bug blocks bug 1180618. Could you take a look? Thanks.
Flags: needinfo?(kchen)
Reporter | ||
Updated•9 years ago
|
Summary: Cannot send MozChromeEvent to System app before `MozAfterPaint` event is triggered in shell.js. → Cannot send MozChromeEvent to System app at startup time
Comment 12•9 years ago
|
||
https://github.com/mozilla-b2g/gaia/blob/4df9592/apps/system/js/core.js#L59-L64 "Note that shell.js starts listen for the mozContentEvent event at mozbrowserloadstart, which sometimes does not happen till window.onload." So this had happened before. I think the problem is mozbrowserloadstart is a async message so the mozContentEvent fired before shell.js received loadstart and attached event listeners was lost. We need a better way for shell.js to listen to the mozContentEvent events.
Flags: needinfo?(kchen)
Reporter | ||
Comment 13•9 years ago
|
||
Thanks for Kan-Ru's investigate. baku, would you like to take a look? This bug is blocking a gaia fix[1] for audio channel management. Thanks. [1]: http://bugzil.la/1180618
Flags: needinfo?(amarchesini)
Comment 14•9 years ago
|
||
It's hard to avoid this races between shell.js and system app. shell.js can't notify system app because it doesn't know if system app is ready and vice versa. Hopefully a new API would solve this problem.
Comment 15•9 years ago
|
||
My advices is, don't send mozContentEvent until you have received your first mozChromeEvent. Currently this is after the "load" event.
Reporter | ||
Comment 16•9 years ago
|
||
Kan-Ru, thanks for the advice. I'll try that, hope it'll work.
Assignee | ||
Comment 17•9 years ago
|
||
> baku, would you like to take a look?
> This bug is blocking a gaia fix[1] for audio channel management.
Can this be fixed by exposing allowedAudioChannels array to the system app directly?
If yes, I don't think this will take too much work.
Flags: needinfo?(amarchesini) → needinfo?(evan)
Reporter | ||
Comment 18•9 years ago
|
||
Do you mean that we can do something like ``` console.log(window.allowedAudioChannels[0].name); ``` to print a audio channel name in System App's window? If so, we can fix the gaia bug[1]. [1]: http://bugzil.la/1180618
Flags: needinfo?(evan)
Assignee | ||
Comment 19•9 years ago
|
||
Yes, I was proposing something like this. If yes, and alwu agrees, I/we can go implementing it.
Flags: needinfo?(alwu)
Reporter | ||
Comment 20•9 years ago
|
||
Nice! Just one more question, exposing allowedAudioChannels is only for System app, not for other apps, right? It means that apps except System app still cannot access their allowedAudioChannels directly.
Comment 21•9 years ago
|
||
I have the same question as Evan's. Can we expose the allowedAudioChannels only for system app? I agree if we can make sure this point.
Flags: needinfo?(alwu)
Assignee | ||
Comment 22•9 years ago
|
||
> Just one more question, exposing allowedAudioChannels is only for System
> app, not for other apps, right?
correct. How urgent is this?
We can have a custom permission just for this.
Assignee | ||
Comment 23•9 years ago
|
||
This patch is not tested. But maybe you have time to give me a feedback.
Attachment #8654940 -
Flags: feedback?(alwu)
Updated•9 years ago
|
Attachment #8654940 -
Flags: feedback?(alwu) → feedback+
Assignee | ||
Comment 24•9 years ago
|
||
I don't see any tests for AudioChannelManager. Alastor, do you mind to review/test this patch next week in Taipei?
Comment 25•9 years ago
|
||
Sure!
Reporter | ||
Updated•9 years ago
|
Summary: Cannot send MozChromeEvent to System app at startup time → Exposing Allowed Audio Channels in System App's Window
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → amarchesini
Assignee | ||
Updated•9 years ago
|
Attachment #8654940 -
Flags: review?(fabrice)
Attachment #8654940 -
Flags: review?(alwu)
Assignee | ||
Updated•9 years ago
|
Keywords: dev-doc-needed
Updated•9 years ago
|
Attachment #8654940 -
Flags: review?(alwu) → review+
Assignee | ||
Comment 26•9 years ago
|
||
Comment on attachment 8654940 [details] [diff] [review] foo.patch Review of attachment 8654940 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/apps/PermissionsTable.jsm @@ +497,5 @@ > trusted: DENY_ACTION, > privileged: ALLOW_ACTION, > certified: ALLOW_ACTION > }, > + "allowed-audio-channels-in-window": { I want to rename this to allow-audio-channels-in-app
Comment 27•9 years ago
|
||
After offline discuss with Baku, we still need to modify the permission, If we use "certified: DENY_ACTION", the system app can not use the allowedaudiochannel. If we use "certified: ALLOW_ACTION", all certified apps can use this attribute, that is not we want.
Comment 28•9 years ago
|
||
Comment on attachment 8654940 [details] [diff] [review] foo.patch Review of attachment 8654940 [details] [diff] [review]: ----------------------------------------------------------------- Holding on review based on https://bugzilla.mozilla.org/show_bug.cgi?id=1167465#c27
Attachment #8654940 -
Flags: review?(fabrice)
Assignee | ||
Comment 29•9 years ago
|
||
I propose to rename the permission system-app-only-audio-channel-in-app. If you agree, can you take a look at the patch again?
Flags: needinfo?(fabrice)
Comment 30•9 years ago
|
||
Comment on attachment 8654940 [details] [diff] [review] foo.patch Review of attachment 8654940 [details] [diff] [review]: ----------------------------------------------------------------- r=me with the permission name change
Attachment #8654940 -
Flags: review+
Updated•9 years ago
|
Flags: needinfo?(fabrice)
Assignee | ||
Comment 31•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a729df0cb8b4
https://hg.mozilla.org/mozilla-central/rev/a729df0cb8b4
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•