Skip to content

Commit 61895c4

Browse files
authored
mdm: define Hostname syspolicy on Android (#598)
Updates tailscale/corp#25936 Adds a definition for the Hostname syspolicy which we are adding in OSS: tailscale/tailscale#14676 Also adds it to the app_restrictions.xml file so that MDM solutions can pick it up. Signed-off-by: Andrea Gottardo <[email protected]>
1 parent 9c3378d commit 61895c4

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

android/src/main/java/com/tailscale/ipn/mdm/MDMSettings.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ object MDMSettings {
9494
// Handled on the backend
9595
val authKey = StringMDMSetting("AuthKey", "Auth Key for login")
9696

97+
// Overrides the value provided by os.Hostname() in Go
98+
val hostname = StringMDMSetting("Hostname", "Device Hostname")
99+
97100
val allSettings by lazy {
98101
MDMSettings::class
99102
.declaredMemberProperties

android/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,5 +319,7 @@
319319
<string name="run_as_subnet_router">Run as subnet router</string>
320320
<string name="use_tailscale_subnets_subtitle">Route traffic according to your network\'s rules. Some networks require this to access IP addresses that don\'t start with 100.x.y.z.</string>
321321
<string name="subnet_routing">Subnet routing</string>
322+
<string name="specifies_a_device_name_to_be_used_instead_of_the_automatic_default">Specifies a device name to be used instead of the automatic default.</string>
323+
<string name="hostname">Hostname</string>
322324

323325
</resources>

android/src/main/res/xml/app_restrictions.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,10 @@
128128
android:key="AuthKey"
129129
android:restrictionType="string"
130130
android:title="@string/auth_key" />
131+
132+
<restriction
133+
android:description="@string/specifies_a_device_name_to_be_used_instead_of_the_automatic_default"
134+
android:key="Hostname"
135+
android:restrictionType="string"
136+
android:title="@string/hostname" />
131137
</restrictions>

0 commit comments

Comments
 (0)