code: public static String getCalendarType(ULocale loc) {
          String calType = loc.getKeywordValue(CALKEY);
          if (calType != null) {
              return calType;
          }
  
          // Canonicalize, so grandfathered variant will be transformed to keywords
          ULocale canonical = ULocale.createCanonical(loc.toString());
          calType = canonical.getKeywordValue(CALKEY);
          if (calType != null) {
              return calType;
          }
  
          // When calendar keyword is not available, use the locale's
          // region to get the default calendar type
          String region = ULocale.getRegionForSupplementalData(canonical, true);
          return CalendarPreferences.INSTANCE.getCalendarTypeForRegion(region);
      }
docs: Returns a calendar type for the given locale.
  When the given locale has calendar keyword, the
  value of calendar keyword is returned.  Otherwise,
  the default calendar type for the locale is returned.
  @param loc The locale
  @return Calendar type string, such as "gregorian"