コード例 #1
0
ファイル: CopService.java プロジェクト: k-code/k-car
 @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
ファイル: CopService.java プロジェクト: k-code/k-car
 @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
ファイル: CopService.java プロジェクト: k-code/k-car
  @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
ファイル: CopService.java プロジェクト: k-code/k-car
 @Override
 public void onDestroy() {
   super.onDestroy();
   stop();
   log.putLog("CS Destroyed");
 }
コード例 #5
0
ファイル: CopService.java プロジェクト: k-code/k-car
 @Override
 public void onTaskRemoved(Intent rootIntent) {
   super.onTaskRemoved(rootIntent);
   stop();
   log.putLog("CS Task removed");
 }
コード例 #6
0
ファイル: CopService.java プロジェクト: k-code/k-car
 @Override
 public boolean onUnbind(Intent intent) {
   log.putLog("CS Unbound");
   return super.onUnbind(intent);
 }