work/workmanager/src/main/java/androidx/work/impl/Processor.java
public synchronized boolean stopWork(String id) {
        Log.d(TAG, String.format("Processor stopping %s", id));
        WorkerWrapper wrapper = mEnqueuedWorkMap.remove(id);
        if (wrapper != null) {
            wrapper.interrupt(false);
            Log.d(TAG, String.format("WorkerWrapper stopped for %s", id));
            return true;
        }
        Log.d(TAG, String.format("WorkerWrapper could not be found for %s", id));
        return false;
    }
/**
     * Stops a unit of work.
     *
     * @param id The work id to stop
     * @return {@code true} if the work was stopped successfully
     */
Stops a unit of work.
@param id The work id to stop
@return  true if the work was stopped successfully
Stops a unit of work . @param id The work id to stop @return true if the work was stopped successfully
public synchronized boolean stopWork(String id) {
        Log.d(TAG, String.format("Processor stopping %s", id));
        WorkerWrapper wrapper = mEnqueuedWorkMap.remove(id);
        if (wrapper != null) {
            wrapper.interrupt(false);
            Log.d(TAG, String.format("WorkerWrapper stopped for %s", id));
            return true;
        }
        Log.d(TAG, String.format("WorkerWrapper could not be found for %s", id));
        return false;
    }
public synchronized boolean stopWork ( String id ) { Log . d ( TAG , String . format ( "Processor stopping %s" , id ) ) ; WorkerWrapper wrapper = mEnqueuedWorkMap . remove ( id ) ; if ( wrapper != null ) { wrapper . interrupt ( false ) ; Log . d ( TAG , String . format ( "WorkerWrapper stopped for %s" , id ) ) ; return true ; } Log . d ( TAG , String . format ( "WorkerWrapper could not be found for %s" , id ) ) ; return false ; }
Stops a unit of work.
Stops a unit of work .