@Override public IBinder onBind(Intent intent) { log.putLog("CS Binding..."); if (IWakeUpBinder.class.getName().equals(intent.getStringExtra(EXTRA_BINDER))) { return wakeUpBinder; } return mBinder; }
@Override public void onCreate() { super.onCreate(); Thread.setDefaultUncaughtExceptionHandler(new ProcessKillerException()); log = new LogsDB(this); log.putLog("CS Created"); networkServiceIntent = new Intent(this, NetworkService.class); }
@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); }
@Override public void onDestroy() { super.onDestroy(); stop(); log.putLog("CS Destroyed"); }
@Override public void onTaskRemoved(Intent rootIntent) { super.onTaskRemoved(rootIntent); stop(); log.putLog("CS Task removed"); }
@Override public boolean onUnbind(Intent intent) { log.putLog("CS Unbound"); return super.onUnbind(intent); }