From 7c9b18a86efdf023ee2247a1bddc1a054a1a30bb Mon Sep 17 00:00:00 2001 From: Dmitry Muhomor Date: Wed, 1 May 2024 20:54:17 +0300 Subject: [PATCH] fixup! SudConfigProvider: return sysprop setupwizard.theme if set --- src/com/android/settings/sudconfig/SudConfigProvider.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/sudconfig/SudConfigProvider.kt b/src/com/android/settings/sudconfig/SudConfigProvider.kt index 07cde615754..ae2b4926f1f 100644 --- a/src/com/android/settings/sudconfig/SudConfigProvider.kt +++ b/src/com/android/settings/sudconfig/SudConfigProvider.kt @@ -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. @@ -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 = 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 }