summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Grace Cheng <gracemc@google.com> 2024-04-15 04:27:49 +0000
committer Neil Fuller <nfuller@google.com> 2024-04-25 14:29:40 +0000
commit858b14a912ff5ab5453bcb5b3107fd56ea8672dc (patch)
tree6158149e8d5db0591acaae5747337c30ac4d8034
parentf1fc90bf73e6bb4569c98c01e2646b5351edc304 (diff)
Add config_enableTelephonyTimeZoneDetection.
AAOS Connectivity team is introducing minimal automotive telephony feature which would allow OEMs to pass MCC and NITZ signals without supporting FEATURE_TELEPHONY (adoption would take time though) and would make "FEATURE_TELEPHONY couldn't be relied upon" true. In future releases, we should remove the check for FEATURE_TELEPHONY at least for Automotive or for all form factors given FEATURE_TELEPHONY doesn't really "matter" to the time_zone_detector. The other reason for landing this change is, as Neil mentioned, we're worried that there may be automotive devices out there that do have FEATURE_TELEPHONY. Automotive Settings is not ready to deal with this case and Automotive prefers simple settings because it's a edge case now. If OEM want to use it, they need to customize the Settings (at the end of the day, OEMs own the user experience on their devices). If minimal automotive telephony is adopted widely and OEMs actually pass MCC and NITZ signals to in-vehicle infotainment, AAOS can rethink / redesign the Settings. Bug: 326140783 Bug: 336820570 Bug: 334817213 Test: build and run Change-Id: I40b68ab025ab4e19995dbef3168e6b2e574ed549
-rw-r--r--core/res/res/values/config.xml9
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--services/core/java/com/android/server/timezonedetector/ServiceConfigAccessorImpl.java3
3 files changed, 11 insertions, 2 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 2115f64a60b3..ef558f4b7638 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2042,10 +2042,17 @@
provider services. -->
<string name="config_secondaryLocationTimeZoneProviderPackageName" translatable="false"></string>
+ <!-- Whether the telephony time zone detection feature is enabled. Setting this to false means
+ the feature cannot be used. Setting this to true means the feature will be enabled on the
+ device if FEATURE_TELEPHONY
+ (@see https: //developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY)
+ is also supported. -->
+ <bool name="config_enableTelephonyTimeZoneDetection" translatable="false">true</bool>
+
<!-- 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.
+ telephony time zone detection are supported and enabled on a device.
See com.android.server.timezonedetector.TimeZoneDetectorStrategy for more information. -->
<bool name="config_supportTelephonyTimeZoneFallback" translatable="false">true</bool>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 9e0954093eb2..9ac59bd5a754 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2312,6 +2312,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_enableTelephonyTimeZoneDetection" />
<java-symbol type="bool" name="config_supportTelephonyTimeZoneFallback" />
<java-symbol type="bool" name="config_autoResetAirplaneMode" />
<java-symbol type="string" name="config_notificationAccessConfirmationActivity" />
diff --git a/services/core/java/com/android/server/timezonedetector/ServiceConfigAccessorImpl.java b/services/core/java/com/android/server/timezonedetector/ServiceConfigAccessorImpl.java
index a71f9c7f9086..ce9c51d7a501 100644
--- a/services/core/java/com/android/server/timezonedetector/ServiceConfigAccessorImpl.java
+++ b/services/core/java/com/android/server/timezonedetector/ServiceConfigAccessorImpl.java
@@ -409,7 +409,8 @@ public final class ServiceConfigAccessorImpl implements ServiceConfigAccessor {
@Override
public boolean isTelephonyTimeZoneDetectionFeatureSupported() {
- return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
+ return getConfigBoolean(com.android.internal.R.bool.config_enableTelephonyTimeZoneDetection)
+ && mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
}
@Override