code: public void connect(IClientConnectCallback callback, boolean allowResolve) {
  
          if (context == null) {
              aSysnCallback(HMSAgent.AgentResultCode.HMSAGENT_NO_INIT, callback);
              return;
          }
  
          HuaweiApiClient client =  getApiClient();
          // client 有效，则直接回调
          if (client != null && client.isConnected()) {
              HMSAgentLog.d("client is valid");
              aSysnCallback(HMSAgent.AgentResultCode.HMSAGENT_SUCCESS, callback);
              return;
          } else {
              // client无效，将callback加入队列，并启动连接
              synchronized (CALLBACK_LOCK) {
                  HMSAgentLog.d("client is invalid：size=" + connCallbacks.size());
                  allowResolveConnectError = allowResolveConnectError || allowResolve;
                  if (connCallbacks.isEmpty()) {
                      connCallbacks.add(callback);
  
                      // 连接尝试最大次数
                      curLeftResolveTimes = MAX_RESOLVE_TIMES;
  
                      startConnect();
                  } else {
                      connCallbacks.add(callback);
                  }
              }
          }
      }
docs: 连接 HuaweiApiClient,
  @param callback 连接结果回调，一定不能为null,在子线程进行回调
  @param allowResolve 是否允许解决错误，解决错误时可能会拉起界面