work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher.java
@MainThread
    public boolean add(@NonNull final Intent intent, final int startId) {
        assertMainThread();
        String action = intent.getAction();
        if (TextUtils.isEmpty(action)) {
            Log.w(TAG, "Unknown command. Ignoring");
            return false;
        }

        // If we have a constraints changed intent in the queue don't add a second one. We are
        // treating this intent as special because every time a worker with constraints is complete
        // it kicks off an update for constraint proxies.
        if (CommandHandler.ACTION_CONSTRAINTS_CHANGED.equals(action)
                && hasIntentWithAction(CommandHandler.ACTION_CONSTRAINTS_CHANGED)) {
            return false;
        }

        intent.putExtra(KEY_START_ID, startId);
        synchronized (mIntents) {
            mIntents.add(intent);
        }
        processCommand();
        return true;
    }
/**
     * Adds the {@link Intent} intent and the startId to the command processor queue.
     *
     * @param intent The {@link Intent} command that needs to be added to the command queue.
     * @param startId The command startId
     * @return <code>true</code> when the command was added to the command processor queue.
     */
Adds the  Intent intent and the startId to the command processor queue.
@param intent The  Intent command that needs to be added to the command queue.
@param startId The command startId
@return true when the command was added to the command processor queue.
Adds the Intent intent and the startId to the command processor queue . @param intent The Intent command that needs to be added to the command queue . @param startId The command startId @return true when the command was added to the command processor queue .
@MainThread
    public boolean add(@NonNull final Intent intent, final int startId) {
        assertMainThread();
        String action = intent.getAction();
        if (TextUtils.isEmpty(action)) {
            Log.w(TAG, "Unknown command. Ignoring");
            return false;
        }
        if (CommandHandler.ACTION_CONSTRAINTS_CHANGED.equals(action)
                && hasIntentWithAction(CommandHandler.ACTION_CONSTRAINTS_CHANGED)) {
            return false;
        }
        intent.putExtra(KEY_START_ID, startId);
        synchronized (mIntents) {
            mIntents.add(intent);
        }
        processCommand();
        return true;
    }
@ MainThread public boolean add ( @ NonNull final Intent intent , final int startId ) { assertMainThread ( ) ; String action = intent . getAction ( ) ; if ( TextUtils . isEmpty ( action ) ) { Log . w ( TAG , "Unknown command. Ignoring" ) ; return false ; } if ( CommandHandler . ACTION_CONSTRAINTS_CHANGED . equals ( action ) && hasIntentWithAction ( CommandHandler . ACTION_CONSTRAINTS_CHANGED ) ) { return false ; } intent . putExtra ( KEY_START_ID , startId ) ; synchronized ( mIntents ) { mIntents . add ( intent ) ; } processCommand ( ) ; return true ; }
Adds the {@link Intent} intent and the startId to the command processor queue.
Adds the { @link Intent } intent and the startId to the command processor queue .
// If we have a constraints changed intent in the queue don't add a second one. We are // treating this intent as special because every time a worker with constraints is complete // it kicks off an update for constraint proxies.