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

Commit 13c50710 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use Sydney timezone instead of LordHowe" into oc-dev

parents b7c0a4bf 9105b51c
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -97,7 +97,21 @@ public final class MccTable {
        Locale locale = new Locale("", entry.mIso);
        String[] tz = TimeZoneNames.forLocale(locale);
        if (tz.length == 0) return null;
        return tz[0];

        String zoneName = tz[0];

        /* Use Australia/Sydney instead of Australia/Lord_Howe for Australia.
         * http://b/33228250
         * Todo: remove the code, see b/62418027
         */
        if (mcc == 505  /* Australia / Norfolk Island */) {
            for (String zone : tz) {
                if (zone.contains("Sydney")) {
                    zoneName = zone;
                }
            }
        }
        return zoneName;
    }

    /**
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ public class MccTableTest extends AndroidTestCase {
        assertEquals("Asia/Tokyo", MccTable.defaultTimeZoneForMcc(441));
        assertEquals("Asia/Singapore", MccTable.defaultTimeZoneForMcc(525));
        assertEquals("Europe/Stockholm", MccTable.defaultTimeZoneForMcc(240));

        /* A test for the special handling for MCC 505. http://b/33228250. */
        assertEquals("Australia/Sydney", MccTable.defaultTimeZoneForMcc(505));
        assertEquals(null, MccTable.defaultTimeZoneForMcc(0));    // mcc not defined, hence default
        assertEquals(null, MccTable.defaultTimeZoneForMcc(2000)); // mcc not defined, hence default
    }