Permalink
Browse files

Merge pull request #86 from blackberry-webworks/master

BlackBerry WebWorks SDK 2.3.0
  • Loading branch information...
2 parents 7b99d41 + d9013cd commit 306ce7f540331092a5dabdce05f9f6b0e7310bf9 Ken Wallis committed Jan 10, 2012
Showing with 38,859 additions and 1,891 deletions.
  1. +5 −2 api/CommonAPI/sharedglobal/3_xhr.js
  2. +1 −0 api/app/src/main/java/blackberry/app/ExitFunction.java
  3. BIN api/bbm/lib/net_rim_bb_qm_platform.jar
  4. +45 −7 api/bbm/src/main/java/blackberry/bbm/platform/BBMPlatformContextListenerImpl.java
  5. +59 −4 api/bbm/src/main/java/blackberry/bbm/platform/BBMPlatformNamespace.java
  6. +19 −0 api/bbm/src/main/java/blackberry/bbm/platform/io/MessagingServiceListenerImpl.java
  7. +1 −1 api/bbm/src/main/java/blackberry/bbm/platform/self/SelfNamespace.java
  8. +5 −2 api/bbm/src/main/java/blackberry/bbm/platform/self/profilebox/ProfileBoxNamespace.java
  9. +39 −0 api/bbm/src/main/java/blackberry/bbm/platform/settings/SettingsNamespace.java
  10. +14 −8 api/bbm/src/main/java/blackberry/bbm/platform/users/BBMPlatformUser.java
  11. +80 −0 api/bbm/src/main/java/blackberry/bbm/platform/users/UsersNamespace.java
  12. +6 −1 api/bbm/src/main/java/blackberry/bbm/platform/util/Util.java
  13. +72 −0 api/dialog/src/main/java/blackberry/ui/dialog/ColorPickerAsyncFunction.java
  14. +73 −0 api/dialog/src/main/java/blackberry/ui/dialog/DateTimeAsyncFunction.java
  15. +2 −1 api/dialog/src/main/java/blackberry/ui/dialog/DialogExtension.java
  16. +4 −0 api/dialog/src/main/java/blackberry/ui/dialog/DialogNamespace.java
  17. +109 −0 api/dialog/src/main/java/blackberry/ui/dialog/DialogRunnableFactory.java
  18. +21 −0 api/dialog/src/main/java/blackberry/ui/dialog/IWebWorksDialog.java
  19. +106 −0 api/dialog/src/main/java/blackberry/ui/dialog/SelectAsyncFunction.java
  20. +694 −0 api/dialog/src/main/java/blackberry/ui/dialog/color/ColorPickerDialog.java
  21. +536 −0 api/dialog/src/main/java/blackberry/ui/dialog/datetime/DateTimeDialog.java
  22. +137 −0 api/dialog/src/main/java/blackberry/ui/dialog/select/GPATools.java
  23. +351 −0 api/dialog/src/main/java/blackberry/ui/dialog/select/SelectDialog.java
  24. BIN api/dialog/src/main/java/blackberry/ui/dialog/select/box-empty.png
  25. BIN api/dialog/src/main/java/blackberry/ui/dialog/select/chk-blue.png
  26. BIN api/dialog/src/main/java/blackberry/ui/dialog/select/chk-white.png
  27. +97 −47 api/system.event/js/common/system_event_dispatcher.js
  28. +1 −1 api/system.event/js/common/system_event_ns.js
  29. +77 −0 api/system.event/src/main/java/blackberry/system/event/CoverageChangeHandler.java
  30. +76 −0 api/system.event/src/main/java/blackberry/system/event/EventQueue.java
  31. +0 −50 api/system.event/src/main/java/blackberry/system/event/ISystemEventExtensionConstants.java
  32. +32 −0 api/system.event/src/main/java/blackberry/system/event/ISystemEventListener.java
  33. +192 −0 api/system.event/src/main/java/blackberry/system/event/KeyPressHandler.java
  34. +62 −247 api/system.event/src/main/java/blackberry/system/event/SystemEventExtension.java
  35. +125 −0 api/system.event/src/main/java/blackberry/system/event/SystemEventManager.java
  36. +131 −0 api/system.event/src/main/java/blackberry/system/event/SystemEventReturnValue.java
  37. +3 −1 framework/src/blackberry/web/widget/MemoryMaid.java
  38. +15 −4 framework/src/blackberry/web/widget/Widget.java
  39. +1 −0 framework/src/blackberry/web/widget/WidgetScreen.java
  40. +9 −2 framework/src/blackberry/web/widget/bf/BrowserFieldScreen.java
  41. +249 −100 framework/src/blackberry/web/widget/bf/NavigationNamespace.java
  42. +47 −44 framework/src/blackberry/web/widget/bf/WidgetBrowserFieldListener.java
  43. +168 −166 framework/src/blackberry/web/widget/bf/WidgetFieldManager.java
  44. +10 −6 framework/src/blackberry/web/widget/bf/WidgetRequestController.java
  45. +60 −264 framework/src/blackberry/web/widget/bf/navigationcontroller/NavigationController.java
  46. +84 −0 framework/src/blackberry/web/widget/bf/navigationcontroller/NavigationExtension.java
  47. +0 −260 framework/src/blackberry/web/widget/bf/navigationcontroller/NavigationMapUpdateDispatcherEvent.java
  48. +29 −670 framework/src/blackberry/web/widget/bf/navigationcontroller/NavigationUiDispatcherEvent.java
  49. +17 −0 framework/src/blackberry/web/widget/impl/WidgetConfigImpl.java
  50. +11 −1 framework/src/blackberry/web/widget/policy/WidgetPolicy.java
  51. +1 −0 framework/src/js/navmode.js
  52. +1,451 −0 framework/src/js/navmode_uncompressed.js
  53. +19 −0 packager/src/net/rim/tumbler/config/WidgetConfig.java
  54. +3 −2 packager/src/net/rim/tumbler/rapc/Rapc.java
  55. +6 −0 packager/src/net/rim/tumbler/serialize/WidgetConfig_v1Serializer.java
  56. +28 −0 packager/src/net/rim/tumbler/xml/ConfigXMLParser.java
  57. +35 −0 yui-tests/NavModeSmokeTestYUI2.0/StyleSheet.css
  58. +290 −0 yui-tests/NavModeSmokeTestYUI2.0/basic.htm
  59. +17 −0 yui-tests/NavModeSmokeTestYUI2.0/config.xml
  60. +51 −0 yui-tests/NavModeSmokeTestYUI2.0/index.htm
  61. +565 −0 yui-tests/NavModeSmokeTestYUI2.0/list.htm
  62. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/navmode-browser-direction.js
  63. +5 −0 yui-tests/NavModeSmokeTestYUI2.0/navmode-browser.js
  64. +1 −0 yui-tests/NavModeSmokeTestYUI2.0/navmode.js
  65. +5 −0 yui-tests/NavModeSmokeTestYUI2.0/readme.txt
  66. +470 −0 yui-tests/NavModeSmokeTestYUI2.0/table.htm
  67. BIN yui-tests/NavModeSmokeTestYUI2.0/wheel.png
  68. +32 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/YUIexamples.js
  69. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/bg_hd.gif
  70. +190 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/dpSyntaxHighlighter.css
  71. +805 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/dpSyntaxHighlighter.js
  72. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/example-hd-bg.gif
  73. +134 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/syntax.js
  74. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/yui-candy.jpg
  75. +416 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/yui.css
  76. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/yui.gif
  77. 0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/yuiDistribution.css
  78. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/assets/yuilib.jpg
  79. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/ajax-loader.gif
  80. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/asc.gif
  81. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/autocomplete.css
  82. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/back-h.png
  83. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/back-v.png
  84. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/bar-h.png
  85. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/bar-v.png
  86. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/bg-h.gif
  87. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/bg-v.gif
  88. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/blankimage.png
  89. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/button.css
  90. +8 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/calendar.css
  91. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/carousel.css
  92. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/check0.gif
  93. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/check1.gif
  94. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/check2.gif
  95. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/colorpicker.css
  96. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/container.css
  97. +8 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/datatable.css
  98. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/desc.gif
  99. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/dt-arrow-dn.png
  100. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/dt-arrow-up.png
  101. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/editor-knob.gif
  102. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/editor-sprite-active.gif
  103. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/editor-sprite.gif
  104. +10 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/editor.css
  105. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/header_background.png
  106. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/hue_bg.png
  107. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/imagecropper.css
  108. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/layout.css
  109. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/layout_sprite.png
  110. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/loading.gif
  111. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/logger.css
  112. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/menu-button-arrow-disabled.png
  113. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/menu-button-arrow.png
  114. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/menu.css
  115. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/menubaritem_submenuindicator.png
  116. BIN .../NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/menubaritem_submenuindicator_disabled.png
  117. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/menuitem_checkbox.png
  118. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/menuitem_checkbox_disabled.png
  119. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/menuitem_submenuindicator.png
  120. BIN ...sts/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/menuitem_submenuindicator_disabled.png
  121. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/paginator.css
  122. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/picker_mask.png
  123. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/profilerviewer.css
  124. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/progressbar.css
  125. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/resize.css
  126. +10 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/simpleeditor.css
  127. +35 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/skin.css
  128. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/slider.css
  129. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/split-button-arrow-active.png
  130. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/split-button-arrow-disabled.png
  131. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/split-button-arrow-focus.png
  132. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/split-button-arrow-hover.png
  133. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/split-button-arrow.png
  134. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/sprite.png
  135. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/sprite.psd
  136. +8 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/tabview.css
  137. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/treeview-loading.gif
  138. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/treeview-sprite.gif
  139. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/treeview.css
  140. BIN yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/wait.gif
  141. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/assets/skins/sam/yuitest.css
  142. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/base/base-min.css
  143. +137 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/base/base.css
  144. +1,885 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/dom/dom-debug.js
  145. +9 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/dom/dom-min.js
  146. +1,846 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/dom/dom.js
  147. +283 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event-delegate/event-delegate-debug.js
  148. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event-delegate/event-delegate-min.js
  149. +281 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event-delegate/event-delegate.js
  150. +218 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event-mouseenter/event-mouseenter-debug.js
  151. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event-mouseenter/event-mouseenter-min.js
  152. +218 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event-mouseenter/event-mouseenter.js
  153. +624 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event-simulate/event-simulate-debug.js
  154. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event-simulate/event-simulate-min.js
  155. +624 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event-simulate/event-simulate.js
  156. +2,561 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event/event-debug.js
  157. +11 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event/event-min.js
  158. +2,537 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/event/event.js
  159. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/fonts/fonts-min.css
  160. +55 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/fonts/fonts.css
  161. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/logger/assets/logger-core.css
  162. +57 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/logger/assets/logger.css
  163. +55 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/logger/assets/skins/sam/logger-skin.css
  164. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/logger/assets/skins/sam/logger.css
  165. +2,109 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/logger/logger-debug.js
  166. +9 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/logger/logger-min.js
  167. +2,109 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/logger/logger.js
  168. +660 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/stylesheet/stylesheet-debug.js
  169. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/stylesheet/stylesheet-min.js
  170. +656 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/stylesheet/stylesheet.js
  171. +39 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/utilities/utilities.js
  172. +14 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yahoo-dom-event/yahoo-dom-event.js
  173. +1,229 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yahoo/yahoo-debug.js
  174. +8 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yahoo/yahoo-min.js
  175. +1,229 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yahoo/yahoo.js
  176. +17 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuiloader-dom-event/yuiloader-dom-event.js
  177. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuitest/assets/skins/sam/yuitest-skin.css
  178. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuitest/assets/skins/sam/yuitest.css
  179. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuitest/assets/testlogger.css
  180. +7 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuitest/assets/yuitest-core.css
  181. +3,120 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuitest/yuitest-debug.js
  182. +11 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuitest/yuitest-min.js
  183. +3,120 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuitest/yuitest.js
  184. +2,132 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuitest/yuitest_core-debug.js
  185. +9 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuitest/yuitest_core-min.js
  186. +2,132 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/build/yuitest/yuitest_core.js
  187. +174 −0 yui-tests/NavModeSmokeTestYUI2.0/yui2.9.0/index.html
