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

Commit 62274ef1 authored by Neil Fuller's avatar Neil Fuller
Browse files

Avoid a @Nullable Boolean

To avoid a @Nullable Boolean one method has been split into two. After
some changes in the last release this also removes an optional parameter
from the two new methods as it is now always null.

Bug: 148450671
Test: treehugger
Change-Id: I62d074ea27ad04a21c99447fc5172106d77e2e12
parent 44aede06
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -133,11 +133,18 @@ public class TimeZoneLookupHelper {
        // is DST (if known). NITZ is limited in only being able to express DST offsets in whole
        // hours and the DST info is optional.
        Integer dstAdjustmentMillis = nitzData.getDstAdjustmentMillis();
        Boolean isDst = dstAdjustmentMillis == null ? null : dstAdjustmentMillis != 0;
        Integer dstAdjustmentMillisToMatch = null; // Don't try to match the precise DST offset.
        if (dstAdjustmentMillis == null) {
            return countryTimeZones.lookupByOffsetWithBias(
                nitzData.getLocalOffsetMillis(), isDst, dstAdjustmentMillisToMatch,
                nitzData.getCurrentTimeInMillis(), bias);
                    nitzData.getCurrentTimeInMillis(), bias, nitzData.getLocalOffsetMillis());

        } else {
            // We don't try to match the exact DST offset given, we just use it to work out if
            // the country is in DST.
            boolean isDst = dstAdjustmentMillis != 0;
            return countryTimeZones.lookupByOffsetWithBias(
                    nitzData.getCurrentTimeInMillis(), bias,
                    nitzData.getLocalOffsetMillis(), isDst);
        }
    }

    /**