rhodes 2.0.0.beta1 → 2.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/LICENSE +19 -674
- data/Manifest.txt +21 -4
- data/README.textile +5 -36
- data/Rakefile +5 -0
- data/lib/build/jake.rb +3 -1
- data/lib/extensions/rexml/rexml/document.rb +2 -0
- data/lib/extensions/rexml/rexml/parsers/baseparser.rb +0 -6
- data/lib/extensions/rhoxml/rexml/child.rb +96 -0
- data/lib/extensions/rhoxml/rexml/document.rb +527 -0
- data/lib/extensions/rhoxml/rexml/element.rb +987 -0
- data/lib/extensions/rhoxml/rexml/encoding.rb +71 -0
- data/lib/extensions/rhoxml/rexml/encodings/US-ASCII.rb +30 -0
- data/lib/extensions/rhoxml/rexml/encodings/UTF-16.rb +35 -0
- data/lib/extensions/rhoxml/rexml/encodings/UTF-8.rb +18 -0
- data/lib/extensions/rhoxml/rexml/namespace.rb +47 -0
- data/lib/extensions/rhoxml/rexml/node.rb +76 -0
- data/lib/extensions/rhoxml/rexml/parent.rb +166 -0
- data/lib/extensions/rhoxml/rexml/parseexception.rb +51 -0
- data/lib/extensions/rhoxml/rexml/parsers/baseparser.rb +531 -0
- data/lib/extensions/rhoxml/rexml/parsers/treeparser.rb +100 -0
- data/lib/extensions/rhoxml/rexml/parsers/xpathparser.rb +698 -0
- data/lib/extensions/rhoxml/rexml/set.rb +1274 -0
- data/lib/extensions/rhoxml/rexml/source.rb +258 -0
- data/lib/extensions/rhoxml/rexml/xmltokens.rb +18 -0
- data/lib/extensions/rhoxml/rexml/xpath.rb +77 -0
- data/lib/extensions/rhoxml/rexml/xpath_parser.rb +806 -0
- data/lib/framework/builtinME.rb +2 -0
- data/lib/framework/dateME.rb +5 -1
- data/lib/framework/rho/render.rb +10 -2
- data/lib/framework/rhom/rhom_object_factory.rb +2 -1
- data/lib/framework/singleton.rb +1 -1
- data/platform/android/Rhodes/jni/src/rhodes.cpp +2 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +23 -18
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +42 -69
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +59 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Annotation.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +97 -85
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/SmsUriHandler.java +52 -0
- data/platform/android/build/RhodesSRC_build.files +1 -0
- data/platform/android/build/android.rake +38 -14
- data/platform/bb/RubyVM/RubyVM.jdp +1 -0
- data/platform/bb/build/RubyVM_build.files +1 -0
- data/platform/bb/build/bb.rake +44 -2
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +1 -1
- data/platform/bb/rhodes/rhodes.jdp +4 -4
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +8 -4
- data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +149 -17
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +20 -17
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +54 -28
- data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +1 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +37 -11
- data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +49 -19
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +6 -0
- data/platform/iphone/Classes/MapView/GoogleGeocoder.h +6 -7
- data/platform/iphone/Classes/MapView/GoogleGeocoder.m +70 -70
- data/platform/iphone/Classes/MapView/MapAnnotation.h +5 -3
- data/platform/iphone/Classes/MapView/MapAnnotation.m +10 -8
- data/platform/iphone/Classes/MapView/MapViewController.h +13 -10
- data/platform/iphone/Classes/MapView/MapViewController.m +131 -72
- data/platform/iphone/Classes/Rhodes.h +2 -0
- data/platform/iphone/Classes/Rhodes.m +13 -1
- data/platform/iphone/Classes/SimpleMainView.m +0 -1
- data/platform/iphone/Classes/TabbedMainView.m +5 -6
- data/platform/shared/common/RhoTime.h +2 -2
- data/platform/shared/common/RhodesApp.cpp +1 -1
- data/platform/shared/db/DBAdapter.cpp +6 -0
- data/platform/shared/net/CURLNetRequest.cpp +23 -1
- data/platform/shared/ruby/thread_win32.c +9 -1
- data/platform/shared/rubyJVM/src/com/rho/Capabilities.java +6 -0
- data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +1 -1
- data/platform/shared/rubyJVM/src/com/rho/sync/ClientRegister.java +1 -1
- data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubySymbol_Methods.java +6 -1
- data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubyTime_Methods.java +3 -3
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/InputStreamExecutor.java +1 -1
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyArray.java +15 -3
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyString.java +10 -2
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyTime.java +12 -1
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyKernelModule.java +18 -9
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubySymbol.java +5 -0
- data/platform/shared/rubyJVM/src/org/json/me/JSONArray.java +2 -1
- data/platform/shared/unzip/unzip.cpp +1 -1
- data/platform/wm/build/wm.rake +27 -6
- data/platform/wm/rhodes/Alert.cpp +335 -5
- data/platform/wm/rhodes/Alert.h +84 -1
- data/platform/wm/rhodes/MainWindow.cpp +28 -6
- data/platform/wm/rhodes/MainWindow.h +7 -2
- data/platform/wm/rhodes/Rhodes.cpp +23 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +2 -1
- data/platform/wm/rhodes/stdafx.h +1 -0
- data/platform/wm/tools/detool/detool.cpp +405 -14
- data/rakefile.rb +5 -0
- data/res/build-tools/detool.exe +0 -0
- data/res/generators/rhogen.rb +2 -0
- data/rhodes.gemspec +1 -1
- data/spec/framework_spec/app/spec/fixtures/object_values.txt +1 -1
- data/spec/framework_spec/app/spec/pagination/fixtures/object_values.txt +1 -1
- data/spec/framework_spec/app/spec/rhom_object_spec.rb +12 -12
- metadata +23 -6
- data/LICENSING_OPTIONS +0 -1
- data/platform/bb/build/rhodesApp.rapc +0 -9
- data/res/generators/templates/source/source_adapter.rb +0 -48
- data/rhobuild.yml +0 -37
@@ -56,7 +56,7 @@ public class BrowserAdapter5 implements IBrowserAdapter
|
|
56
56
|
String url = request.getURL();
|
57
57
|
if ( URI.isLocalHost(url) || URI.isLocalData(url))
|
58
58
|
{
|
59
|
-
HttpConnection connection = Utilities.makeConnection(url, request.getHeaders(), null);
|
59
|
+
HttpConnection connection = Utilities.makeConnection(url, request.getHeaders(), null, null);
|
60
60
|
|
61
61
|
return connection;
|
62
62
|
}else
|
@@ -28,11 +28,10 @@ resources\icon.png
|
|
28
28
|
src\com\rho\BBVersionSpecific.java
|
29
29
|
src\com\rho\BrowserAdapter.java
|
30
30
|
src\com\rho\BrowserAdapter5.java
|
31
|
-
src\com\rho\IBrowserAdapter.java
|
32
|
-
src\com\rho\Version.java
|
33
31
|
src\com\rho\file\Jsr75File.java
|
34
32
|
src\com\rho\file\Jsr75RAFileImpl.java
|
35
33
|
src\com\rho\file\PersistRAFileImpl.java
|
34
|
+
src\com\rho\IBrowserAdapter.java
|
36
35
|
src\com\rho\net\BaseSocket.java
|
37
36
|
src\com\rho\net\bb\BBHttpConnection.java
|
38
37
|
src\com\rho\net\bb\NativeBBHttpConnection.java
|
@@ -44,8 +43,9 @@ src\com\rho\RhoRubyHelper.java
|
|
44
43
|
src\com\rho\rubyext\Alert.java
|
45
44
|
src\com\rho\rubyext\GeoLocation.java
|
46
45
|
src\com\rho\rubyext\System.java
|
47
|
-
src\com\rho\rubyext\XMLParser.java
|
48
46
|
src\com\rho\rubyext\WebView.java
|
47
|
+
src\com\rho\rubyext\XMLParser.java
|
48
|
+
src\com\rho\Version.java
|
49
49
|
src\rhomobile\camera\Camera.java
|
50
50
|
src\rhomobile\camera\CameraFilesListener.java
|
51
51
|
src\rhomobile\camera\CameraScreen.java
|
@@ -87,7 +87,7 @@ OutputFileName=rhodes
|
|
87
87
|
RibbonPosition=0
|
88
88
|
[RolloverIcons
|
89
89
|
]
|
90
|
-
RunOnStartup=
|
90
|
+
RunOnStartup=0
|
91
91
|
StartupTier=7
|
92
92
|
SystemModule=0
|
93
93
|
Type=0
|
@@ -197,9 +197,13 @@ public class BrowserAdapter implements RenderingApplication, IBrowserAdapter
|
|
197
197
|
|
198
198
|
synchronized (Application.getEventLock())
|
199
199
|
{
|
200
|
-
|
201
|
-
|
202
|
-
|
200
|
+
if ( m_oMainScreen.getFieldCount() > 0 )
|
201
|
+
{
|
202
|
+
Field old = m_oMainScreen.getField(0);
|
203
|
+
m_oMainScreen.add(field);
|
204
|
+
m_oMainScreen.delete(old);
|
205
|
+
}else
|
206
|
+
m_oMainScreen.add(field);
|
203
207
|
/*
|
204
208
|
_mainScreen.doPaint();
|
205
209
|
if ( e == null )
|
@@ -248,7 +252,7 @@ public class BrowserAdapter implements RenderingApplication, IBrowserAdapter
|
|
248
252
|
|
249
253
|
try
|
250
254
|
{
|
251
|
-
if (referrer == null || !m_bLoadImageAsync)
|
255
|
+
if (referrer == null || URI.isLocalData(url) || !m_bLoadImageAsync)
|
252
256
|
{
|
253
257
|
boolean bLocalHost = URI.isLocalHost(url);
|
254
258
|
if ( bLocalHost && m_connResource!= null)
|
@@ -5,8 +5,20 @@ import java.util.Vector;
|
|
5
5
|
|
6
6
|
import javax.microedition.media.Player;
|
7
7
|
|
8
|
+
import rhomobile.RhodesApplication;
|
9
|
+
|
8
10
|
import net.rim.device.api.system.Application;
|
11
|
+
import net.rim.device.api.system.Bitmap;
|
12
|
+
import net.rim.device.api.ui.Field;
|
13
|
+
import net.rim.device.api.ui.FieldChangeListener;
|
14
|
+
import net.rim.device.api.ui.Manager;
|
15
|
+
import net.rim.device.api.ui.component.BitmapField;
|
16
|
+
import net.rim.device.api.ui.component.ButtonField;
|
9
17
|
import net.rim.device.api.ui.component.Dialog;
|
18
|
+
import net.rim.device.api.ui.component.LabelField;
|
19
|
+
import net.rim.device.api.ui.container.HorizontalFieldManager;
|
20
|
+
import net.rim.device.api.ui.container.PopupScreen;
|
21
|
+
import net.rim.device.api.ui.container.VerticalFieldManager;
|
10
22
|
|
11
23
|
import com.rho.RhoClassFactory;
|
12
24
|
import com.rho.RhoEmptyLogger;
|
@@ -49,21 +61,123 @@ public class Alert
|
|
49
61
|
return val != null && val != RubyConstant.QNIL ? val.toStr() : "";
|
50
62
|
}
|
51
63
|
|
64
|
+
private static class AlertDialog extends PopupScreen {
|
65
|
+
|
66
|
+
private static AlertDialog current = null;
|
67
|
+
|
68
|
+
private HorizontalFieldManager hfm;
|
69
|
+
private String callback = null;
|
70
|
+
|
71
|
+
public AlertDialog(String title, String msg, String icon, String c) {
|
72
|
+
super(new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR));
|
73
|
+
|
74
|
+
callback = c;
|
75
|
+
|
76
|
+
Manager mgr = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR);
|
77
|
+
add(mgr);
|
78
|
+
|
79
|
+
if (title != null) {
|
80
|
+
LabelField tf = new LabelField(title, Field.FIELD_HCENTER);
|
81
|
+
mgr.add(tf);
|
82
|
+
}
|
83
|
+
|
84
|
+
HorizontalFieldManager lfm = new HorizontalFieldManager();
|
85
|
+
mgr.add(lfm);
|
86
|
+
|
87
|
+
Bitmap bmp = null;
|
88
|
+
if (icon != null) {
|
89
|
+
if (icon.equalsIgnoreCase(alertTypeID.toString()))
|
90
|
+
bmp = Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION);
|
91
|
+
else if (icon.equalsIgnoreCase(questionTypeID.toString()))
|
92
|
+
bmp = Bitmap.getPredefinedBitmap(Bitmap.QUESTION);
|
93
|
+
else if (icon.equalsIgnoreCase(infoTypeID.toString()))
|
94
|
+
bmp = Bitmap.getPredefinedBitmap(Bitmap.INFORMATION);
|
95
|
+
// TODO: load bitmap from file
|
96
|
+
}
|
97
|
+
if (bmp != null) {
|
98
|
+
BitmapField bf = new BitmapField(bmp, Field.FIELD_LEFT | Field.FIELD_VCENTER);
|
99
|
+
lfm.add(bf);
|
100
|
+
}
|
101
|
+
|
102
|
+
LabelField lf = new LabelField(msg, Field.FIELD_HCENTER | Field.FIELD_VCENTER);
|
103
|
+
lfm.add(lf);
|
104
|
+
|
105
|
+
hfm = new HorizontalFieldManager();
|
106
|
+
mgr.add(hfm);
|
107
|
+
}
|
108
|
+
|
109
|
+
private class Callback implements FieldChangeListener {
|
110
|
+
|
111
|
+
private String id;
|
112
|
+
private String text;
|
113
|
+
|
114
|
+
public Callback(String i, String t) {
|
115
|
+
id = i;
|
116
|
+
text = t;
|
117
|
+
}
|
118
|
+
|
119
|
+
public void fieldChanged(Field field, int context) {
|
120
|
+
try {
|
121
|
+
RhodesApp.getInstance().callPopupCallback(callback, id, text);
|
122
|
+
} catch (Exception e) {
|
123
|
+
LOG.ERROR("show_popup callback failed.", e);
|
124
|
+
}
|
125
|
+
hide();
|
126
|
+
}
|
127
|
+
|
128
|
+
};
|
129
|
+
|
130
|
+
public void addButton(String id, String text) {
|
131
|
+
ButtonField bf = new ButtonField(text);
|
132
|
+
bf.setChangeListener(new Callback(id, text));
|
133
|
+
hfm.add(bf);
|
134
|
+
}
|
135
|
+
|
136
|
+
public void show() {
|
137
|
+
RhodesApplication app = (RhodesApplication)Application.getApplication();
|
138
|
+
app.requestForeground();
|
139
|
+
app.pushScreen(this);
|
140
|
+
current = this;
|
141
|
+
}
|
142
|
+
|
143
|
+
public void hide() {
|
144
|
+
RhodesApplication app = (RhodesApplication)Application.getApplication();
|
145
|
+
app.popScreen(this);
|
146
|
+
current = null;
|
147
|
+
}
|
148
|
+
|
149
|
+
private static void hidePopup() {
|
150
|
+
Application.getApplication().invokeLater(new Runnable() {
|
151
|
+
public void run() {
|
152
|
+
if (current == null)
|
153
|
+
return;
|
154
|
+
current.hide();
|
155
|
+
current = null;
|
156
|
+
}
|
157
|
+
});
|
158
|
+
}
|
159
|
+
};
|
160
|
+
|
52
161
|
private static class PopupHandler implements Runnable
|
53
162
|
{
|
54
|
-
String m_strMessage = "";
|
55
|
-
String m_strCallback = "";
|
56
|
-
Vector m_vecButtons = new Vector();
|
57
|
-
Vector m_vecIDs = new Vector();
|
58
|
-
private static final int atAlert = 1;
|
59
|
-
private static final int atQuestion = 2;
|
60
|
-
private static final int atInfo = 3;
|
61
|
-
int m_nType = 0;
|
163
|
+
//String m_strMessage = "";
|
164
|
+
//String m_strCallback = "";
|
165
|
+
//Vector m_vecButtons = new Vector();
|
166
|
+
//Vector m_vecIDs = new Vector();
|
167
|
+
//private static final int atAlert = 1;
|
168
|
+
//private static final int atQuestion = 2;
|
169
|
+
//private static final int atInfo = 3;
|
170
|
+
//int m_nType = 0;
|
171
|
+
|
172
|
+
private AlertDialog dialog;
|
62
173
|
|
63
174
|
PopupHandler(RubyHash hash)
|
64
175
|
{
|
65
|
-
|
66
|
-
|
176
|
+
String title = getHashStringValue(hash, titleID );
|
177
|
+
String msg = getHashStringValue(hash, messageID );
|
178
|
+
String icon = getHashStringValue(hash, iconID );
|
179
|
+
String callback = getHashStringValue(hash, callbackID );
|
180
|
+
dialog = new AlertDialog(title, msg, icon, callback);
|
67
181
|
|
68
182
|
RubyValue valButtons = hash.get(buttonsID.toSymbol());
|
69
183
|
if ( valButtons != null && valButtons instanceof RubyArray )
|
@@ -74,24 +188,24 @@ public class Alert
|
|
74
188
|
RubyValue valButton = arButtons.get(i);
|
75
189
|
if ( valButton != null && valButton instanceof RubyString )
|
76
190
|
{
|
77
|
-
|
78
|
-
|
191
|
+
String text = valButton.toStr();
|
192
|
+
dialog.addButton(text, text);
|
79
193
|
}else if ( valButton != null && valButton instanceof RubyHash )
|
80
194
|
{
|
81
195
|
String strLabel = getHashStringValue((RubyHash)valButton, titleID );
|
82
196
|
if ( strLabel.length() > 0 )
|
83
197
|
{
|
84
|
-
m_vecButtons.addElement(strLabel);
|
85
198
|
String strID = getHashStringValue((RubyHash)valButton, buttonidID );
|
86
199
|
if ( strID.length() > 0 )
|
87
|
-
|
200
|
+
dialog.addButton(strID, strLabel);
|
88
201
|
else
|
89
|
-
|
202
|
+
dialog.addButton(strLabel, strLabel);
|
90
203
|
}
|
91
204
|
}
|
92
205
|
}
|
93
206
|
}
|
94
207
|
|
208
|
+
/*
|
95
209
|
RubyValue valIcon = hash.get(iconID.toSymbol());
|
96
210
|
if ( valIcon instanceof RubySymbol )
|
97
211
|
{
|
@@ -109,11 +223,14 @@ public class Alert
|
|
109
223
|
else
|
110
224
|
m_nType = atInfo;
|
111
225
|
}
|
226
|
+
*/
|
112
227
|
}
|
113
228
|
|
114
|
-
public void run() {
|
229
|
+
public void run() {
|
230
|
+
dialog.show();
|
231
|
+
/*
|
115
232
|
Application.getApplication().requestForeground();
|
116
|
-
|
233
|
+
|
117
234
|
switch( m_nType )
|
118
235
|
{
|
119
236
|
case atAlert:
|
@@ -138,6 +255,7 @@ public class Alert
|
|
138
255
|
break;
|
139
256
|
|
140
257
|
}
|
258
|
+
*/
|
141
259
|
}
|
142
260
|
|
143
261
|
}
|
@@ -254,6 +372,20 @@ public class Alert
|
|
254
372
|
|
255
373
|
}
|
256
374
|
});
|
375
|
+
klass.getSingletonClass().defineMethod("hide_popup", new RubyNoArgMethod() {
|
376
|
+
|
377
|
+
protected RubyValue run(RubyValue receiver, RubyBlock block) {
|
378
|
+
try {
|
379
|
+
AlertDialog.hidePopup();
|
380
|
+
return RubyConstant.QNIL;
|
381
|
+
}
|
382
|
+
catch (Exception e) {
|
383
|
+
LOG.ERROR("hide_popup failed", e);
|
384
|
+
throw (e instanceof RubyException ? (RubyException)e : new RubyException(e.getMessage()));
|
385
|
+
}
|
386
|
+
}
|
387
|
+
|
388
|
+
});
|
257
389
|
klass.getSingletonClass().defineMethod("vibrate", new RubyVarArgMethod() {
|
258
390
|
protected RubyValue run(RubyValue receiver, RubyArray args, RubyBlock block)
|
259
391
|
{
|
@@ -147,24 +147,27 @@ public class PushListeningThread extends Thread {
|
|
147
147
|
}
|
148
148
|
catch (IOException ioe)
|
149
149
|
{
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
150
|
+
if ( !_stop )
|
151
|
+
{
|
152
|
+
LOG.ERROR("Exception thrown by _notify.acceptAndOpen() - exiting push thread", ioe);
|
153
|
+
|
154
|
+
// Likely the stream was closed. Catches the exception thrown by
|
155
|
+
// _notify.acceptAndOpen() when this program exits.
|
156
|
+
|
157
|
+
_stop = true;
|
158
|
+
if ( _notify != null )
|
159
|
+
{
|
160
|
+
try
|
161
|
+
{
|
162
|
+
_notify.close();
|
163
|
+
}
|
164
|
+
catch ( IOException e )
|
165
|
+
{
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
154
169
|
|
155
|
-
|
156
|
-
|
157
|
-
if ( _notify != null )
|
158
|
-
{
|
159
|
-
try
|
160
|
-
{
|
161
|
-
_notify.close();
|
162
|
-
_notify = null;
|
163
|
-
}
|
164
|
-
catch ( IOException e )
|
165
|
-
{
|
166
|
-
}
|
167
|
-
}
|
170
|
+
_notify = null;
|
168
171
|
}
|
169
172
|
}
|
170
173
|
}
|
@@ -41,6 +41,7 @@ import com.rho.*;
|
|
41
41
|
import com.rho.rubyext.GeoLocation;
|
42
42
|
import com.rho.net.NetResponse;
|
43
43
|
import com.rho.net.RhoConnection;
|
44
|
+
import com.rho.sync.ClientRegister;
|
44
45
|
import com.rho.sync.SyncThread;
|
45
46
|
import com.rho.sync.ISyncStatusListener;
|
46
47
|
import com.rho.file.Jsr75File;
|
@@ -394,16 +395,21 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
394
395
|
throw new RuntimeException("Application failed and will exit. Log will send to log server." + e.toString());
|
395
396
|
}
|
396
397
|
|
397
|
-
_pushListeningThread.stop();
|
398
|
-
|
399
|
-
RhoLogger.close();
|
400
398
|
//LOG.TRACE("Rhodes MAIN exit ***--------------------------***");
|
401
399
|
}
|
402
400
|
|
403
401
|
void doClose(){
|
404
402
|
LOG.TRACE("Rhodes DO CLOSE ***--------------------------***");
|
405
|
-
|
406
|
-
|
403
|
+
|
404
|
+
if ( _pushListeningThread != null )
|
405
|
+
_pushListeningThread.stop();
|
406
|
+
|
407
|
+
if ( ClientRegister.getInstance() != null )
|
408
|
+
ClientRegister.getInstance().Destroy();
|
409
|
+
|
410
|
+
if ( SyncThread.getInstance() != null )
|
411
|
+
SyncThread.getInstance().Destroy();
|
412
|
+
|
407
413
|
GeoLocation.stop();
|
408
414
|
RhoRuby.RhoRubyStop();
|
409
415
|
|
@@ -412,7 +418,8 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
412
418
|
}catch(IOException exc){
|
413
419
|
LOG.ERROR(exc);
|
414
420
|
}
|
415
|
-
|
421
|
+
|
422
|
+
RhoLogger.close();
|
416
423
|
}
|
417
424
|
|
418
425
|
private int m_activateHookNo = 0;
|
@@ -812,15 +819,22 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
812
819
|
|
813
820
|
public void close() {
|
814
821
|
LOG.TRACE("Calling Screen.close");
|
815
|
-
|
822
|
+
|
823
|
+
if (com.rho.Capabilities.RUNAS_SERVICE)
|
824
|
+
Application.getApplication().requestBackground();
|
825
|
+
else
|
826
|
+
{
|
827
|
+
doClose();
|
828
|
+
super.close();
|
829
|
+
}
|
816
830
|
}
|
817
|
-
|
831
|
+
/*
|
818
832
|
public boolean onClose() {
|
819
833
|
doClose();
|
820
834
|
return super.onClose();
|
821
835
|
//System.exit(0);
|
822
836
|
//return true;
|
823
|
-
}
|
837
|
+
}*/
|
824
838
|
|
825
839
|
public boolean onMenu(int instance) {
|
826
840
|
// TODO Auto-generated method stub
|
@@ -915,7 +929,7 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
915
929
|
if (_mainScreen!=null)
|
916
930
|
return;
|
917
931
|
|
918
|
-
if ( ApplicationManager.getApplicationManager().inStartup() )// || isWaitForSDCardAtStartup() )
|
932
|
+
if ( com.rho.Capabilities.RUNAS_SERVICE && ApplicationManager.getApplicationManager().inStartup() )// || isWaitForSDCardAtStartup() )
|
919
933
|
{
|
920
934
|
this.invokeLater( new Runnable() {
|
921
935
|
public void run()
|
@@ -928,10 +942,11 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
928
942
|
}
|
929
943
|
|
930
944
|
try{
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
945
|
+
if ( com.rho.Capabilities.RUNAS_SERVICE )
|
946
|
+
{
|
947
|
+
if ( !Jsr75File.isSDCardExist() )
|
948
|
+
Thread.sleep(5000); //Wait till SDCard may appear
|
949
|
+
}
|
935
950
|
|
936
951
|
RhoLogger.InitRhoLog();
|
937
952
|
|
@@ -1019,14 +1034,19 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
1019
1034
|
// 2) From System Listener - after system restart and when the app is originally installed
|
1020
1035
|
// To make sure we don't actually do the startup stuff twice,
|
1021
1036
|
// we use _mainScreen as a flag
|
1022
|
-
if ( _mainScreen == null )
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1037
|
+
if ( _mainScreen == null )
|
1038
|
+
{
|
1039
|
+
if ( com.rho.Capabilities.RUNAS_SERVICE )
|
1040
|
+
{
|
1041
|
+
LOG.INFO_OUT(" Shedule doStartupWork() ***---------------------------------- " );
|
1042
|
+
this.invokeLater( new Runnable() {
|
1043
|
+
public void run()
|
1044
|
+
{
|
1045
|
+
doStartupWork();
|
1046
|
+
}
|
1047
|
+
} );
|
1048
|
+
}else
|
1049
|
+
doStartupWork();
|
1030
1050
|
}
|
1031
1051
|
}
|
1032
1052
|
|
@@ -1035,8 +1055,11 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
1035
1055
|
|
1036
1056
|
public void powerUp() {
|
1037
1057
|
LOG.INFO_OUT(" POWER UP ***----------------------------------*** " );
|
1038
|
-
|
1039
|
-
|
1058
|
+
if ( com.rho.Capabilities.RUNAS_SERVICE)
|
1059
|
+
{
|
1060
|
+
invokeStartupWork();
|
1061
|
+
this.requestBackground();
|
1062
|
+
}
|
1040
1063
|
}
|
1041
1064
|
public void powerOff() {
|
1042
1065
|
LOG.TRACE(" POWER DOWN ***----------------------------------*** " );
|
@@ -1055,7 +1078,7 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
1055
1078
|
m_activateHooks = new Hashtable();
|
1056
1079
|
this.addSystemListener(this);
|
1057
1080
|
//this.addFileSystemListener(this);
|
1058
|
-
if ( ApplicationManager.getApplicationManager().inStartup() ) {
|
1081
|
+
if ( com.rho.Capabilities.RUNAS_SERVICE && ApplicationManager.getApplicationManager().inStartup() ) {
|
1059
1082
|
LOG.INFO_OUT("We are in the phone startup, don't start Rhodes yet, leave it to power up call");
|
1060
1083
|
} else {
|
1061
1084
|
invokeStartupWork();
|
@@ -1137,9 +1160,12 @@ final public class RhodesApplication extends UiApplication implements SystemList
|
|
1137
1160
|
LOG.ERROR("initRuby crashed.", exc);
|
1138
1161
|
return;
|
1139
1162
|
}
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1163
|
+
|
1164
|
+
if (com.rho.Capabilities.ENABLE_PUSH)
|
1165
|
+
{
|
1166
|
+
_pushListeningThread = new PushListeningThread();
|
1167
|
+
_pushListeningThread.start();
|
1168
|
+
}
|
1143
1169
|
|
1144
1170
|
while( !m_bExit )
|
1145
1171
|
{
|