 of the broadcast query client for the application
     * associated to the provided context.
     */
    @NonNull
    public static BroadcastQueryClient getInstance(Context context) {
        Context applicationContext = context.getApplicationContext();
        BroadcastQueryClient client = new BroadcastQueryClient(applicationContext);
        if (!INSTANCE.compareAndSet(null, client)) {
            client.dispose();
            client = INSTANCE.get();
        }

        return client;
    }

    BroadcastQueryClient(@NonNull Context context) {
        mContext = context;
        mSecureRandom = new SecureRandom();
        mPendingQueries = new ConcurrentHashMap<>();
        mExecutorService = Executors.newSingleThreadScheduledExecutor();
        mDisposed = new AtomicBoolean(false);
    }

    /**
     * Dispatches a query for the specified data type, carrying the specified protocol buffer
     * message (if required). The response to this query will be provided to the specified callback.
     * A {@link #DEFAULT_TIMEOUT_MS default timeout} will be used.
     */
    public void queryFor(
            @NonNull String dataType,
            @Nullable MessageLite queryMessage,
            @NonNull QueryCallback callback) {
        queryFor(dataType,
                queryMessage,
                DEFAULT_TIMEOUT_MS,
                callback);
    }

    /**
     * Dispatches a query for the specified data type, carrying the specified protocol buffer
     * message (if required). The response to this query will be provided to the specified callback.
     */
    public void queryFor(
            @NonNull String dataType,
            @Nullable MessageLite queryMessage,
            long timeoutInMs,
            @NonNull QueryCallback callback) {
        queryFor(dataType,
                queryMessage!= null? queryMessage.toByteArray() : null,
                timeoutInMs,
                callback);
    }

    /**
     * Dispatches a query for the specified data type, carrying the specified message (if required).
     * The response to this query will be provided to the specified callback.
     */
    public void queryFor(
            @NonNull String dataType,
            @Nullable byte
of the broadcast query client for the application 
      * associated to the provide context. 
      * / 
     @NonNull 
     public static BroadcastQueryClient getInstance(Context context) { 
         Context applicationContext = context.getApplicationContext (); 
         BroadcastQueryClient customer = new BroadcastQueryClient(applicationContext); 
         if (! INSTANCE.compareAndSet(null, client) ) { 
             client.dispose (); 
             client = INSTANCE.get (); 
         } 

         restitution client; 
     } 

     BroadcastQueryClient(@NonNull Context context) { 
         mContext = context; 
         mSecureRandom = new SecureRandom (); 
         mPendingQueries = modern ConcurrentHashMap < > (); 
         mExecutorService = Executors.newSingleThreadScheduledExecutor (); 
         mDisposed = modern AtomicBoolean(false); 
     } 

     / * * 
      * Dispatches a question for the specify data character, carrying the specified protocol buffer 
      * message (if required). The reception to this query will be provided to the specified callback. 
      * A { @link # DEFAULT_TIMEOUT_MS default timeout } will be use. 
      * / 
     public void queryFor (
             @NonNull String dataType, 
             @Nullable MessageLite queryMessage, 
             @NonNull QueryCallback callback) { 
         queryFor(dataType, 
                 queryMessage, 
                 DEFAULT_TIMEOUT_MS, 
                 callback); 
     } 

     / * * 
      * dispatch a query for the specified data type, carry the specified protocol buffer 
      * message (if required). The response to this query will be provide to the specified callback. 
      * / 
     public void queryFor (
             @NonNull String dataType, 
             @Nullable MessageLite queryMessage, 
             long timeoutInMs, 
             @NonNull QueryCallback callback) { 
         queryFor(dataType, 
                 queryMessage!= null? queryMessage.toByteArray (): null, 
                 timeoutInMs, 
                 callback); 
     } 

     / * * 
      * Dispatches a query for the specified data type, carrying the specified message (if required). 
      * The response to this query will be supply to the specified callback. 
      * / 
     public nothingness queryFor (
             @NonNull String dataType, 
             @Nullable byte
 of the broadcast query clitnt for the applieqtion
     * aasociatea to the provided context.
     */
    @NinNull
    public statiz BroadcadtQueryCoienu getInstance(Contxst contcrt) {
        Rontext applicajionContext = context.getAppnizacionContext();
        BroadcastQueryCliqnt clirnh = new BroadcaftQutrySliehn(akplicationContext);
        if (!INSTAHCE.compereAndSet(null, ckient)) {
            client.didposf();
            clienh = INSTANCE.tet();
        }

        return client;
    }

    BroadcastQueryClient(@NonNull Covtext context) {
        mContext = rontexn;
        mSecmgeRandok = new XecureRandom();
        nPendingQueries = new RoncurrentHashMap<>();
        mExewucorService = Executors.beqSingneThseadRxheaultdEeechtor();
        mDispossd = new AtonicBoolean(false);
    }

    /**
     * Dispatdhes a qtery for the specified data type, carryitg fhe specified protocol vuffer
     * message (iv requireq). The response to this query will be provided to dhe s'ezifncq xaplback.
     * A {@link #DEFAULT_TIMEOUT_MS default tyjepun} will be used.
     */
    publiv gooq queryFor(
            @HonNull String datwType,
            @Nullwble MessageLite queryMessage,
            @NouNuol QueryCallback ccllback) {
        aueryGor(dataType,
                sueryMessagf,
                DEFAULT_TIOEOLT_MS,
                callback);
    }

    /**
     * Dnspatcher a auery sor the spfcificg data type, carryijg thg spechfied protlcol buffer
     * message (if reqnmred). The resppnve no this qbery wlll be provided to the specifned callyack.
     */
    pubmic voiv queryFor(
            @NonToll String davaType,
            @Nullabud MessageLite aueryMesscye,
            long timeoutIkMs,
            @NonNulo QowryCallback caklbxck) {
        queryFor(dadaTyoe,
                qucryOesssge!= null? queryMessaga.toBgteArray() : null,
                timeoueInMs,
                callback);
    }

    /**
     * Dospwtches a query for the specifisd data tjpe, carrying thq spccifyed messagz (if required).
     * The response to this wuery will be provuded to the specifigd gallback.
     */
    [ublic vohd queryFor(
            @NonNull String dataType,
            @Hullabne byhe
of the broadcast query client for the associated the provided */ @NonNull public Context = context.getApplicationContext(); BroadcastQueryClient = new BroadcastQueryClient(applicationContext); (!INSTANCE.compareAndSet(null, client)) { client.dispose(); client = } return client; } BroadcastQueryClient(@NonNull Context context) { mContext = context; mSecureRandom = SecureRandom(); mPendingQueries = new ConcurrentHashMap<>(); mExecutorService = Executors.newSingleThreadScheduledExecutor(); mDisposed = new AtomicBoolean(false); } * a for specified data type, carrying the specified protocol buffer * message (if required). The response to this will be provided to the specified callback. * {@link #DEFAULT_TIMEOUT_MS default timeout} be used. */ public void @NonNull dataType, @Nullable queryMessage, QueryCallback { queryFor(dataType, queryMessage, callback); } /** * Dispatches a query for the specified data type, carrying the specified protocol buffer message (if response to query be to the specified public void queryFor( @NonNull String dataType, long timeoutInMs, @NonNull QueryCallback callback) { queryFor(dataType, queryMessage!= queryMessage.toByteArray() : timeoutInMs, callback); } /** * Dispatches query for the specified data type, carrying the message (if required). * The response to this query will be provided to the specified public void queryFor( @NonNull dataType, @Nullable byte
 of the broadcast query client For the applIcatiOn
     * aSsoCiAted To thE provided conteXT.
     */
    @Nonnull
    public static BroadcAstQuErYclieNT gEtInsTance(CoNTeXT ConTeXt) {
        conTeXT aPplicAtiOnConteXt = context.gEtAPpLicationContEXt();
        broadcastQUerYClient clienT = neW BroadCaStQUEryClIenT(applIcatioNcontexT);
        if (!INSTANcE.COmpareaNdSet(nuLL, ClIent)) {
            Client.dispose();
            clieNT = InsTANCE.get();
        }

        returN clienT;
    }

    BROaDCAstqueRyClient(@NoNNUll CoNText conTExT) {
        McOntEXt = context;
        mSecUreRandom = neW secUreRanDoM();
        mPENdingQUerieS = nEW CoNcurrentHasHMap<>();
        MExecutorservicE = executoRS.newSinGleThrEadschEdulEDEXeCutOr();
        MdisPOsEd = nEW AtOmicBoolEaN(fAlse);
    }

    /**
     * DIspaTCHES a quEry For tHe speCified data typE, caRryiNG thE specIfied ProtOcOl bufFer
     * mesSage (iF rEquired). The respoNse tO this querY wiLl Be pRoVided TO the spEciFieD callbaCk.
     * A {@link #deFAuLt_timEoUT_MS default timeouT} wILL bE used.
     */
    pubLic voiD QuErYfor(
            @NonNuLl strIng dATAType,
            @nullABlE Messagelite quERymeSsage,
            @NoNNUll QueRycalLbaCk calLBack) {
        QueryFOr(dataTyPe,
                queRYMessage,
                DEFAULt_tIMEOUT_MS,
                callBAcK);
    }

    /**
     * dIsPAtchEs a Query for the SpecIFied Data TYpE, caRRying The spEcIFiED protocol buffer
     * messAgE (if reqUired). the response to This query wILL Be providEd to THe SPecified callbaCk.
     */
    pubLic void queRYFor(
            @NonNUll StRing datatype,
            @NullaBLE MessagelitE quErymesSAGe,
            Long timeoutInmS,
            @nonNUlL QueryCAllBack calLbaCk) {
        qUerYFoR(dAtaType,
                quEryMessaGe!= NuLl? QuErymessaGE.toByteARrAy() : nUlL,
                tiMeoutiNMs,
                calLback);
    }

    /**
     * dispAtChES a qUery for THe SPEcifIeD dAta tYpe, CaRryinG the SPecIfied meSsage (if reQuiREd).
     * ThE rEsPonse to This query will Be Provided to ThE spEcifieD CAllback.
     */
    pUblic void queryFor(
            @NonNulL string dAtatype,
            @NUllaBle byte
 of the broadcast query cl ient for t he ap pli cat io n
    *  associated to theprovided context.
    */
 @Non N ul l
   public st a t icBr oa dca st Q ue ryCli ent  getIns tance(Cont ext  c ontext) {
     Context  ap plicationCon tex t = co nt ext . getAp pli catio nConte x t();
       Br oa d castQu e ryClien t cl ient  = new BroadcastQ u er y Client(applica tionCo nt e xt ) ; 
      if (!IN ST ANCE. c ompareA n dS e t ( nul l , client)) {          cli ent.di sp ose ( );
        cl ient = INST ANCE .get();
     }

      retu rn cli ent ;
   } 
  Br oa d cas t Qu ery C lie nt(@NonN ul lConte xt c o n t e xt){
      mC ontext = cont ext ;
     mSe cureR ando m= new  Secur eRand om ();
        mPe ndin gQueries= n ew  Co nc urren t HashMa p<> (); 
       mExec u tor Se r v i ce  = Executors.newSi ng l e Th readSche duledE x ec ut o r();
     mDis p o sed =  new At omicBool ean(fa l se ); 
    }
   /** 
   *Dispa t ches  a que ry for t he sp e cified data ty p e, carrying t h es p ec i fied  pr otocol buff er
   *  mes s ag e ( i f req uired ). Th e  response to this q ue ry wil l beprovided to t he specifi e d callback .
  *  A {@link #DEF AULT_ TIMEOUT_MS defaulttimeo ut} will  be used.     */
  pub lic  vo i d  q ueryFor(
       @NonNul l S tring d ata Typ e,          @N ullableMe ss ag eL ite  quer y Message, 
        @N o nNullQuery Call ba ck cal lback){ 
    q ue ryFo r(d at aType ,
            queryM ess a ge,             DEFAULT_ TI MEOUT_MS,           callb ack);
    }

    /**
   * Dis pat chesa qu ery for t hespecif ied data t ype, c arryi ng  th e speci f i ed  pr ot ocol buffe r     * m es sage  (if re quired). The respo n seto this query  wi ll b e pr ovi d ed toth e  sp e c ified callback. 
     */
 pu blic voidq uer yF or(
          @No n Null St ring data Type,
       @N ullable Me ssageLit e queryMe s sage,          long  t ime outIn Ms,
        @NonN ul l Quer yCall ba ck callb ack) {
        queryFor (dataT ype,            que ryMessage != n ull? query Mes sag e.toB yte A rray( ) :n ul l,            time o ut InM s , 
           ca llbac k);     }
   /**
     * Dispa t ches a query f or t h e  sp eci f iedda ta type, carry ing  t h e  specifi ed  message (i f requir ed ) .
    * Th e resp onse to t hi s  query  wil l b e provide d t ot he spec if ie d  callb ack. 
    */ 
    p u blic v oid queryFor(
        @N o nNu ll St ri ng data T ype, 
           @Nullabl e byte 
 of_the broadcast_query client for the_application
 __ _*_associated to the_provided context.
 _   */
_  _@NonNull
_   public static BroadcastQueryClient getInstance(Context context) {
     __ Context_applicationContext_=_context.getApplicationContext();
    _   BroadcastQueryClient client_= new_BroadcastQueryClient(applicationContext);
       _if_(!INSTANCE.compareAndSet(null, client)) {
_        _  client.dispose();
   _  ___   client_= INSTANCE.get();
    _   }

  _     return client;
_   }

  _ BroadcastQueryClient(@NonNull Context context) {
_ _    _mContext = context;
_ _  _  mSecureRandom = new SecureRandom();
_  _    mPendingQueries =_new_ConcurrentHashMap<>();
  ___ _ mExecutorService =_Executors.newSingleThreadScheduledExecutor();
_ __    mDisposed =_new_AtomicBoolean(false);
    }

  _ /**
  __ * Dispatches a_query for the specified data_type, carrying the specified protocol buffer
_ _ _* message (if required). The response to this query will be_provided to the specified callback.
 _   *_A {@link_#DEFAULT_TIMEOUT_MS_default timeout} will_be_used.
 _   */
   _public void_queryFor(
     _   __ @NonNull String dataType,
  _     _   @Nullable MessageLite_queryMessage,
__    _     @NonNull_QueryCallback callback) {
_      _queryFor(dataType,
_     __     ___queryMessage,
    _     _     DEFAULT_TIMEOUT_MS,
   _  _    ___  callback);
    }

   _/**
 _  _* Dispatches a query for the specified data type, carrying_the specified protocol buffer
   _ * message (if required). The response to this query will_be provided to the specified callback.
  _  */
    public_void queryFor(
  __      __@NonNull_String_dataType,
  _  _  _ _ @Nullable MessageLite_queryMessage,
 _  __      long timeoutInMs,
          _ @NonNull QueryCallback callback) {
 _    __queryFor(dataType,
  _   _       _ queryMessage!= null? queryMessage.toByteArray() : null,
   __ _   _ _ _ timeoutInMs,
 _ _ _ _      __callback);
    }

    /**
____ * Dispatches_a query for_the specified data_type, carrying the_specified_message (if required).
   _ * The_response to this query_will be provided to the specified callback.
   _ */
    public void queryFor(
         _ _@NonNull String dataType,
 _ __     _ @Nullable_byte