Пример #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;
 }
Пример #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);
 }
Пример #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);
  }
Пример #4
0
 @Override
 public void onDestroy() {
   super.onDestroy();
   stop();
   log.putLog("CS Destroyed");
 }
Пример #5
0
 @Override
 public void onTaskRemoved(Intent rootIntent) {
   super.onTaskRemoved(rootIntent);
   stop();
   log.putLog("CS Task removed");
 }
Пример #6
0
 @Override
 public boolean onUnbind(Intent intent) {
   log.putLog("CS Unbound");
   return super.onUnbind(intent);
 }