Hi Developers,
This is a reminder to introduce the new mechanism for the system message
security checks.
After bug 805655 is landed, now the system messages are only be allowed to be
sent/broadcasted to the apps that have the correct permissions. In other words,
in the future you have to add an entry in the system-message-to-permissions
mapping table at dom/messages/SystemMessagePermissionsChecker.jsm whenever you
attempt to add a new system message type. The following table shows the mapping
relations we have now (2012/12/17):
this.SystemMessagePermissionsTable = {
"activity": { },
"alarm": {
"alarms": []
},
"bluetooth-dialer-command": {
"telephony": []
},
"bluetooth-requestconfirmation": {
"bluetooth": []
},
"bluetooth-requestpasskey": {
"bluetooth": []
},
"bluetooth-requestpincode": {
"bluetooth": []
},
"bluetooth-authorize": {
"bluetooth": []
},
"bluetooth-cancel": {
"bluetooth": []
},
"bluetooth-pairedstatuschanged": {
"bluetooth": []
},
"bluetooth-hfp-status-changed": {
"bluetooth": []
},
"bluetooth-opp-transfer-complete": {
"bluetooth": []
},
"bluetooth-opp-update-progress": {
"bluetooth": []
},
"bluetooth-opp-receiving-file-confirmation": {
"bluetooth": []
},
"bluetooth-opp-transfer-start": {
"bluetooth": []
},
"headset-button": { },
"icc-stkcommand": {
"settings": ["read", "write"]
},
"notification": {
"desktop-notification": []
},
"sms-received": {
"sms": []
},
"telephony-new-call": {
"telephony": []
}
};
Notes:
====================
* Each system message type can be mapped to *multiple* permissions. All the
specified permissions need to be installed for the app so that it can receive
the system message type you want to send.
* If you hope to let the system message type to be passed without any
permission checks, you can just use an empty object to do that. For example,
like the above-mentioned "activity" and "headset-button". However, we don't
encourage to do that unless we cannot find an explicit permission set for it.
* You can also specify the access modes for a permission by an array. For
example, like ["read", "write"] for the "settings" permission, which means both
"settings-read" and "settings-write" need to be installed for the app to
receive a given system message type like "icc-stkcommand".
Thanks,
Gene
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g