code: @Override
      public void onConnect(int rst, HuaweiApiClient client) {
  
          HMSAgentLog.d("onConnect:" + rst);
  
          Activity activityCur = ActivityMgr.INST.getLastActivity();
  
          if (activityCur != null && client != null) {
              client.checkUpdate(activityCur, this);
          } else if (activity != null && client != null){
              client.checkUpdate(activity, this);
          } else {
              // 跟SE确认：activity 为 null ， 不处理 | Activity is null and does not need to be processed
              HMSAgentLog.e("no activity to checkUpdate");
              onCheckUpdateResult(HMSAgent.AgentResultCode.NO_ACTIVITY_FOR_USE);
              return;
          }
      }
docs: Huawei Api Client 连接回调
  @param rst 结果码
  @param client HuaweiApiClient 实例