From 9b03d102ca5fa63db821ab6e176b652ea7cffb70 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 7 Dec 2024 02:42:18 +0400 Subject: [PATCH] refactor --- .../youtube/patches/spoof/AudioStreamLanguage.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/AudioStreamLanguage.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/AudioStreamLanguage.java index f153dce042..8ec214a853 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/AudioStreamLanguage.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/AudioStreamLanguage.java @@ -1,11 +1,7 @@ package app.revanced.extension.youtube.patches.spoof; -import android.content.res.Configuration; - import java.util.Locale; -import app.revanced.extension.shared.Utils; - public enum AudioStreamLanguage { DEFAULT, @@ -87,13 +83,10 @@ public enum AudioStreamLanguage { ZH, ZU; - private static final Configuration CONFIGURATION = Utils.getContext() - .getResources().getConfiguration(); - private final String iso639_1; AudioStreamLanguage() { - iso639_1 = this.name().replace('_', '-'); + iso639_1 = name().replace('_', '-'); } public String getIso639_1() { @@ -101,7 +94,7 @@ public String getIso639_1() { // so the default needs to be the current language and not a static field. if (this == DEFAULT) { // Android VR requires uppercase language code. - return CONFIGURATION.locale.getLanguage().toUpperCase(Locale.US); + return Locale.getDefault().toLanguageTag().toUpperCase(Locale.US); } return iso639_1;