Last Comment Bug 715773 - B2G SMS: Package dom_sms.xpt and set temporary permission prefs
: B2G SMS: Package dom_sms.xpt and set temporary permission prefs
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: Trunk
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla12
Assigned To: Philipp von Weitershausen [:philikon]
:
Mentors:
Depends on:
Blocks: b2g-sms
  Show dependency treegraph
 
Reported: 2012-01-05 19:03 PST by Philipp von Weitershausen [:philikon]
Modified: 2012-01-10 01:40 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (1.57 KB, patch)
2012-01-06 18:07 PST, Philipp von Weitershausen [:philikon]
cjones.bugs: review+
Details | Diff | Splinter Review

Description Philipp von Weitershausen [:philikon] 2012-01-05 19:03:16 PST
Something like

pref("dom.sms.enabled", true);
pref("dom.sms.whitelist", "file://,http://localhost:8888,http://gaiamobile.org:8888");

should do it, but it doesn't for me right now. navigator.mozSms is still null. Investigating...
Comment 1 Philipp von Weitershausen [:philikon] 2012-01-06 18:04:35 PST
Turns out, dom_sms.xpt was also not being packaged.
Comment 2 Philipp von Weitershausen [:philikon] 2012-01-06 18:07:08 PST
Created attachment 586629 [details] [diff] [review]
v1
Comment 3 Philipp von Weitershausen [:philikon] 2012-01-06 18:11:45 PST
With this and a hack in Gaia (which expects a full-blown SMS API which we don't have yet, see https://github.com/andreasgal/gaia/commit/82cdd8fed9cd56a8e169ee32c9cc0fc296fa3102), I can *send* SMS! Receiving should work too, but Gaia would need more hacking for that.
Comment 4 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-01-06 18:19:29 PST
We used to be able to receive SMS's, with the old android impl.
Comment 5 Mounir Lamouri (:mounir) 2012-01-07 02:10:49 PST
(In reply to Chris Jones [:cjones] [:warhammer] from comment #4)
> We used to be able to receive SMS's, with the old android impl.

Yes. But the API changed in the meantime. Not dramatically but enough to require a few changes [1]. Unfortunately I was too lazy to compile, setup and install B2G on my Android phone to make the correct changes to Gaia and Vivien was too lazy to use an Android backend again to do that. I guess now that the Android backend doesn't work with B2G, stuff will have to be fixed while they are pushed in the Gonk backend.

So, to make receiving work, we would have to change:
window.addEventListener('sms-received', [...]
to:
navigator.mozSms.addEventListener('received', [...]

[1] Most important change is that events are now sent to mozSms instead of window.
Comment 6 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-01-07 16:01:31 PST
Sounds quite straightforward.  Let's make it so!
Comment 7 Philipp von Weitershausen [:philikon] 2012-01-09 12:10:25 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/f5a4d6a88a6a
Comment 8 Marco Bonardo [::mak] 2012-01-10 01:40:22 PST
https://hg.mozilla.org/mozilla-central/rev/f5a4d6a88a6a

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