Loading core/java/android/app/timezonedetector/TimeZoneDetector.java +7 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,13 @@ public interface TimeZoneDetector { */ String SHELL_COMMAND_SUGGEST_TELEPHONY_TIME_ZONE = "suggest_telephony_time_zone"; /** * A shell command that enables telephony time zone fallback. See {@link * com.android.server.timezonedetector.TimeZoneDetectorStrategy} for details. * @hide */ String SHELL_COMMAND_ENABLE_TELEPHONY_FALLBACK = "enable_telephony_fallback"; /** * A shared utility method to create a {@link ManualTimeZoneSuggestion}. * Loading core/res/res/values/config.xml +7 −0 Original line number Diff line number Diff line Loading @@ -1802,6 +1802,13 @@ provider services. --> <string name="config_secondaryLocationTimeZoneProviderPackageName" translatable="false"></string> <!-- Whether the time zone detection logic supports fall back from geolocation suggestions to telephony suggestions temporarily in certain circumstances. Reduces time zone detection latency during some scenarios like air travel. Only useful when both geolocation and telephony time zone detection are supported on a device. See com.android.server.timezonedetector.TimeZoneDetectorStrategy for more information. --> <bool name="config_supportTelephonyTimeZoneFallback" translatable="false">false</bool> <!-- Whether to enable network location overlay which allows network location provider to be replaced by an app at run-time. When disabled, only the config_networkLocationProviderPackageName package will be searched for network location Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2238,6 +2238,7 @@ <java-symbol type="string" name="config_primaryLocationTimeZoneProviderPackageName" /> <java-symbol type="bool" name="config_enableSecondaryLocationTimeZoneProvider" /> <java-symbol type="string" name="config_secondaryLocationTimeZoneProviderPackageName" /> <java-symbol type="bool" name="config_supportTelephonyTimeZoneFallback" /> <java-symbol type="bool" name="config_autoResetAirplaneMode" /> <java-symbol type="string" name="config_notificationAccessConfirmationActivity" /> <java-symbol type="bool" name="config_killableInputMethods" /> Loading services/core/java/com/android/server/timedetector/ServerFlags.java +9 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ public final class ServerFlags { KEY_LOCATION_TIME_ZONE_DETECTION_SETTING_ENABLED_DEFAULT, KEY_TIME_DETECTOR_LOWER_BOUND_MILLIS_OVERRIDE, KEY_TIME_DETECTOR_ORIGIN_PRIORITIES_OVERRIDE, KEY_TIME_ZONE_DETECTOR_TELEPHONY_FALLBACK_SUPPORTED, }) @Target({ ElementType.TYPE_USE, ElementType.TYPE_PARAMETER }) @Retention(RetentionPolicy.SOURCE) Loading Loading @@ -138,6 +139,14 @@ public final class ServerFlags { KEY_LOCATION_TIME_ZONE_DETECTION_SETTING_ENABLED_DEFAULT = "location_time_zone_detection_setting_enabled_default"; /** * The key to control support for time zone detection falling back to telephony detection under * certain circumstances. */ public static final @DeviceConfigKey String KEY_TIME_ZONE_DETECTOR_TELEPHONY_FALLBACK_SUPPORTED = "time_zone_detector_telephony_fallback_supported"; /** * The key to override the time detector origin priorities configuration. A comma-separated list * of strings that will be passed to {@link TimeDetectorStrategy#stringToOrigin(String)}. Loading services/core/java/com/android/server/timezonedetector/ConfigurationInternal.java +25 −2 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ public final class ConfigurationInternal { private final boolean mTelephonyDetectionSupported; private final boolean mGeoDetectionSupported; private final boolean mTelephonyFallbackSupported; private final boolean mAutoDetectionEnabledSetting; private final @UserIdInt int mUserId; private final boolean mUserConfigAllowed; Loading @@ -48,6 +49,7 @@ public final class ConfigurationInternal { private ConfigurationInternal(Builder builder) { mTelephonyDetectionSupported = builder.mTelephonyDetectionSupported; mGeoDetectionSupported = builder.mGeoDetectionSupported; mTelephonyFallbackSupported = builder.mTelephonyFallbackSupported; mAutoDetectionEnabledSetting = builder.mAutoDetectionEnabledSetting; mUserId = builder.mUserId; Loading @@ -71,6 +73,14 @@ public final class ConfigurationInternal { return mGeoDetectionSupported; } /** * Returns true if the device supports time zone detection falling back to telephony detection * under certain circumstances. */ public boolean isTelephonyFallbackSupported() { return mTelephonyFallbackSupported; } /** Returns the value of the auto time zone detection enabled setting. */ public boolean getAutoDetectionEnabledSetting() { return mAutoDetectionEnabledSetting; Loading Loading @@ -216,6 +226,7 @@ public final class ConfigurationInternal { && mUserConfigAllowed == that.mUserConfigAllowed && mTelephonyDetectionSupported == that.mTelephonyDetectionSupported && mGeoDetectionSupported == that.mGeoDetectionSupported && mTelephonyFallbackSupported == that.mTelephonyFallbackSupported && mAutoDetectionEnabledSetting == that.mAutoDetectionEnabledSetting && mLocationEnabledSetting == that.mLocationEnabledSetting && mGeoDetectionEnabledSetting == that.mGeoDetectionEnabledSetting; Loading @@ -224,8 +235,8 @@ public final class ConfigurationInternal { @Override public int hashCode() { return Objects.hash(mUserId, mUserConfigAllowed, mTelephonyDetectionSupported, mGeoDetectionSupported, mAutoDetectionEnabledSetting, mLocationEnabledSetting, mGeoDetectionEnabledSetting); mGeoDetectionSupported, mTelephonyFallbackSupported, mAutoDetectionEnabledSetting, mLocationEnabledSetting, mGeoDetectionEnabledSetting); } @Override Loading @@ -235,6 +246,7 @@ public final class ConfigurationInternal { + ", mUserConfigAllowed=" + mUserConfigAllowed + ", mTelephonyDetectionSupported=" + mTelephonyDetectionSupported + ", mGeoDetectionSupported=" + mGeoDetectionSupported + ", mTelephonyFallbackSupported=" + mTelephonyFallbackSupported + ", mAutoDetectionEnabledSetting=" + mAutoDetectionEnabledSetting + ", mLocationEnabledSetting=" + mLocationEnabledSetting + ", mGeoDetectionEnabledSetting=" + mGeoDetectionEnabledSetting Loading @@ -251,6 +263,7 @@ public final class ConfigurationInternal { private boolean mUserConfigAllowed; private boolean mTelephonyDetectionSupported; private boolean mGeoDetectionSupported; private boolean mTelephonyFallbackSupported; private boolean mAutoDetectionEnabledSetting; private boolean mLocationEnabledSetting; private boolean mGeoDetectionEnabledSetting; Loading @@ -269,6 +282,7 @@ public final class ConfigurationInternal { this.mUserId = toCopy.mUserId; this.mUserConfigAllowed = toCopy.mUserConfigAllowed; this.mTelephonyDetectionSupported = toCopy.mTelephonyDetectionSupported; this.mTelephonyFallbackSupported = toCopy.mTelephonyFallbackSupported; this.mGeoDetectionSupported = toCopy.mGeoDetectionSupported; this.mAutoDetectionEnabledSetting = toCopy.mAutoDetectionEnabledSetting; this.mLocationEnabledSetting = toCopy.mLocationEnabledSetting; Loading Loading @@ -299,6 +313,15 @@ public final class ConfigurationInternal { return this; } /** * Sets whether time zone detection supports falling back to telephony detection under * certain circumstances. */ public Builder setTelephonyFallbackSupported(boolean supported) { mTelephonyFallbackSupported = supported; return this; } /** * Sets the value of the automatic time zone detection enabled setting for this device. */ Loading Loading
core/java/android/app/timezonedetector/TimeZoneDetector.java +7 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,13 @@ public interface TimeZoneDetector { */ String SHELL_COMMAND_SUGGEST_TELEPHONY_TIME_ZONE = "suggest_telephony_time_zone"; /** * A shell command that enables telephony time zone fallback. See {@link * com.android.server.timezonedetector.TimeZoneDetectorStrategy} for details. * @hide */ String SHELL_COMMAND_ENABLE_TELEPHONY_FALLBACK = "enable_telephony_fallback"; /** * A shared utility method to create a {@link ManualTimeZoneSuggestion}. * Loading
core/res/res/values/config.xml +7 −0 Original line number Diff line number Diff line Loading @@ -1802,6 +1802,13 @@ provider services. --> <string name="config_secondaryLocationTimeZoneProviderPackageName" translatable="false"></string> <!-- Whether the time zone detection logic supports fall back from geolocation suggestions to telephony suggestions temporarily in certain circumstances. Reduces time zone detection latency during some scenarios like air travel. Only useful when both geolocation and telephony time zone detection are supported on a device. See com.android.server.timezonedetector.TimeZoneDetectorStrategy for more information. --> <bool name="config_supportTelephonyTimeZoneFallback" translatable="false">false</bool> <!-- Whether to enable network location overlay which allows network location provider to be replaced by an app at run-time. When disabled, only the config_networkLocationProviderPackageName package will be searched for network location Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2238,6 +2238,7 @@ <java-symbol type="string" name="config_primaryLocationTimeZoneProviderPackageName" /> <java-symbol type="bool" name="config_enableSecondaryLocationTimeZoneProvider" /> <java-symbol type="string" name="config_secondaryLocationTimeZoneProviderPackageName" /> <java-symbol type="bool" name="config_supportTelephonyTimeZoneFallback" /> <java-symbol type="bool" name="config_autoResetAirplaneMode" /> <java-symbol type="string" name="config_notificationAccessConfirmationActivity" /> <java-symbol type="bool" name="config_killableInputMethods" /> Loading
services/core/java/com/android/server/timedetector/ServerFlags.java +9 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ public final class ServerFlags { KEY_LOCATION_TIME_ZONE_DETECTION_SETTING_ENABLED_DEFAULT, KEY_TIME_DETECTOR_LOWER_BOUND_MILLIS_OVERRIDE, KEY_TIME_DETECTOR_ORIGIN_PRIORITIES_OVERRIDE, KEY_TIME_ZONE_DETECTOR_TELEPHONY_FALLBACK_SUPPORTED, }) @Target({ ElementType.TYPE_USE, ElementType.TYPE_PARAMETER }) @Retention(RetentionPolicy.SOURCE) Loading Loading @@ -138,6 +139,14 @@ public final class ServerFlags { KEY_LOCATION_TIME_ZONE_DETECTION_SETTING_ENABLED_DEFAULT = "location_time_zone_detection_setting_enabled_default"; /** * The key to control support for time zone detection falling back to telephony detection under * certain circumstances. */ public static final @DeviceConfigKey String KEY_TIME_ZONE_DETECTOR_TELEPHONY_FALLBACK_SUPPORTED = "time_zone_detector_telephony_fallback_supported"; /** * The key to override the time detector origin priorities configuration. A comma-separated list * of strings that will be passed to {@link TimeDetectorStrategy#stringToOrigin(String)}. Loading
services/core/java/com/android/server/timezonedetector/ConfigurationInternal.java +25 −2 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ public final class ConfigurationInternal { private final boolean mTelephonyDetectionSupported; private final boolean mGeoDetectionSupported; private final boolean mTelephonyFallbackSupported; private final boolean mAutoDetectionEnabledSetting; private final @UserIdInt int mUserId; private final boolean mUserConfigAllowed; Loading @@ -48,6 +49,7 @@ public final class ConfigurationInternal { private ConfigurationInternal(Builder builder) { mTelephonyDetectionSupported = builder.mTelephonyDetectionSupported; mGeoDetectionSupported = builder.mGeoDetectionSupported; mTelephonyFallbackSupported = builder.mTelephonyFallbackSupported; mAutoDetectionEnabledSetting = builder.mAutoDetectionEnabledSetting; mUserId = builder.mUserId; Loading @@ -71,6 +73,14 @@ public final class ConfigurationInternal { return mGeoDetectionSupported; } /** * Returns true if the device supports time zone detection falling back to telephony detection * under certain circumstances. */ public boolean isTelephonyFallbackSupported() { return mTelephonyFallbackSupported; } /** Returns the value of the auto time zone detection enabled setting. */ public boolean getAutoDetectionEnabledSetting() { return mAutoDetectionEnabledSetting; Loading Loading @@ -216,6 +226,7 @@ public final class ConfigurationInternal { && mUserConfigAllowed == that.mUserConfigAllowed && mTelephonyDetectionSupported == that.mTelephonyDetectionSupported && mGeoDetectionSupported == that.mGeoDetectionSupported && mTelephonyFallbackSupported == that.mTelephonyFallbackSupported && mAutoDetectionEnabledSetting == that.mAutoDetectionEnabledSetting && mLocationEnabledSetting == that.mLocationEnabledSetting && mGeoDetectionEnabledSetting == that.mGeoDetectionEnabledSetting; Loading @@ -224,8 +235,8 @@ public final class ConfigurationInternal { @Override public int hashCode() { return Objects.hash(mUserId, mUserConfigAllowed, mTelephonyDetectionSupported, mGeoDetectionSupported, mAutoDetectionEnabledSetting, mLocationEnabledSetting, mGeoDetectionEnabledSetting); mGeoDetectionSupported, mTelephonyFallbackSupported, mAutoDetectionEnabledSetting, mLocationEnabledSetting, mGeoDetectionEnabledSetting); } @Override Loading @@ -235,6 +246,7 @@ public final class ConfigurationInternal { + ", mUserConfigAllowed=" + mUserConfigAllowed + ", mTelephonyDetectionSupported=" + mTelephonyDetectionSupported + ", mGeoDetectionSupported=" + mGeoDetectionSupported + ", mTelephonyFallbackSupported=" + mTelephonyFallbackSupported + ", mAutoDetectionEnabledSetting=" + mAutoDetectionEnabledSetting + ", mLocationEnabledSetting=" + mLocationEnabledSetting + ", mGeoDetectionEnabledSetting=" + mGeoDetectionEnabledSetting Loading @@ -251,6 +263,7 @@ public final class ConfigurationInternal { private boolean mUserConfigAllowed; private boolean mTelephonyDetectionSupported; private boolean mGeoDetectionSupported; private boolean mTelephonyFallbackSupported; private boolean mAutoDetectionEnabledSetting; private boolean mLocationEnabledSetting; private boolean mGeoDetectionEnabledSetting; Loading @@ -269,6 +282,7 @@ public final class ConfigurationInternal { this.mUserId = toCopy.mUserId; this.mUserConfigAllowed = toCopy.mUserConfigAllowed; this.mTelephonyDetectionSupported = toCopy.mTelephonyDetectionSupported; this.mTelephonyFallbackSupported = toCopy.mTelephonyFallbackSupported; this.mGeoDetectionSupported = toCopy.mGeoDetectionSupported; this.mAutoDetectionEnabledSetting = toCopy.mAutoDetectionEnabledSetting; this.mLocationEnabledSetting = toCopy.mLocationEnabledSetting; Loading Loading @@ -299,6 +313,15 @@ public final class ConfigurationInternal { return this; } /** * Sets whether time zone detection supports falling back to telephony detection under * certain circumstances. */ public Builder setTelephonyFallbackSupported(boolean supported) { mTelephonyFallbackSupported = supported; return this; } /** * Sets the value of the automatic time zone detection enabled setting for this device. */ Loading