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

Commit 1007fe2c authored by Victor Chang's avatar Victor Chang Committed by android-build-merger
Browse files

Merge "Fix SettingsRoboTests build error with OpenJDK 9" into pi-dev

am: 6a3bac39

Change-Id: If54bf59a1969914c9fbbffaf17f4f687e85f2b71
parents 2ce9c0f8 6a3bac39
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -73,13 +73,13 @@ public class TimeZoneDataTest {
        CountryTimeZones US = mock(CountryTimeZones.class);
        when(US.getCountryIso()).thenReturn("us");
        when(US.getTimeZoneMappings()).thenReturn(Arrays.asList(
           new CountryTimeZones.TimeZoneMapping("Unknown/Secret_City", true),
           new CountryTimeZones.TimeZoneMapping("Unknown/Secret_City2", false)
           TimeZoneMapping.createForTests("Unknown/Secret_City", true),
           TimeZoneMapping.createForTests("Unknown/Secret_City2", false)
        ));
        CountryTimeZones GB = mock(CountryTimeZones.class);
        when(GB.getCountryIso()).thenReturn("gb");
        when(GB.getTimeZoneMappings()).thenReturn(Collections.singletonList(
            new TimeZoneMapping("Unknown/Secret_City", true)
            TimeZoneMapping.createForTests("Unknown/Secret_City", true)
        ));
        when(mCountryZonesFinder.lookupCountryTimeZonesForZoneId("Unknown/Secret_City"))
                .thenReturn(Arrays.asList(US, GB));
+0 −45
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package libcore.util;

import java.util.List;

/**
 * Empty implementation of CountryTimeZones for Robolectric test.
 */
public class CountryTimeZones {
    public CountryTimeZones() {
    }

    public final static class TimeZoneMapping {
        public final String timeZoneId;
        public final boolean showInPicker;

        public TimeZoneMapping(String timeZoneId, boolean showInPicker) {
            this.timeZoneId = timeZoneId;
            this.showInPicker = showInPicker;
        }
    }

    public List<TimeZoneMapping> getTimeZoneMappings() {
        return null;
    }

    public String getCountryIso() {
        return null;
    }
}
+0 −38
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package libcore.util;

import java.util.List;

/**
 * Empty implementation of CountryZonesFinder for Robolectric test.
 */
public class CountryZonesFinder {
    public CountryZonesFinder(List<CountryTimeZones> countryTimeZonesList) {}

    public List<String> lookupAllCountryIsoCodes() {
        return null;
    }

    public List<CountryTimeZones> lookupCountryTimeZonesForZoneId(String zoneId) {
        return null;
    }

    public CountryTimeZones lookupCountryTimeZones(String countryIso) {
        return null;
    }
}