Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac3c3256 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Add new module-lib APIs for MTS testing" am: b9e3e9e3 am: 876c5982 am: 8c4c7d00

Change-Id: I37488a81d4066d240bdc0a22dbd3c72cafd55749
parents 892e8d87 8c4c7d00
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -118,10 +118,32 @@ package android.timezone {
  }

  public final class TimeZoneFinder {
    method @Nullable public String getIanaVersion();
    method @NonNull public static android.timezone.TimeZoneFinder getInstance();
    method @Nullable public android.timezone.CountryTimeZones lookupCountryTimeZones(@NonNull String);
  }

  public final class TzDataSetVersion {
    method public static int currentFormatMajorVersion();
    method public static int currentFormatMinorVersion();
    method public int getFormatMajorVersion();
    method public int getFormatMinorVersion();
    method public int getRevision();
    method @NonNull public String getRulesVersion();
    method public static boolean isCompatibleWithThisDevice(android.timezone.TzDataSetVersion);
    method @NonNull public static android.timezone.TzDataSetVersion read() throws java.io.IOException, android.timezone.TzDataSetVersion.TzDataSetException;
  }

  public static class TzDataSetVersion.TzDataSetException extends java.lang.Exception {
    ctor public TzDataSetVersion.TzDataSetException(String);
    ctor public TzDataSetVersion.TzDataSetException(String, Throwable);
  }

  public final class ZoneInfoDb {
    method @NonNull public static android.timezone.ZoneInfoDb getInstance();
    method @NonNull public String getVersion();
  }

}

package android.util {
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ public final class CountryTimeZones {
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public static final class TimeZoneMapping {

        @NonNull
        private libcore.timezone.CountryTimeZones.TimeZoneMapping mDelegate;

        TimeZoneMapping(libcore.timezone.CountryTimeZones.TimeZoneMapping delegate) {
+4 −5
Original line number Diff line number Diff line
@@ -36,12 +36,8 @@ public class TelephonyLookup {
    @GuardedBy("sLock")
    private static TelephonyLookup sInstance;

    @NonNull
    private final libcore.timezone.TelephonyLookup mDelegate;

    /**
     * Obtains an instance for use when resolving telephony time zone information. This method never
     * returns {@code null}.
     * Obtains an instance for use when resolving telephony time zone information.
     */
    @NonNull
    public static TelephonyLookup getInstance() {
@@ -53,6 +49,9 @@ public class TelephonyLookup {
        }
    }

    @NonNull
    private final libcore.timezone.TelephonyLookup mDelegate;

    private TelephonyLookup(@NonNull libcore.timezone.TelephonyLookup delegate) {
        mDelegate = Objects.requireNonNull(delegate);
    }
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import android.annotation.SystemApi;
import java.util.Objects;

/**
 * A class that can find telephony networks loaded via {@link TelephonyLookup}.
 * A class that can find telephony network information loaded via {@link TelephonyLookup}.
 *
 * @hide
 */
+20 −9
Original line number Diff line number Diff line
@@ -22,8 +22,10 @@ import android.annotation.SystemApi;

import com.android.internal.annotations.GuardedBy;

import java.util.Objects;

/**
 * A class that can be used to find time zones.
 * A class that can be used to find time zones using information like country and offset.
 *
 * @hide
 */
@@ -34,15 +36,8 @@ public final class TimeZoneFinder {
    @GuardedBy("sLock")
    private static TimeZoneFinder sInstance;

    private final libcore.timezone.TimeZoneFinder mDelegate;

    private TimeZoneFinder(libcore.timezone.TimeZoneFinder delegate) {
        mDelegate = delegate;
    }

    /**
     * Obtains an instance for use when resolving telephony time zone information. This method never
     * returns {@code null}.
     * Obtains the singleton instance.
     */
    @NonNull
    public static TimeZoneFinder getInstance() {
@@ -54,6 +49,22 @@ public final class TimeZoneFinder {
        return sInstance;
    }

    @NonNull
    private final libcore.timezone.TimeZoneFinder mDelegate;

    private TimeZoneFinder(@NonNull libcore.timezone.TimeZoneFinder delegate) {
        mDelegate = Objects.requireNonNull(delegate);
    }

    /**
     * Returns the IANA rules version associated with the data. If there is no version information
     * or there is a problem reading the file then {@code null} is returned.
     */
    @Nullable
    public String getIanaVersion() {
        return mDelegate.getIanaVersion();
    }

    /**
     * Returns a {@link CountryTimeZones} object associated with the specified country code.
     * Caching is handled as needed. If the country code is not recognized or there is an error
Loading