code: public static String getWorkManager(DistributableWork work)
     {
        if (work != null && work instanceof WorkContextProvider)
        {
           List<WorkContext> contexts = ((WorkContextProvider)work).getWorkContexts();
           if (contexts != null)
           {
              for (WorkContext wc : contexts)
              {
                 if (wc instanceof DistributableContext)
                 {
                    DistributableContext dc = (DistributableContext)wc;
                    return dc.getWorkManager();
                 }
                 else if (wc instanceof HintsContext)
                 {
                    HintsContext hc = (HintsContext)wc;
                    if (hc.getHints().keySet().contains(DistributableContext.WORKMANAGER))
                    {
                       Serializable value = hc.getHints().get(DistributableContext.WORKMANAGER);
                       if (value != null && value instanceof String)
                       {
                          return (String)value;
                       }
                    }
                 }
              }
           }
        }
  
        return null;
     }
docs: Get explicit work manager override
  @param work The work instance
  @return The override, if none return null