[Android] Benchmark: fix sharedPref deprecation
Duncan McNamara
git at videolan.org
Tue Oct 17 06:38:01 UTC 2023
vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Mon Oct 16 17:03:12 2023 +0200| [58268757e83e81996f03a318586bf999f75f4231] | committer: Nicolas Pomepuy
Benchmark: fix sharedPref deprecation
> https://code.videolan.org/videolan/vlc-android/commit/58268757e83e81996f03a318586bf999f75f4231
---
.../src/org/videolan/vlc/gui/video/benchmark/BenchActivity.kt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.kt
index 6b29037c86..fbec6a2fb0 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.kt
@@ -137,7 +137,7 @@ class BenchActivity : ShallowVideoPlayer() {
oldOpenglValue = sharedPref.getString(PREFERENCE_OPENGL, "-1")
oldHistoryBoolean = sharedPref.getBoolean(PREFERENCE_PLAYBACK_HISTORY, true)
AppScope.launch(Dispatchers.IO) {
- sharedPref.edit {
+ with(sharedPref.edit()) {
putString(PREFERENCE_OPENGL, "0")
putBoolean(PREFERENCE_PLAYBACK_HISTORY, false)
}
@@ -556,7 +556,7 @@ class BenchActivity : ShallowVideoPlayer() {
if (isHardware && oldOpenglValue != "-2") {
val sharedPref = Settings.getInstance(this)
AppScope.launch(Dispatchers.IO) {
- sharedPref.edit {
+ with(sharedPref.edit()) {
putString(PREFERENCE_OPENGL, oldOpenglValue)
putBoolean(PREFERENCE_PLAYBACK_HISTORY, oldHistoryBoolean)
}
More information about the Android
mailing list