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

Commit afd954f3 authored by Neil Fuller's avatar Neil Fuller Committed by Android (Google) Code Review
Browse files

Merge "Disable geolocation time zone detection"

parents bdbc1c36 77e8fe62
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -117,12 +117,13 @@ public final class TimeZoneDetectorCallbackImpl implements TimeZoneDetectorStrat

    @Override
    public ConfigurationInternal getConfigurationInternal(@UserIdInt int userId) {
        boolean geoDetectionEnabled = mGeoDetectionFeatureEnabled && isGeoDetectionEnabled(userId);
        return new ConfigurationInternal.Builder(userId)
                .setUserConfigAllowed(isUserConfigAllowed(userId))
                .setAutoDetectionSupported(isAutoDetectionSupported())
                .setAutoDetectionEnabled(isAutoDetectionEnabled())
                .setLocationEnabled(isLocationEnabled(userId))
                .setGeoDetectionEnabled(isGeoDetectionEnabled(userId))
                .setGeoDetectionEnabled(geoDetectionEnabled)
                .build();
    }

@@ -167,11 +168,13 @@ public final class TimeZoneDetectorCallbackImpl implements TimeZoneDetectorStrat
            final boolean autoDetectionEnabled = configuration.isAutoDetectionEnabled();
            setAutoDetectionEnabled(autoDetectionEnabled);

            if (mGeoDetectionFeatureEnabled) {
                final int userId = configuration.getUserId();
                final boolean geoTzDetectionEnabled = configuration.isGeoDetectionEnabled();
                setGeoDetectionEnabled(userId, geoTzDetectionEnabled);
            }
        }
    }

    private boolean isUserConfigAllowed(@UserIdInt int userId) {
        UserHandle userHandle = UserHandle.of(userId);