/** @return */ public QualityOfServiceTest getQoSTest() { if (testTask != null) { return testTask.getQoSTest(); } return null; }
public String getTestUuid() { if (testTask != null) { return testTask.getTestUuid(); } else { return ConfigHelper.getLastTestUuid(getApplicationContext(), true); } }
/** @return */ public Map<QoSTestResultEnum, Counter> getQoSGroupCounterMap() { if (testTask != null) { return testTask.getQoSGroupCounterMap(); } else { return null; } }
public void stopTest() { if (testTask != null) { Log.d(DEBUG_TAG, "RMBTTest stopped"); testTask.cancel(); taskEnded(); } }
@Override public void onDestroy() { Log.d(DEBUG_TAG, "destroyed"); super.onDestroy(); if (testTask != null) { Log.d(DEBUG_TAG, "RMBTTest stopped by onDestroy"); testTask.cancel(); } removeNotification(); unlock(); if (testTask != null) { testTask.cancel(); testTask = null; } handler.removeCallbacks(addNotificationRunnable); handler.removeCallbacks(deadman); // unregisterReceiver(mNetworkStateIntentReceiver); }
@Override public void taskEnded() { unlock(); removeNotification(); handler.removeCallbacks(deadman); completed = true; sendBroadcast(new Intent(BROADCAST_TEST_FINISHED)); stopSelf(); if (testTask != null) { ConfigHelper.setLastTestUuid(getApplicationContext(), testTask.getTestUuid()); } Log.i("RMBTService", "stopped!"); }
@Override public int onStartCommand(final Intent intent, final int flags, final int startId) { String action = null; if (intent != null) action = intent.getAction(); Log.i(DEBUG_TAG, "onStartCommand; action=" + action); if (ACTION_ABORT_TEST.equals(action)) { Log.i(DEBUG_TAG, "ACTION_ABORT_TEST received"); stopTest(); return START_NOT_STICKY; } if (ACTION_START_TEST.equals(action) || ACTION_LOOP_TEST.equals(action)) { if (testTask != null && testTask.isRunning()) { if (ACTION_LOOP_TEST.equals(action)) // do not cancel test if running in loop mode return START_STICKY; testTask.cancel(); // otherwise cancel } completed = false; // lock wifi + power lock(); testTask = new RMBTTask(getApplicationContext()); testTask.setEndTaskListener(this); testTask.execute(handler); Log.d(DEBUG_TAG, "RMBTTest started"); handler.postDelayed(addNotificationRunnable, 200); handler.postDelayed(deadman, DEADMAN_TIME); return START_STICKY; } return START_NOT_STICKY; }
public Location getLocation() { if (testTask != null) return testTask.getLocation(); else return null; }
/** @return */ public QoSTestEnum getQoSTestStatus() { if (testTask != null) return testTask.getQoSTestStatus(); else return null; }
/** @return */ public int getQoSTestSize() { if (testTask != null) return testTask.getQoSTestSize(); else return 0; }
public boolean isTestRunning() { return testTask != null && testTask.isRunning(); }
/** @return */ public float getQoSTestProgress() { if (testTask != null) return testTask.getQoSTestProgress(); else return 0; }
public NdtStatus getNdtStatus() { if (testTask != null) return testTask.getNdtStatus(); else return null; }
public IntermediateResult getIntermediateResult(final IntermediateResult result) { if (testTask != null) return testTask.getIntermediateResult(result); else return null; }
public String getIP() { if (testTask != null) return testTask.getIP(); else return null; }
public int getNetworkType() { if (testTask != null) return testTask.getNetworkType(); else return 0; }
public String getOperatorName() { if (testTask != null) return testTask.getOperatorName(); else return null; }
public int getSignalType() { if (testTask != null) return testTask.getSignalType(); else return InformationCollector.SINGAL_TYPE_NO_SIGNAL; }
public Integer getSignal() { if (testTask != null) return testTask.getSignal(); else return null; }
public boolean isConnectionError() { if (testTask != null) return testTask.isConnectionError(); else return false; }
public void runNdt() { if (testTask != null) { testTask.runNDT(); } }
public String getServerName() { if (testTask != null) return testTask.getServerName(); else return null; }