app/src/main/java/org/andstatus/app/service/MyService.java
/**
     * Notify background processes that the service is stopping.
     * Stop if background processes has finished.
     * Persist everything that we'll need on next Service creation and free resources
     */
Notify background processes that the service is stopping.
Stop if background processes has finished.
Persist everything that we'll need on next Service creation and free resources
Notify background processes that the service is stopping . Stop if background processes has finished . Persist everything that we ' ll need on next Service creation and free resources
private void stopDelayed(boolean forceNow) {
        if (isStopping.compareAndSet(false, true)) {
            MyLog.v(TAG, () -> "MyService " + instanceId + " stopping" + (forceNow ? ", forced" : ""));
        }
        startedForegrounLastTime = 0;
        if (!executors.stopExecutor(forceNow) && !forceNow) {
            return;
        }
        unInitialize();
        MyServiceEventsBroadcaster.newInstance(myContext, getServiceState())
                .setEvent(MyServiceEvent.ON_STOP).broadcast();
    }
private void stopDelayed ( boolean forceNow ) { if ( isStopping . compareAndSet ( false , true ) ) { MyLog . v ( TAG , ( ) -> "MyService " + instanceId + " stopping" + ( forceNow ? ", forced" : "" ) ) ; } startedForegrounLastTime = 0 ; if ( ! executors . stopExecutor ( forceNow ) && ! forceNow ) { return ; } unInitialize ( ) ; MyServiceEventsBroadcaster . newInstance ( myContext , getServiceState ( ) ) . setEvent ( MyServiceEvent . ON_STOP ) . broadcast ( ) ; }
Notify background processes that the service is stopping.
Notify background processes that the service is stopping .