Disable geolocation time zone detection

Time zone detection code was not referring to the "enable feature"
boolean for the upcoming geolocation time zone detection feature in some
necessary places, leading the time zone detector to conclude the feature
was enabled.

That meant devices would ignore telephony time zone suggestions, but
because geolocation isn't implemented fully yet, there were no
geo-based suggestions. This meant the device would just sit on its
existing time zone.

This change puts in the necessary checks.

Bug: 167904672
Test: build / boot / manually verify telephony info is being used
Change-Id: I7be2dbaa2afd1806b2ba248c3be3f9d5251650e1
This commit is contained in:
Neil Fuller
2020-09-10 14:27:24 +01:00
parent 7febf91494
commit 77e8fe6243

View File

@@ -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,9 +168,11 @@ public final class TimeZoneDetectorCallbackImpl implements TimeZoneDetectorStrat
final boolean autoDetectionEnabled = configuration.isAutoDetectionEnabled();
setAutoDetectionEnabled(autoDetectionEnabled);
final int userId = configuration.getUserId();
final boolean geoTzDetectionEnabled = configuration.isGeoDetectionEnabled();
setGeoDetectionEnabled(userId, geoTzDetectionEnabled);
if (mGeoDetectionFeatureEnabled) {
final int userId = configuration.getUserId();
final boolean geoTzDetectionEnabled = configuration.isGeoDetectionEnabled();
setGeoDetectionEnabled(userId, geoTzDetectionEnabled);
}
}
}
@@ -211,4 +214,4 @@ public final class TimeZoneDetectorCallbackImpl implements TimeZoneDetectorStrat
return mContext.getSystemService(ConnectivityManager.class)
.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
}
}
}