code: private void startConnect() {
  
          // 触发一次连接将重试次数减1
          curLeftResolveTimes--;
  
          HMSAgentLog.d("start thread to connect");
          ThreadUtil.INST.excute(new Runnable() {
              @Override
              public void run() {
                  HuaweiApiClient client =  getApiClient();
  
                  if (client != null) {
                      HMSAgentLog.d("connect");
                      Activity curActivity = ActivityMgr.INST.getLastActivity();
  
                      // 考虑到有cp后台需要调用接口，HMSSDK去掉了activity不能为空的判断。这里只是取当前activity，可能为空
                      timeoutHandler.sendEmptyMessageDelayed(APICLIENT_TIMEOUT_HANDLE_MSG, APICLIENT_CONNECT_TIMEOUT);
                      client.connect(curActivity);
                  } else {
                      HMSAgentLog.d("client is generate error");
                      onConnectEnd(HMSAgent.AgentResultCode.RESULT_IS_NULL);
                  }
              }
          });
      }
docs: 线程中进行Huawei Api Client 的连接