From f1f489e1ceda7c0d1bf52170b4d30e0f1fb11068 Mon Sep 17 00:00:00 2001 From: Don Nguyen Date: Sat, 28 Aug 2021 15:33:24 -0700 Subject: [PATCH] Fix issue with updating some browser settings causing the camera permissions pref to get overwritten --- .../iot/wallpanel/persistence/Configuration.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/WallPanelApp/src/main/java/com/thanksmister/iot/wallpanel/persistence/Configuration.kt b/WallPanelApp/src/main/java/com/thanksmister/iot/wallpanel/persistence/Configuration.kt index f04ff23..8faa491 100644 --- a/WallPanelApp/src/main/java/com/thanksmister/iot/wallpanel/persistence/Configuration.kt +++ b/WallPanelApp/src/main/java/com/thanksmister/iot/wallpanel/persistence/Configuration.kt @@ -365,16 +365,17 @@ constructor(private val context: Context, private val sharedPreferences: SharedP } fun hasSettingsUpdates(): Boolean { - val updates = sharedPreferences.getBoolean(PREF_CAMERA_PERMISSIONS, false) - sharedPreferences.edit().putBoolean(PREF_CAMERA_PERMISSIONS, false).apply() + val updates = sharedPreferences.getBoolean(PREF_BROWSER_SETTINGS_UPDATED, false) + sharedPreferences.edit().putBoolean(PREF_BROWSER_SETTINGS_UPDATED, false).apply() return updates } private fun settingsUpdated() { - sharedPreferences.edit().putBoolean(PREF_CAMERA_PERMISSIONS, true).apply() + sharedPreferences.edit().putBoolean(PREF_BROWSER_SETTINGS_UPDATED, true).apply() } companion object { + private const val PREF_BROWSER_SETTINGS_UPDATED = "pref_browser_settings_updated" private const val PREF_DARK_THEME = "pref_dark_theme" private const val PREF_FULL_SCREEN = "pref_full_screen" private const val PREF_SETTINGS_CODE = "pref_settings_code"