code: public static void registerHMSPush(Application application, String profile) {
      if (null == application) {
        throw new IllegalArgumentException("[HMS] context cannot be null.");
      }
  
      if (!isHuaweiPhone()) {
        printErrorLog("[HMS] register error, is not huawei phone!");
        return;
      }
  
      if (!checkHuaweiManifest(application)) {
        printErrorLog("[HMS] register error, mainifest is incomplete!");
        return;
      }
  
      hwDeviceProfile = profile;
      boolean hmsInitResult = com.huawei.android.hms.agent.HMSAgent.init(application);
      if (!hmsInitResult) {
        LOGGER.e("failed to init HMSAgent.");
      }
  
      LOGGER.d("[HMS] start register HMS push");
    }
docs: 初始化方法，建议在 Application onCreate 里面调用
  @param application
  @param profile 华为推送配置