package Ġbe . tr am ck rij te . work manager Ċ Ċ import Ġandroid . content . Context Ċ import Ġio . flutter . embedding . engine . plugins . Flutter Plugin Ċ import Ġio . flutter . plugin . common . Binary Messenger Ċ import Ġio . flutter . plugin . common . Method Channel Ċ import Ġio . flutter . plugin . common . Plugin Registry Ċ Ċ class ĠWork manager Plugin Ġ: ĠFlutter Plugin Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġmethod Channel : ĠMethod Channel ? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġvar Ġwork manager Call Handler : ĠWork manager Call Handler ? Ġ= Ġnull ĊĊĠĠĠ Ġoverride Ġfun Ġon Attached To Engine ( binding : ĠFlutter Plugin . Flutter Plugin Binding ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon Attached To Engine ( binding . application Context , Ġbinding . binary Messenger ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġon Attached To Engine ( context : ĠContext , Ġmess enger : ĠBinary Messenger ) Ġ{ ĊĠĠĠĠĠĠĠ Ġwork manager Call Handler Ġ= ĠWork manager Call Handler ( context ) ĊĠĠĠĠĠĠĠ Ġmethod Channel Ġ= ĠMethod Channel ( messenger , Ġ" be . tr am ck rij te . work manager / foreground _ channel _ work _ manager ") ĊĠĠĠĠĠĠĠ Ġmethod Channel ?. set MethodCall Handler ( work manager Call Handler ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Detached From Engine ( binding : ĠFlutter Plugin . Flutter Plugin Binding ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon Detached From Engine () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġon Detached From Engine () Ġ{ ĊĠĠĠĠĠĠĠ Ġmethod Channel ?. set MethodCall Handler ( null ) ĊĠĠĠĠĠĠĠ Ġmethod Channel Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġwork manager Call Handler Ġ= Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġplugin Registry Callback : ĠPlugin Registry . Plugin Regist r ant Callback ? Ġ= Ġnull ĊĊĠĠĠĠĠĠĠ Ġ@ Jvm Static ĊĠĠĠĠĠĠĠ Ġfun Ġregister With ( regist rar : ĠPlugin Registry . Registrar ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġplugin Ġ= ĠWork manager Plugin () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġplugin . on Attached To Engine ( regist rar . context (), Ġregist rar . messenger ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġregist rar . addView Destroy Listener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġplugin . on Detached From Engine () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfalse ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġ@ Deprecated ( message Ġ= Ġ" Use Ġthe ĠAndroid Ġv 2 Ġembedding Ġmethod .") ĊĠĠĠĠĠĠĠ Ġ@ Jvm Static ĊĠĠĠĠĠĠĠ Ġfun Ġset Plugin Regist r ant Callback ( plugin Registry Callback : ĠPlugin Registry . Plugin Regist r ant Callback ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠWork manager Plugin . plugin Registry Callback Ġ= Ġplugin Registry Callback ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