Fix conversion of locale from BCP47 language tag

Bug: 17187528
Change-Id: Ifcf707c9be736885f3fc79f3c36087ecf9092971
This commit is contained in:
Sandeep Siddhartha
2014-08-23 15:57:47 -07:00
parent a2c1449bb7
commit fb30d6936a
2 changed files with 2 additions and 2 deletions

View File

@@ -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);
}
/**

View File

@@ -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