work/workmanager/src/main/java/androidx/work/impl/Processor.java
public synchronized boolean startWork(String id, Extras.RuntimeExtras runtimeExtras) {
        // Work may get triggered multiple times if they have passing constraints and new work with
        // those constraints are added.
        if (mEnqueuedWorkMap.containsKey(id)) {
            Log.d(TAG, String.format("Work %s is already enqueued for processing", id));
            return false;
        }

        WorkerWrapper workWrapper =
                new WorkerWrapper.Builder(mAppContext, mConfiguration, mWorkDatabase, id)
                        .withListener(this)
                        .withSchedulers(mSchedulers)
                        .withRuntimeExtras(runtimeExtras)
                        .build();
        mEnqueuedWorkMap.put(id, workWrapper);
        mExecutor.execute(workWrapper);
        Log.d(TAG, String.format("%s: processing %s", getClass().getSimpleName(), id));
        return true;
    }
/**
     * Starts a given unit of work in the background.
     *
     * @param id The work id to execute.
     * @param runtimeExtras The {@link Extras.RuntimeExtras} for this work, if any.
     * @return {@code true} if the work was successfully enqueued for processing
     */
Starts a given unit of work in the background.
@param id The work id to execute.
@param runtimeExtras The  Extras.RuntimeExtras for this work, if any.
@return  true if the work was successfully enqueued for processing
Starts a given unit of work in the background . @param id The work id to execute . @param runtimeExtras The Extras . RuntimeExtras for this work if any . @return true if the work was successfully enqueued for processing
public synchronized boolean startWork(String id, Extras.RuntimeExtras runtimeExtras) {
        if (mEnqueuedWorkMap.containsKey(id)) {
            Log.d(TAG, String.format("Work %s is already enqueued for processing", id));
            return false;
        }
        WorkerWrapper workWrapper =
                new WorkerWrapper.Builder(mAppContext, mConfiguration, mWorkDatabase, id)
                        .withListener(this)
                        .withSchedulers(mSchedulers)
                        .withRuntimeExtras(runtimeExtras)
                        .build();
        mEnqueuedWorkMap.put(id, workWrapper);
        mExecutor.execute(workWrapper);
        Log.d(TAG, String.format("%s: processing %s", getClass().getSimpleName(), id));
        return true;
    }
public synchronized boolean startWork ( String id , Extras . RuntimeExtras runtimeExtras ) { if ( mEnqueuedWorkMap . containsKey ( id ) ) { Log . d ( TAG , String . format ( "Work %s is already enqueued for processing" , id ) ) ; return false ; } WorkerWrapper workWrapper = new WorkerWrapper . Builder ( mAppContext , mConfiguration , mWorkDatabase , id ) . withListener ( this ) . withSchedulers ( mSchedulers ) . withRuntimeExtras ( runtimeExtras ) . build ( ) ; mEnqueuedWorkMap . put ( id , workWrapper ) ; mExecutor . execute ( workWrapper ) ; Log . d ( TAG , String . format ( "%s: processing %s" , getClass ( ) . getSimpleName ( ) , id ) ) ; return true ; }
Starts a given unit of work in the background.
Starts a given unit of work in the background .
// Work may get triggered multiple times if they have passing constraints and new work with // those constraints are added.