Example #1
0
  /** @return */
  public QualityOfServiceTest getQoSTest() {
    if (testTask != null) {
      return testTask.getQoSTest();
    }

    return null;
  }
Example #2
0
 public String getTestUuid() {
   if (testTask != null) {
     return testTask.getTestUuid();
   } else {
     return ConfigHelper.getLastTestUuid(getApplicationContext(), true);
   }
 }
Example #3
0
 /** @return */
 public Map<QoSTestResultEnum, Counter> getQoSGroupCounterMap() {
   if (testTask != null) {
     return testTask.getQoSGroupCounterMap();
   } else {
     return null;
   }
 }
Example #4
0
  public void stopTest() {

    if (testTask != null) {
      Log.d(DEBUG_TAG, "RMBTTest stopped");
      testTask.cancel();
      taskEnded();
    }
  }
Example #5
0
  @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);
  }
Example #6
0
 @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!");
 }
Example #7
0
  @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;
  }
Example #8
0
 public Location getLocation() {
   if (testTask != null) return testTask.getLocation();
   else return null;
 }
Example #9
0
 /** @return */
 public QoSTestEnum getQoSTestStatus() {
   if (testTask != null) return testTask.getQoSTestStatus();
   else return null;
 }
Example #10
0
 /** @return */
 public int getQoSTestSize() {
   if (testTask != null) return testTask.getQoSTestSize();
   else return 0;
 }
Example #11
0
 public boolean isTestRunning() {
   return testTask != null && testTask.isRunning();
 }
Example #12
0
 /** @return */
 public float getQoSTestProgress() {
   if (testTask != null) return testTask.getQoSTestProgress();
   else return 0;
 }
Example #13
0
 public NdtStatus getNdtStatus() {
   if (testTask != null) return testTask.getNdtStatus();
   else return null;
 }
Example #14
0
 public IntermediateResult getIntermediateResult(final IntermediateResult result) {
   if (testTask != null) return testTask.getIntermediateResult(result);
   else return null;
 }
Example #15
0
 public String getIP() {
   if (testTask != null) return testTask.getIP();
   else return null;
 }
Example #16
0
 public int getNetworkType() {
   if (testTask != null) return testTask.getNetworkType();
   else return 0;
 }
Example #17
0
 public String getOperatorName() {
   if (testTask != null) return testTask.getOperatorName();
   else return null;
 }
Example #18
0
 public int getSignalType() {
   if (testTask != null) return testTask.getSignalType();
   else return InformationCollector.SINGAL_TYPE_NO_SIGNAL;
 }
Example #19
0
 public Integer getSignal() {
   if (testTask != null) return testTask.getSignal();
   else return null;
 }
Example #20
0
 public boolean isConnectionError() {
   if (testTask != null) return testTask.isConnectionError();
   else return false;
 }
Example #21
0
 public void runNdt() {
   if (testTask != null) {
     testTask.runNDT();
   }
 }
Example #22
0
 public String getServerName() {
   if (testTask != null) return testTask.getServerName();
   else return null;
 }