36
36
public class AppObject extends Application {
37
37
public final static String TAG = "SynthMark" ;
38
38
39
- private final static int PROGRESS_REFRESH_RATE_MS = 300 ;
39
+ private final static int PROGRESS_REFRESH_RATE_MS = 200 ;
40
40
private final static int PROGRESS_WARM_UP_WAIT = 300 ;
41
41
42
42
private final static int NATIVETEST_STATUS_RUNNING = 2 ; //from NativeTest.h
@@ -212,6 +212,10 @@ List
getParamsForTest(int testId) {
212
212
return paramList ;
213
213
}
214
214
215
+ List <Param > getParamsForTest () {
216
+ return getParamsForTest (getCurrentTestId ());
217
+ }
218
+
215
219
@ Override
216
220
protected void finalize () throws Throwable {
217
221
testClose (mNativeTest );
@@ -263,8 +267,11 @@ public static String getDeviceInfo(){
263
267
info .append ("\n " );
264
268
}
265
269
266
- String boostInfo = readFile (SCHEDTUNE_BOOST_FILE_NAME );
267
- info .append ("schedtune.boost: " + boostInfo .trim () + "\n " );
270
+ String boostInfo = readFile (SCHEDTUNE_BOOST_FILE_NAME ).trim ();
271
+ if (boostInfo .length () == 0 ) {
272
+ boostInfo = "----" ;
273
+ }
274
+ info .append ("schedtune.boost: " + boostInfo + "\n " );
268
275
269
276
return info .toString ();
270
277
}
@@ -320,17 +327,20 @@ protected String doInBackground(String... params) {
320
327
while (running ) {
321
328
if (mNativeTest != 0 ) {
322
329
updateProgressBar ();
323
- updateOutputReport ();
324
330
325
331
int status = testStatus (mNativeTest );
326
332
if (status != NATIVETEST_STATUS_RUNNING ) {
327
333
running = false ;
328
334
}
335
+
329
336
try {
330
337
Thread .sleep (PROGRESS_REFRESH_RATE_MS );
331
338
} catch (InterruptedException e ) {
332
339
e .printStackTrace ();
333
340
}
341
+
342
+
343
+ updateOutputReport ();
334
344
} else {
335
345
break ;
336
346
}
@@ -358,6 +368,7 @@ private void updateOutputReport() {
358
368
protected void onPostExecute (String result ) {
359
369
log ("TestProgressTask.onPostExecute result: " + result );
360
370
postNotificationTestShortUpdate (mTestId , result );
371
+ postNotificationTestCompleted (mTestId );
361
372
}
362
373
}
363
374
@@ -373,16 +384,15 @@ protected String doInBackground(String... params) {
373
384
log ("Started running test... [" +mTestId +"]" );
374
385
testInit (mNativeTest , mTestId );
375
386
376
- postNotificationTestUpdate (mTestId , "Test inited " );
387
+ postNotificationTestUpdate (mTestId , "Test initialized \n " );
377
388
testRun (mNativeTest );
378
389
setRunning (false );
379
390
380
391
return "done" ; // gets passed to onPostExecute()
381
392
}
382
393
383
394
protected void onPostExecute (String result ) {
384
- log ("TestTack.onPostExecute result: " + result );
385
- postNotificationTestCompleted (mTestId );
395
+ log ("TestTask.onPostExecute result: " + result );
386
396
setRunning (false );
387
397
}
388
398
}
@@ -425,7 +435,8 @@ public void postNotificationTestStarted(int testId) {
425
435
}
426
436
427
437
public void postNotificationTestUpdate (int testId , String message ) {
428
- log ("test update" );
438
+ int end = Math .min (message .length (), 40 );
439
+ log ("Post test update: #" + message .length () + ", " + message .substring (0 , end ));
429
440
Intent intent = new Intent (AppObject .INTENT_NOTIFICATION );
430
441
intent .putExtra (INTENT_NOTIFICATION_TYPE , NOTIFICATION_TEST_UPDATE );
431
442
intent .putExtra (NOTIFICATION_KEY_TEST_ID , testId );
@@ -434,7 +445,7 @@ public void postNotificationTestUpdate(int testId, String message) {
434
445
}
435
446
436
447
public void postNotificationTestCompleted (int testId ) {
437
- log ("Test ended " );
448
+ log ("Post test completed " );
438
449
Intent intent = new Intent (AppObject .INTENT_NOTIFICATION );
439
450
intent .putExtra (INTENT_NOTIFICATION_TYPE , NOTIFICATION_TEST_COMPLETED );
440
451
intent .putExtra (NOTIFICATION_KEY_TEST_ID , testId );
0 commit comments