MCPcopy Create free account
hub / github.com/buggins/coolreader / run

Method run

android/src/org/coolreader/crengine/Engine.java:149–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147 }
148
149 public void run() {
150 try {
151 if (LOG_ENGINE_TASKS)
152 log.i("running task.work() "
153 + task.getClass().getName());
154 if (!initialized)
155 throw new IllegalStateException("Engine not initialized");
156 // run task
157 task.work();
158 if (LOG_ENGINE_TASKS)
159 log.i("exited task.work() "
160 + task.getClass().getName());
161 // post success callback
162 mBackgroundThread.postGUI(new Runnable() {
163 public void run() {
164 if (LOG_ENGINE_TASKS)
165 log.i("running task.done() "
166 + task.getClass().getName()
167 + " in gui thread");
168 task.done();
169 }
170 });
171 // } catch ( final FatalError e ) {
172 // TODO:
173 // Handler h = view.getHandler();
174 //
175 // if ( h==null ) {
176 // View root = view.getRootView();
177 // h = root.getHandler();
178 // }
179 // if ( h==null ) {
180 // //
181 // e.handle();
182 // } else {
183 // h.postAtFrontOfQueue(new Runnable() {
184 // public void run() {
185 // e.handle();
186 // }
187 // });
188 // }
189 } catch (final Exception e) {
190 log.e("exception while running task "
191 + task.getClass().getName(), e);
192 // post error callback
193 mBackgroundThread.postGUI(new Runnable() {
194 public void run() {
195 log.e("running task.fail(" + e.getMessage()
196 + ") " + task.getClass().getSimpleName()
197 + " in gui thread ");
198 task.fail(e);
199 }
200 });
201 }
202 }
203 }
204
205 /**

Callers

nothing calls this directly

Calls 8

getClassMethod · 0.80
postGUIMethod · 0.80
iMethod · 0.65
workMethod · 0.65
doneMethod · 0.65
eMethod · 0.65
failMethod · 0.65
getNameMethod · 0.45

Tested by

no test coverage detected