Skip to content

Commit fed79d4

Browse files
committed
mdm: define TailscaleOnboardingSeen syspolicy on Android
Adds an MDM setting `TailscaleOnboardingSeen` which allows for the intro screen to be skipped when set to true. Signed-off-by: zbuchheit <zachb@tailscale.com>
1 parent 6fb006e commit fed79d4

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

android/src/main/java/com/tailscale/ipn/MainActivity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class MainActivity : ComponentActivity() {
292292
}
293293

294294
// Show the intro screen one time
295-
if (!introScreenViewed()) {
295+
if (!introScreenViewed() && !mdmTailscaleOnboardingSeen()) {
296296
navController.navigate("intro")
297297
setIntroScreenViewed(true)
298298
}
@@ -456,6 +456,10 @@ class MainActivity : ComponentActivity() {
456456
.putBoolean("seen", seen)
457457
.apply()
458458
}
459+
460+
private fun mdmTailscaleOnboardingSeen(): Boolean {
461+
return MDMSettings.tailscaleOnboardingSeen.flow.value.value
462+
}
459463
}
460464

461465
class VpnPermissionContract : ActivityResultContract<Intent, Boolean>() {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ object MDMSettings {
9797
// Overrides the value provided by os.Hostname() in Go
9898
val hostname = StringMDMSetting("Hostname", "Device Hostname")
9999

100+
// Allows admins to skip the get started intro screen
101+
val tailscaleOnboardingSeen = BooleanMDMSetting("TailscaleOnboardingSeen", "Suppress the intro screen")
102+
100103
val allSettings by lazy {
101104
MDMSettings::class
102105
.declaredMemberProperties

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@
214214
<string name="run_as_exit_node_visibility">Run as exit node visibility</string>
215215
<string name="defines_an_auth_key_that_will_be_used_for_login">Defines an auth key that will be used for login.</string>
216216
<string name="auth_key">Auth Key</string>
217+
<string name="skips_the_intro_page_shown_to_users_that_open_the_app_for_the_first_time">Skips the intro page shown to users that open the app for the first time</string>
218+
<string name="tailscale_onboarding_seen">Mark Onboarding Page as Seen</string>
217219

218220
<!-- Permissions Management -->
219221
<string name="permissions">Permissions</string>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,10 @@
134134
android:key="Hostname"
135135
android:restrictionType="string"
136136
android:title="@string/hostname" />
137+
138+
<restriction
139+
android:description="@string/skips_the_intro_page_shown_to_users_that_open_the_app_for_the_first_time"
140+
android:key="TailscaleOnboardingSeen"
141+
android:restrictionType="bool"
142+
android:title="@string/tailscale_onboarding_seen" />
137143
</restrictions>

0 commit comments

Comments
 (0)