Merge "Tidy up libcore.timezone APIs" am: 8e0e0e8535

Change-Id: I0e15ce478bfaffb5defd0cfdb0e414f85bcf7af6
This commit is contained in:
Automerger Merge Worker
2020-01-31 16:29:11 +00:00
5 changed files with 13 additions and 12 deletions

View File

@@ -56,7 +56,7 @@ public final class CountryTimeZones {
*/ */
@NonNull @NonNull
public String getTimeZoneId() { public String getTimeZoneId() {
return mDelegate.timeZoneId; return mDelegate.getTimeZoneId();
} }
/** /**
@@ -187,7 +187,7 @@ public final class CountryTimeZones {
* would be a good choice <em>generally</em> when there's no other information available. * would be a good choice <em>generally</em> when there's no other information available.
*/ */
public boolean isDefaultTimeZoneBoosted() { public boolean isDefaultTimeZoneBoosted() {
return mDelegate.getDefaultTimeZoneBoost(); return mDelegate.isDefaultTimeZoneBoosted();
} }
/** /**
@@ -220,7 +220,8 @@ public final class CountryTimeZones {
mDelegate.lookupByOffsetWithBias( mDelegate.lookupByOffsetWithBias(
totalOffsetMillis, isDst, dstOffsetMillis, whenMillis, bias); totalOffsetMillis, isDst, dstOffsetMillis, whenMillis, bias);
return delegateOffsetResult == null ? null : return delegateOffsetResult == null ? null :
new OffsetResult(delegateOffsetResult.mTimeZone, delegateOffsetResult.mOneMatch); new OffsetResult(
delegateOffsetResult.getTimeZone(), delegateOffsetResult.isOnlyMatch());
} }
/** /**

View File

@@ -111,23 +111,23 @@ public final class TzDataSetVersion {
/** Returns the major version number. See {@link TzDataSetVersion}. */ /** Returns the major version number. See {@link TzDataSetVersion}. */
public int getFormatMajorVersion() { public int getFormatMajorVersion() {
return mDelegate.formatMajorVersion; return mDelegate.getFormatMajorVersion();
} }
/** Returns the minor version number. See {@link TzDataSetVersion}. */ /** Returns the minor version number. See {@link TzDataSetVersion}. */
public int getFormatMinorVersion() { public int getFormatMinorVersion() {
return mDelegate.formatMinorVersion; return mDelegate.getFormatMinorVersion();
} }
/** Returns the tzdb version string. See {@link TzDataSetVersion}. */ /** Returns the tzdb version string. See {@link TzDataSetVersion}. */
@NonNull @NonNull
public String getRulesVersion() { public String getRulesVersion() {
return mDelegate.rulesVersion; return mDelegate.getRulesVersion();
} }
/** Returns the Android revision. See {@link TzDataSetVersion}. */ /** Returns the Android revision. See {@link TzDataSetVersion}. */
public int getRevision() { public int getRevision() {
return mDelegate.revision; return mDelegate.getRevision();
} }
@Override @Override

View File

@@ -80,7 +80,7 @@ public class TimeUtils {
} }
CountryTimeZones.OffsetResult offsetResult = countryTimeZones.lookupByOffsetWithBias( CountryTimeZones.OffsetResult offsetResult = countryTimeZones.lookupByOffsetWithBias(
offsetMillis, isDst, null /* dstOffsetMillis */, whenMillis, bias); offsetMillis, isDst, null /* dstOffsetMillis */, whenMillis, bias);
return offsetResult != null ? offsetResult.mTimeZone : null; return offsetResult != null ? offsetResult.getTimeZone() : null;
} }
/** /**
@@ -108,8 +108,8 @@ public class TimeUtils {
List<String> timeZoneIds = new ArrayList<>(); List<String> timeZoneIds = new ArrayList<>();
for (TimeZoneMapping timeZoneMapping : countryTimeZones.getTimeZoneMappings()) { for (TimeZoneMapping timeZoneMapping : countryTimeZones.getTimeZoneMappings()) {
if (timeZoneMapping.showInPicker) { if (timeZoneMapping.isShownInPicker()) {
timeZoneIds.add(timeZoneMapping.timeZoneId); timeZoneIds.add(timeZoneMapping.getTimeZoneId());
} }
} }
return Collections.unmodifiableList(timeZoneIds); return Collections.unmodifiableList(timeZoneIds);

View File

@@ -402,7 +402,7 @@ public class ZoneGetter {
private static List<String> extractTimeZoneIds(List<TimeZoneMapping> timeZoneMappings) { private static List<String> extractTimeZoneIds(List<TimeZoneMapping> timeZoneMappings) {
final List<String> zoneIds = new ArrayList<>(timeZoneMappings.size()); final List<String> zoneIds = new ArrayList<>(timeZoneMappings.size());
for (TimeZoneMapping timeZoneMapping : timeZoneMappings) { for (TimeZoneMapping timeZoneMapping : timeZoneMappings) {
zoneIds.add(timeZoneMapping.timeZoneId); zoneIds.add(timeZoneMapping.getTimeZoneId());
} }
return Collections.unmodifiableList(zoneIds); return Collections.unmodifiableList(zoneIds);
} }

View File

@@ -198,7 +198,7 @@ public final class RulesManagerService extends IRulesManager.Stub {
Slog.w(TAG, "Failed to read staged distro.", e); Slog.w(TAG, "Failed to read staged distro.", e);
} }
} }
return new RulesState(baseVersion.rulesVersion, DISTRO_FORMAT_VERSION_SUPPORTED, return new RulesState(baseVersion.getRulesVersion(), DISTRO_FORMAT_VERSION_SUPPORTED,
operationInProgress, stagedOperationStatus, stagedDistroRulesVersion, operationInProgress, stagedOperationStatus, stagedDistroRulesVersion,
distroStatus, installedDistroRulesVersion); distroStatus, installedDistroRulesVersion);
} }