Ejemplo n.º 1
0
        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
          traceService = ((TraceService.ServiceBinder) service).getService();
          if (traceService.isStart()) {
            serviceToggleButton.setChecked(true);
            tracingAppTextView.setText("Trace: " + traceService.getTracingApp().getProcessName());
          } else {
            serviceToggleButton.setChecked(false);
          }

          serviceToggleButton.setOnCheckedChangeListener(
              new OnCheckedChangeListener() {

                @Override
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                  if (isChecked) {
                    traceService.start();
                  } else {
                    traceService.stop();
                  }
                }
              });
        }
Ejemplo n.º 2
0
 public void setInterval(long interval) {
   if (traceService != null) {
     traceService.setInterval(interval);
   }
 }
Ejemplo n.º 3
0
 public long getInterval() {
   if (traceService != null) {
     return traceService.getInterval();
   }
   return 10000;
 }