diff --git a/core/java/android/service/voice/VoiceInteractionService.java b/core/java/android/service/voice/VoiceInteractionService.java index 884fa9f26e828..91b1cc422c099 100644 --- a/core/java/android/service/voice/VoiceInteractionService.java +++ b/core/java/android/service/voice/VoiceInteractionService.java @@ -208,7 +208,7 @@ public class VoiceInteractionService extends Service { @Deprecated public final AlwaysOnHotwordDetector createAlwaysOnHotwordDetector( String keyphrase, String locale, AlwaysOnHotwordDetector.Callback callback) { - return createAlwaysOnHotwordDetector(keyphrase, new Locale(locale), callback); + return createAlwaysOnHotwordDetector(keyphrase, Locale.forLanguageTag(locale), callback); } /** diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java index 1233c0c010784..e1a579c7a00fc 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java @@ -69,7 +69,7 @@ public class MainInteractionService extends VoiceInteractionService { + Arrays.toString(getKeyphraseEnrollmentInfo().listKeyphraseMetadata())); mHotwordDetector = createAlwaysOnHotwordDetector( - "Hello There", new Locale("en-US"), mHotwordCallback); + "Hello There", Locale.forLanguageTag("en-US"), mHotwordCallback); } @Override