diff -r 5a72e60dea8b -r 41fb932132ea org.symbian.tools.wrttools/plugin.xml
--- a/org.symbian.tools.wrttools/plugin.xml Thu Jun 17 17:36:55 2010 -0700
+++ b/org.symbian.tools.wrttools/plugin.xml Mon Jun 21 11:50:47 2010 -0700
@@ -953,7 +953,7 @@
-
var phoneNumber = "+6505551214";
@@ -967,10 +967,43 @@
}
+
+ -
+
+function watchBatteryNotifications() {
+ var sysInfo = device.getServiceObject("Service.SysInfo", "ISysInfo");
+ var result = sysInfo.ISysInfo.GetNotification( {
+ Entity : "Battery",
+ Key : "BatteryStrength"
+ }, batteryUpdated);
+ if (result.ErrorCode == 0) {
+ var transactionId = result.TransactionID;
+ // TODO Use this ID to cancel notifications
+ } else {
+ var message = result.ErrorMessage;
+ // TODO Process error
+ }
+}
+
+function batteryUpdated(tId, code, result) {
+ if (result.ErrorCode == 0) {
+ var batteryStatus = result.ReturnValue.Status;
+ // TODO Process battery charge level
+ } else {
+ var message = result.ErrorMessage;
+ // TODO Process error
+ }
+}
+
+
-
// Call this function to add a callback that will be notified of orientation changes