@DSVerified
  @DSBan(DSCat.DROIDSAFE_INTERNAL)
  public static void modelService(android.app.Service service) {
    if (mApplication != null) service.setApplication(mApplication);

    service.droidsafeAttachContext(context);

    service.onCreate();
    for (IntentFilter filter : service.__ds__intentFilters) {

      Intent intent = service.__ds__registerIntentFilter(filter);

      mApplication.__ds__intentsFromFilter.add(intent);

      service.onBind(intent);
      service.onRebind(intent);
      service.onStart(intent, DSUtils.FAKE_INT);
      service.onTaskRemoved(intent);
      service.onStartCommand(intent, DSUtils.FAKE_INT, DSUtils.FAKE_INT);
      service.onUnbind(intent);
      if (service instanceof IntentService) {
        ((IntentService) service).__ds__onHandleIntent(intent);
      }
    }
    service.droidsafeOnSubServiceHook();
    service.onConfigurationChanged(new Configuration());
    service.onLowMemory();
    service.onTrimMemory(0);
    service.stopSelf(0);
    service.onDestroy();
  }
  @Override
  public void onTaskRemoved(Intent rootIntent) {
    // super.onTaskRemoved(rootIntent);
    Log.i(TAG, "onTaskRemoved: ");
    // метод вызывается, когда уничтожают процесс...

    super.onTaskRemoved(rootIntent);
  }
 @Override
 public void onTaskRemoved(Intent rootIntent) {
   super.onTaskRemoved(rootIntent);
   Log.i(TAG, "Unregistering receiver");
   PackageManager pm = getPackageManager();
   ComponentName component = new ComponentName(this, CalendarChangeReceiver.class);
   pm.setComponentEnabledSetting(
       component, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
 }
 // @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
 @Override
 public void onTaskRemoved(Intent rootIntent) {
   Log.d(TAG, "Task has been removed");
   unregisterActionReceiver();
   if (config.getStopOnTerminate()) {
     stopSelf();
   }
   super.onTaskRemoved(rootIntent);
 }
 @Override
 public void onTaskRemoved(final Intent rootIntent) {
   super.onTaskRemoved(rootIntent);
   if (BuildConfig.DEBUG) Logger.log("sensor service task removed");
   // Restart service in 500 ms
   ((AlarmManager) getSystemService(Context.ALARM_SERVICE))
       .set(
           AlarmManager.RTC,
           System.currentTimeMillis() + 500,
           PendingIntent.getService(this, 3, new Intent(this, SensorListener.class), 0));
 }
 @Override
 public void onTaskRemoved(Intent rootIntent) {
   super.onTaskRemoved(rootIntent);
   if (!Storage.isEmptyLocations()) {
     sendGeofenceInfo();
     Storage.clearLocations();
     /* Wait for a second after sending the data because swiping the app off the recent app list
     kills any background processes immediately and the data doesn't have time to get stored in
     the database otherwise.*/
     try {
       TimeUnit.SECONDS.sleep(1);
     } catch (java.lang.InterruptedException e) {
       Log.d(TAG, e.toString());
     }
   }
   stopSelf();
 }
  @Override
  public void onTaskRemoved(Intent rootIntent) {
    try {
      Log.d(Settings.TAG, "Swipped out.");
      super.onTaskRemoved(rootIntent);
      if (wakeLock.isHeld()) wakeLock.release();

      handler.removeCallbacks(runnable);
      stopForeground(true);
      /*code for step down*/
      // unregisterReceiver(mybroadcast);
      is_Service_Running = false;

      if (!stop_request) sendBroadcast(new Intent("YouWillNeverKillMe"));

      stopSelf();
    } catch (Exception ex) {
      Log.d(Settings.TAG, "error " + ex.toString());
    }
  }
 @Override
 public void onTaskRemoved(Intent rootIntent) {
   super.onTaskRemoved(rootIntent);
 }
Beispiel #9
0
 @Override
 public void onTaskRemoved(Intent rootIntent) {
   super.onTaskRemoved(rootIntent);
   stop();
   log.putLog("CS Task removed");
 }