Skip to content

Commit 31010d0

Browse files
authored
Merge pull request #310 from tsunami0ne/fix-camera-perm-bug
Fix issue with updating some browser settings causing the camera permissions pref to get overwritten
2 parents 9537950 + f1f489e commit 31010d0

File tree

1 file changed

+4
-3
lines changed
  • WallPanelApp/src/main/java/com/thanksmister/iot/wallpanel/persistence

1 file changed

+4
-3
lines changed

WallPanelApp/src/main/java/com/thanksmister/iot/wallpanel/persistence/Configuration.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,16 +365,17 @@ constructor(private val context: Context, private val sharedPreferences: SharedP
365365
}
366366

367367
fun hasSettingsUpdates(): Boolean {
368-
val updates = sharedPreferences.getBoolean(PREF_CAMERA_PERMISSIONS, false)
369-
sharedPreferences.edit().putBoolean(PREF_CAMERA_PERMISSIONS, false).apply()
368+
val updates = sharedPreferences.getBoolean(PREF_BROWSER_SETTINGS_UPDATED, false)
369+
sharedPreferences.edit().putBoolean(PREF_BROWSER_SETTINGS_UPDATED, false).apply()
370370
return updates
371371
}
372372

373373
private fun settingsUpdated() {
374-
sharedPreferences.edit().putBoolean(PREF_CAMERA_PERMISSIONS, true).apply()
374+
sharedPreferences.edit().putBoolean(PREF_BROWSER_SETTINGS_UPDATED, true).apply()
375375
}
376376

377377
companion object {
378+
private const val PREF_BROWSER_SETTINGS_UPDATED = "pref_browser_settings_updated"
378379
private const val PREF_DARK_THEME = "pref_dark_theme"
379380
private const val PREF_FULL_SCREEN = "pref_full_screen"
380381
private const val PREF_SETTINGS_CODE = "pref_settings_code"

0 commit comments

Comments
 (0)