OfflineLocationTimeZoneProvider config in system
This configures the Offline LocationTimeZone provider in the system
server. The code originates from the com.android.geotz apex.
Bug: 172546738
Test: build / boot with feature disabled and enabled
Test: When enabled: adb shell dumpsys activity service android/com.android.timezone.geotz.provider.OfflineLocationTimeZoneService
Test: When enabled: adb shell dumpsys location_time_zone_manager
Change-Id: Idee16d11b5d2c25d1d6e2c7a755c05d10dbf7d3d
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index ea667277..89dfdcf 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -5219,6 +5219,9 @@
android:label="@string/sensor_notification_service"/>
<!-- Attribution for Twilight service. -->
<attribution android:tag="TwilightService" android:label="@string/twilight_service"/>
+ <!-- Attribution for the Offline LocationTimeZoneProvider, used to detect time zone using
+ on-device data -->
+ <attribution android:tag="OfflineLocationTimeZoneProvider" android:label="@string/offline_location_time_zone_detection_service"/>
<application android:process="system"
android:persistent="true"
@@ -5685,6 +5688,18 @@
</intent-filter>
</service>
+ <!-- AOSP configures a default secondary LocationTimeZoneProvider that uses an on-device
+ data set from the com.android.geotz APEX. -->
+ <uses-library android:name="com.android.location.provider" />
+ <service android:name="com.android.timezone.geotz.provider.OfflineLocationTimeZoneService"
+ android:exported="false">
+ <intent-filter>
+ <action android:name="com.android.location.timezone.service.v1.SecondaryLocationTimeZoneProvider" />
+ </intent-filter>
+ <meta-data android:name="serviceVersion" android:value="1" />
+ <meta-data android:name="serviceIsMultiuser" android:value="true" />
+ </service>
+
<provider
android:name="com.android.server.textclassifier.IconsContentProvider"
android:authorities="com.android.textclassifier.icons"
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index c83594a..5901c8a 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1622,8 +1622,13 @@
wants to disable the overlay mechanism can set it to false. -->
<bool name="config_enableSecondaryLocationTimeZoneOverlay" translatable="false">false</bool>
<!-- Package name providing the secondary location time zone provider. Used only when
- config_enableSecondaryLocationTimeZoneOverlay is false. -->
- <string name="config_secondaryLocationTimeZoneProviderPackageName" translatable="false">@null</string>
+ config_enableSecondaryLocationTimeZoneOverlay is false.
+
+ By default, set to "android" to pick up the default LocationTimeZoneProvider configured in
+ the system server's AndroidManifest.xml. See the
+ com.android.location.timezone.service.v1.SecondaryLocationTimeZoneProvider intent-filter
+ definition there for more information. -->
+ <string name="config_secondaryLocationTimeZoneProviderPackageName" translatable="false">android</string>
<!-- Whether to enable network location overlay which allows network location provider to be
replaced by an app at run-time. When disabled, only the
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 8eb0853..48ffd66 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -433,6 +433,9 @@
<string name="sensor_notification_service">Sensor Notification Service</string>
<!-- Attribution for Twilight service. [CHAR LIMIT=NONE]-->
<string name="twilight_service">Twilight Service</string>
+ <!-- Attribution for Offline LocationTimeZoneDetector service, i.e. one capable of performing
+ time zone lookup using geo-spacial information held on the device. [CHAR LIMIT=NONE]-->
+ <string name="offline_location_time_zone_detection_service">Offline Time Zone Detection Service</string>
<!-- Factory reset warning dialog strings--> <skip />
<!-- Shows up in the dialog's title to warn about an impeding factory reset. [CHAR LIMIT=NONE] -->