code: private static DateFormat get(int timeStyle, int dateStyle,
                                    int flags, Locale loc) {
          if ((flags & 1) != 0) {
              if (timeStyle < 0 || timeStyle > 3) {
                  throw new IllegalArgumentException("Illegal time style " + timeStyle);
              }
          } else {
              timeStyle = -1;
          }
          if ((flags & 2) != 0) {
              if (dateStyle < 0 || dateStyle > 3) {
                  throw new IllegalArgumentException("Illegal date style " + dateStyle);
              }
          } else {
              dateStyle = -1;
          }
          try {
              // Check whether a provider can provide an implementation that's closer
              // to the requested locale than what the Java runtime itself can provide.
              /* J2ObjC: java.text.spi is not provided.
              LocaleServiceProviderPool pool =
                  LocaleServiceProviderPool.getPool(DateFormatProvider.class);
              if (pool.hasProviders()) {
                  DateFormat providersInstance = pool.getLocalizedObject(
                                                      DateFormatGetter.INSTANCE,
                                                      loc,
                                                      timeStyle,
                                                      dateStyle,
                                                      flags);
                  if (providersInstance != null) {
                      return providersInstance;
                  }
              }*/
  
              return new SimpleDateFormat(timeStyle, dateStyle, loc);
          } catch (MissingResourceException e) {
              return new SimpleDateFormat("M/d/yy h:mm a");
          }
      }
docs: Creates a DateFormat with the given time and/or date style in the given
  locale.
  @param timeStyle a value from 0 to 3 indicating the time format,
  ignored if flags is 2
  @param dateStyle a value from 0 to 3 indicating the time format,
  ignored if flags is 1
  @param flags either 1 for a time format, 2 for a date format,
  or 3 for a date/time format
  @param loc the locale for the format