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

Commit f8f9bc4b authored by Sooraj Sasindran's avatar Sooraj Sasindran Committed by android-build-merger
Browse files

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

am: 13c50710

Change-Id: I8e7fc8d876a5f25615434a2b6c884eb6eb99c479
parents 4ecd0d81 13c50710
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
    }