public static boolean isCollectAllowed() {
    if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
      return isHeadlessStatisticsEnabled();
    }

    if (!isDisableCollectStatistics() && !isCollectionForceDisabled()) {
      if (isAllowedByUserConsent() || isLocalStatisticsWithoutReport()) {
        return true;
      }
    }
    return false;
  }
public static boolean isCollectAllowed()