@@ -179,8 +179,11 @@
blackberry.transport.call(url, opts, function (response) {
if (callback(response)) {
- this.blackberry.transport.poll(url, opts, callback);
- }
+ setTimeout(
+ function() { this.blackberry.transport.poll(url, opts, callback); },
+ 0
+ );
+ }
});
};
})();
@@ -35,6 +35,7 @@ public Object execute( Object thiz, Object[] args ) {
static class ExitRunner implements Runnable {
public void run() {
+ System.gc(); // MemoryMaid
System.exit( 0 );
}
}
Binary file not shown.
@@ -17,9 +17,15 @@
import net.rim.blackberry.api.bbm.platform.BBMPlatformContext;
import net.rim.blackberry.api.bbm.platform.BBMPlatformContextListener;
+import net.rim.blackberry.api.bbm.platform.profile.BBMPlatformContact;
+import net.rim.blackberry.api.bbm.platform.profile.Presence;
+import net.rim.blackberry.api.bbm.platform.profile.UserProfile;
import net.rim.blackberry.api.bbm.platform.profile.UserProfileBoxItem;
+import net.rim.device.api.script.Scriptable;
import net.rim.device.api.script.ScriptableFunction;
+import blackberry.bbm.platform.self.SelfNamespace;
import blackberry.bbm.platform.self.profilebox.ScriptableProfileBoxItem;
+import blackberry.bbm.platform.users.BBMPlatformUser;
import blackberry.bbm.platform.util.ConstantsUtil;
import blackberry.bbm.platform.util.Util;
@@ -60,23 +66,55 @@ public void accessChanged(boolean isAccessAllowed, int code) {
Util.dispatchCallback(callback, args);
}
- public void appInvoked(int reason, Object param) {
+ public void appInvoked(int reason, Object param, Presence user) {
final ScriptableFunction callback;
try {
callback = (ScriptableFunction) _platform.getField(BBMPlatformNamespace.EVENT_ON_APP_INVOKED);
} catch(Exception e1){
return;
}
- final Object[] args;
- if(reason == BBMPlatformContext.INVOKE_PROFILE_BOX_ITEM) {
- final ScriptableProfileBoxItem scriptItem =
- new ScriptableProfileBoxItem(_platform.getProfileBox(), (UserProfileBoxItem) param);
- args = new Object[] { "profilebox", scriptItem };
+ // Get reason string and scriptable param
+ final String reasonStr;
+ final Object scriptableParam;
+ switch(reason) {
+ case BBMPlatformContext.INVOKE_PROFILE_BOX_ITEM:
+ reasonStr = "profilebox";
+ scriptableParam = new ScriptableProfileBoxItem(_platform.getProfileBox(), (UserProfileBoxItem) param);
+ break;
+ case BBMPlatformContext.INVOKE_PROFILE_BOX:
+ reasonStr = "profileboxtitle";
+ scriptableParam = Scriptable.UNDEFINED;
+ break;
+ case BBMPlatformContext.INVOKE_PERSONAL_MESSAGE:
+ reasonStr = "personalmessage";
+ scriptableParam = (String) param;
+ break;
+ case BBMPlatformContext.INVOKE_CHAT_MESSAGE:
+ reasonStr = "chatmessage";
+ scriptableParam = Scriptable.UNDEFINED;
+ break;
+ default:
+ // Don't invoke if we don't know what to do with the reason
+ return;
+ }
+
+ // Get scriptable user: either self namespace of BBMPlatformUser instance
+ final Object scriptableUser;
+ if(user instanceof UserProfile) {
+ scriptableUser = SelfNamespace.getInstance();
+ } else if(user instanceof BBMPlatformContact) {
+ scriptableUser = new BBMPlatformUser(user);
} else {
- return;
+ scriptableUser = Scriptable.UNDEFINED;
}
+ final Object[] args = {
+ reasonStr,
+ scriptableParam,
+ scriptableUser,
+ };
Util.dispatchCallback(callback, args);
}
+
}
@@ -27,6 +27,7 @@
import blackberry.bbm.platform.io.IONamespace;
import blackberry.bbm.platform.io.MessagingServiceListenerImpl;
import blackberry.bbm.platform.self.SelfNamespace;
+import blackberry.bbm.platform.settings.SettingsNamespace;
import blackberry.bbm.platform.ui.UINamespace;
import blackberry.bbm.platform.users.UsersNamespace;
import blackberry.bbm.platform.util.ConstantsUtil;
@@ -43,6 +44,7 @@
public static final String FUNC_REGISTER = "register";
public static final String FUNC_REQUEST_USER_PERMISSION = "requestUserPermission";
+ public static final String FUNC_SHOW_OPTIONS = "showBBMAppOptions";
public static final String FIELD_ENVIRONMENT = "environment";
public static final String EVENT_ON_APP_INVOKED = "onappinvoked";
public static final String EVENT_ON_ACCESS_CHANGED = "onaccesschanged";
@@ -99,6 +101,8 @@ public Object getField(String name) throws Exception {
return new RegisterFunction();
} else if(name.equals(BBMPlatformNamespace.FUNC_REQUEST_USER_PERMISSION)) {
return new RequestUserPermissionFunction();
+ } else if(name.equals(BBMPlatformNamespace.FUNC_SHOW_OPTIONS)) {
+ return new ShowOptionsFunction();
} else if(name.equals(SelfNamespace.NAME)) {
return SelfNamespace.getInstance();
} else if(name.equals(UsersNamespace.NAME)) {
@@ -107,6 +111,8 @@ public Object getField(String name) throws Exception {
return IONamespace.getInstance();
} else if(name.equals(UINamespace.NAME)) {
return UINamespace.getInstance();
+ } else if(name.equals(SettingsNamespace.NAME)) {
+ return SettingsNamespace.getInstance();
} else if(_wFields.hasField(name)){
return _wFields.getField(name);
} else if(name.equals(FIELD_ENVIRONMENT)) {
@@ -126,22 +132,42 @@ private Object getEnvironment() {
} catch(ControlledAccessException e) {
return UNDEFINED;
}
-
}
private class RegisterFunction extends ScriptableFunctionBase {
- public static final String OPTIONS_FIELD_UUID = "uuid";
+ public static final String OPTIONS_FIELD_UUID = "uuid";
+ public static final String OPTIONS_FIELD_SHARECONTENTSPLAT = "shareContentSplat";
protected Object execute(Object thiz, Object[] args) throws Exception {
final Object onAccessChanged = BBMPlatformNamespace.this.getField(EVENT_ON_ACCESS_CHANGED);
if(onAccessChanged.equals(UNDEFINED)) {
- throw new IllegalStateException("blackberry.bbm.platform.onAccessChanged == undefined");
+ throw new IllegalStateException("blackberry.bbm.platform.onaccesschanged == undefined");
}
final Scriptable options = (Scriptable) args[0];
final String uuid = (String) options.getField(OPTIONS_FIELD_UUID);
- final BBMPlatformApplication bbmApp = new BBMPlatformApplication(uuid);
+
+ // Get optional shareContentSplat property
+ final Object shareContentSplatObj = options.getField(OPTIONS_FIELD_SHARECONTENTSPLAT);
+ boolean shareContentSplat;
+ try {
+ shareContentSplat = ((Boolean) shareContentSplatObj).booleanValue();
+ } catch(Exception e) {
+ shareContentSplat = false;
+ }
+ final boolean finalShareContentSplat = shareContentSplat;
+
+ final BBMPlatformApplication bbmApp = new BBMPlatformApplication(uuid) {
+ public int getDefaultSettings() {
+ if(finalShareContentSplat) {
+ return super.getDefaultSettings() | BBMPlatformContext.SETTING_SHARECONTENT_SPLAT;
+ } else {
+ return super.getDefaultSettings();
+ }
+
+ }
+ };
Dispatcher.getInstance().dispatch(new DispatchableEvent(null) {
protected void dispatch() {
@@ -196,4 +222,33 @@ public void run() {
};
}
} // RequestUserPermissionFunction
+
+ private class ShowOptionsFunction extends ScriptableFunctionBase {
+
+ protected Object execute(Object thiz, Object[] args) throws Exception {
+
+ final ScriptableFunction onComplete = (ScriptableFunction) args[0];
+
+ UiApplication.getUiApplication().invokeLater(new Runnable() {
+ public void run() {
+ UiApplication.getUiApplication().invokeLater(new Runnable() {
+ public void run() {
+ _bbmpContext.requestAppSettings();
+ Util.dispatchCallback(onComplete, null);
+ }
+ });
+ }
+ });
+
+ return UNDEFINED;
+ }
+
+ protected FunctionSignature[] getFunctionSignatures() {
+ FunctionSignature sig1 = new FunctionSignature(1);
+ sig1.addParam(ScriptableFunction.class, true);
+ return new FunctionSignature[] {
+ sig1
+ };
+ }
+ } // ShowOptionsFunction
}
@@ -15,6 +15,7 @@
*/
package blackberry.bbm.platform.io;
+import java.util.Date;
import java.util.Hashtable;
import net.rim.blackberry.api.bbm.platform.io.BBMPlatformChannel;
@@ -28,6 +29,7 @@
import net.rim.blackberry.api.bbm.platform.service.MessagingServiceListener;
import net.rim.device.api.script.ScriptableFunction;
import blackberry.bbm.platform.users.BBMPlatformUser;
+import blackberry.bbm.platform.users.UsersNamespace;
import blackberry.bbm.platform.util.ConstantsUtil;
import blackberry.bbm.platform.util.Util;
import blackberry.core.threading.DispatchableEvent;
@@ -230,4 +232,21 @@ public void onMessagesExpired(BBMPlatformContact contact, BBMPlatformData[] data
};
Util.dispatchCallback(callback, args);
}
+
+ public void onShareContentReceived(BBMPlatformContact contact, String description, BBMPlatformData content, long timestamp) {
+ final ScriptableFunction callback;
+ try {
+ callback = (ScriptableFunction) UsersNamespace.getInstance().getField(UsersNamespace.EVENT_ON_SHARE_CONTENT);
+ } catch(Exception e) {
+ return;
+ }
+ final Object[] args = {
+ new BBMPlatformUser(contact),
+ content.getDataAsString(),
+ description,
+ new Date(timestamp),
+ };
+ Util.dispatchCallback(callback, args);
+ }
+
}
@@ -107,7 +107,7 @@ protected void dispatch() {
protected FunctionSignature[] getFunctionSignatures() {
FunctionSignature sig1 = new FunctionSignature(2);
- sig1.addParam(String.class, true);
+ sig1.addNullableParam(String.class, true);
sig1.addParam(ScriptableFunction.class, true);
return new FunctionSignature[] {
@@ -15,6 +15,8 @@
*/
package blackberry.bbm.platform.self.profilebox;
+import java.nio.ByteBuffer;
+
import net.rim.blackberry.api.bbm.platform.profile.UserProfile;
import net.rim.blackberry.api.bbm.platform.profile.UserProfileBox;
import net.rim.blackberry.api.bbm.platform.profile.UserProfileBoxAccessException;
@@ -117,8 +119,9 @@ protected Object execute(Object thiz, Object[] args) throws Exception {
if(iconURI.equals(UNDEFINED)) {
iconID = -1;
} else {
- final Bitmap icon = Util.requestBitmap((String) iconURI);
- iconID = Math.abs(icon.hashCode()); // icon ID is hash code of bitmap
+ final byte[] iconBytes = Util.requestBitmapBytes((String) iconURI);
+ final Bitmap icon = Bitmap.createBitmapFromBytes(iconBytes, 0, iconBytes.length, 1);
+ iconID = Math.abs(ByteBuffer.wrap(iconBytes).hashCode()); // icon ID is hash code of bitmap
if(! _profileBox.isIconRegistered(iconID)) {
_profileBox.registerIcon(iconID, PNGEncodedImage.encode(icon));
}
@@ -0,0 +1,39 @@
+package blackberry.bbm.platform.settings;
+
+import blackberry.bbm.platform.BBMPlatformNamespace;
+import net.rim.blackberry.api.bbm.platform.SettingsManager;
+import net.rim.device.api.script.Scriptable;
+
+public class SettingsNamespace extends Scriptable {
+
+ public static final String NAME = "settings";
+
+ private static final String FIELD_PROFILE_BOX = "profileboxEnabled";
+ private static final String FIELD_PUBLIC_CONNS = "alwaysAllowPublicConns";
+
+ private static SettingsNamespace _instance;
+
+ private final SettingsManager _settings;
+
+ public SettingsNamespace(SettingsManager settings) {
+ _settings = settings;
+ }
+
+ public static SettingsNamespace getInstance() {
+ if(_instance == null) {
+ final SettingsManager settings = BBMPlatformNamespace.getInstance().getContext().getSettingsManager();
+ _instance = new SettingsNamespace(settings);
+ }
+ return _instance;
+ }
+
+ public Object getField(String name) throws Exception {
+ if(name.equals(FIELD_PROFILE_BOX)) {
+ return new Boolean(_settings.getSetting(SettingsManager.SETTING_PROFILE_BOX) == SettingsManager.VALUE_ENABLED);
+ } else if(name.equals(FIELD_PUBLIC_CONNS)) {
+ return new Boolean(_settings.getSetting(SettingsManager.SETTING_ALWAYS_ALLOW_PUBLIC_CONN) == SettingsManager.VALUE_ENABLED);
+ } else {
+ return UNDEFINED;
+ }
+ }
+}
@@ -23,14 +23,16 @@
public class BBMPlatformUser extends Scriptable {
- public static final String FIELD_DISPLAY_PIC = "displayPicture";
- public static final String FIELD_DISPLAY_NAME = "displayName";
- public static final String FIELD_PERSONAL_MSG = "personalMessage";
- public static final String FIELD_STATUS = "status";
- public static final String FIELD_STATUS_MSG = "statusMessage";
- public static final String FIELD_HANDLE = "handle";
- public static final String FIELD_PPID = "ppid";
- public static final String FIELD_TYPE = "type";
+ public static final String FIELD_DISPLAY_PIC = "displayPicture";
+ public static final String FIELD_DISPLAY_NAME = "displayName";
+ public static final String FIELD_PERSONAL_MSG = "personalMessage";
+ public static final String FIELD_STATUS = "status";
+ public static final String FIELD_STATUS_MSG = "statusMessage";
+ public static final String FIELD_HANDLE = "handle";
+ public static final String FIELD_PPID = "ppid";
+ public static final String FIELD_TYPE = "type";
+ public static final String FIELD_APP_VERSION = "appVersion";
+ public static final String FIELD_BBM_SDK_VERSION = "bbmsdkVersion";
public static final String STATUS_STR_AVAILABLE = "available";
public static final String STATUS_STR_BUSY = "busy";
@@ -57,6 +59,10 @@ public Object getField(String name) throws Exception {
return BBMPlatformUser.statusToString(_presence.getStatus());
} else if(name.equals(BBMPlatformUser.FIELD_STATUS_MSG)) {
return _presence.getStatusMessage();
+ } else if(name.equals(BBMPlatformUser.FIELD_APP_VERSION)) {
+ return _presence.getAppVersion();
+ } else if(name.equals(BBMPlatformUser.FIELD_BBM_SDK_VERSION)) {
+ return new Integer(_presence.getBBMSDKVersion());
} else if(name.equals(BBMPlatformUser.FIELD_TYPE)) {
return "BBM";
} else if(name.equals(BBMPlatformUser.FIELD_HANDLE)) {
Oops, something went wrong.

0 comments on commit 306ce7f

Please sign in to comment.