public void unregisterWorkManager ( WorkManager wm ) { if ( wm != null ) { if ( wm . getName ( ) == null || wm . getName ( ) . trim ( ) . equals ( "" ) ) throw new IllegalArgumentException ( "The name of WorkManager is invalid: " + wm ) ; if ( trace ) log . tracef ( "Unregistering WorkManager: %s" , wm ) ; if ( workmanagers . keySet ( ) . contains ( wm . getName ( ) ) ) { workmanagers . remove ( wm . getName ( ) ) ; // Clear any events if ( wm instanceof DistributedWorkManager ) { WorkManagerEventQueue wmeq = WorkManagerEventQueue . getInstance ( ) ; List < WorkManagerEvent > events = wmeq . getEvents ( wm . getName ( ) ) ; events . clear ( ) ; } } } }
Unregister work manager