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

Commit e1087521 authored by Victor Chang's avatar Victor Chang
Browse files

Fix SettingsRoboTests build error with OpenJDK 9

- CL http://ag/3671365 broke git_pi-release/marlin-userdebug-jdk9
  when building "m checkbuild". It shouldn't break the image build

Test: m SettingsRoboTests
ROBOTEST_FILTER=com.android.settings.datetime.timezone
EXPERIMENTAL_USE_OPENJDK9=true USE_R8=true
Change-Id: I161c0350cff55bd13ba4a6c63df4e4e9bc4b1a5f
parent 22a39c2b
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;
    }
}