Example #1
0
 @Override
 public IBinder onBind(Intent intent) {
   log.putLog("CS Binding...");
   if (IWakeUpBinder.class.getName().equals(intent.getStringExtra(EXTRA_BINDER))) {
     return wakeUpBinder;
   }
   return mBinder;
 }
Example #2
0
 @Override
 public void onCreate() {
   super.onCreate();
   Thread.setDefaultUncaughtExceptionHandler(new ProcessKillerException());
   log = new LogsDB(this);
   log.putLog("CS Created");
   networkServiceIntent = new Intent(this, NetworkService.class);
 }
Example #3
0
  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
    log.putLog("CS Starting...");
    if (isRunning()) {
      log.putLog("Already running");
      stopSelf();
      return START_NOT_STICKY;
    }
    setRunning(true);
    // startDebugThread();

    videoService = new VideoService(this);
    usbService = new UsbService(this);
    lightService = new LightService(this);
    orientationService = new OrientationService(this);
    locationService = new LocationService(this);
    updateService = new UpdateService(this);
    bindService(networkServiceIntent, networkServiceConnection, Context.BIND_AUTO_CREATE);

    usbService.start();
    updateService.start();

    return super.onStartCommand(intent, flags, startId);
  }
Example #4
0
 @Override
 public void onDestroy() {
   super.onDestroy();
   stop();
   log.putLog("CS Destroyed");
 }
Example #5
0
 @Override
 public void onTaskRemoved(Intent rootIntent) {
   super.onTaskRemoved(rootIntent);
   stop();
   log.putLog("CS Task removed");
 }
Example #6
0
 @Override
 public boolean onUnbind(Intent intent) {
   log.putLog("CS Unbound");
   return super.onUnbind(intent);
 }