B2G SMS: Package dom_sms.xpt and set temporary permission prefs

RESOLVED FIXED in mozilla12

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: philikon, Assigned: philikon)

Tracking

(Blocks: 1 bug)

Trunk
mozilla12
ARM
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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...
Turns out, dom_sms.xpt was also not being packaged.
Summary: B2G SMS: Set temporary permission prefs → B2G SMS: Package dom_sms.xpt and set temporary permission prefs
Created attachment 586629 [details] [diff] [review]
v1
Assignee: nobody → philipp
Attachment #586629 - Flags: review?(jones.chris.g)
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.
Attachment #586629 - Flags: review?(jones.chris.g) → review+
We used to be able to receive SMS's, with the old android impl.
(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.
Sounds quite straightforward.  Let's make it so!
https://hg.mozilla.org/integration/mozilla-inbound/rev/f5a4d6a88a6a
https://hg.mozilla.org/mozilla-central/rev/f5a4d6a88a6a
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.