From f920f150407af892497fc4043a5a09055eea05a4 Mon Sep 17 00:00:00 2001 From: Adithya R Date: Thu, 18 Jul 2024 07:01:34 +0530 Subject: [PATCH] dolby: Restore current profile _after_ resetting profiles Ensure to end the onBootCompleted routine with the correct profile set. Change-Id: I2d5f74a7c0145af2f9d064cd98fa2dc70e5a7acd --- dolby/src/co/aospa/dolby/xiaomi/DolbyController.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dolby/src/co/aospa/dolby/xiaomi/DolbyController.kt b/dolby/src/co/aospa/dolby/xiaomi/DolbyController.kt index 057973e..f5c9142 100644 --- a/dolby/src/co/aospa/dolby/xiaomi/DolbyController.kt +++ b/dolby/src/co/aospa/dolby/xiaomi/DolbyController.kt @@ -100,7 +100,6 @@ internal class DolbyController private constructor( // Restore our main settings val prefs = PreferenceManager.getDefaultSharedPreferences(context) dsOn = prefs.getBoolean(DolbyConstants.PREF_ENABLE, true) - setCurrentProfile() context.resources.getStringArray(R.array.dolby_profile_values) .map { it.toInt() } @@ -110,6 +109,9 @@ internal class DolbyController private constructor( // Now restore our profile-specific settings restoreSettings(profile) } + + // Finally restore the current profile. + setCurrentProfile() } private fun restoreSettings(profile: Int) {