Skip to content

Commit

Permalink
fixup! SudConfigProvider: return sysprop setupwizard.theme if set
Browse files Browse the repository at this point in the history
  • Loading branch information
muhomorr authored and thestinger committed May 7, 2024
1 parent f424d2d commit 7c9b18a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/com/android/settings/sudconfig/SudConfigProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package com.android.settings.sudconfig

import android.os.Build
import android.os.Bundle
import android.os.SystemProperties
import android.provider.Settings
import android.text.TextUtils
import android.util.Log
import com.android.settings.R;
import java.util.Optional

/**
* Provides system-wide config for setup wizard screens.
Expand All @@ -30,8 +30,11 @@ class SudConfigProvider : NonRelationalProvider() {
private lateinit var defaultThemeString: String

override fun onCreate(): Boolean {
defaultThemeString = SystemProperties.get("setupwizard.theme")
if (TextUtils.isEmpty(defaultThemeString)) defaultThemeString = "glif_v4_light"
// returns value of setupwizard.theme sysprop
val theme: Optional<String> = android.sysprop.SetupWizardProperties.theme()
// setupwizard.theme should always be set to prevent inconsistencies in setupdesign UIs
check(theme.isPresent) { "missing setupwizard.theme sysprop" }
defaultThemeString = theme.get()
return true
}

Expand Down

0 comments on commit 7c9b18a

Please sign in to comment.