summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordujin.cha <dujin.cha@samsung.com>2011-11-22 12:13:33 +0900
committerMarco Nelissen <marcone@google.com>2011-11-22 10:28:21 -0800
commitfe464a76d8fc858be971dbb5e67b1d22fd925347 (patch)
tree5fae81310242c8fc3dd782d3ee5e858d2e67784a
parente36657e5416dbc9c1b22cc73174a958fafdfd736 (diff)
downloadbase-fe464a76d8fc858be971dbb5e67b1d22fd925347.tar.gz
[Prime K] Fix gabage character issueandroid-cts-verifier-4.0_r1android-cts-4.0_r1
Korean characters show up as gabage characters in Music player. Reason : MTP service does not set the locale for the MediaScanner Solution : Set locale when MtpDatabase creates MediaScanner. Bug ID : 5567433 Signed-off-by: dujin.cha <dujin.cha@samsung.com> Change-Id: I4bfe5f603c113170d45bd57a8709c21c665e260b
-rwxr-xr-x[-rw-r--r--]media/java/android/mtp/MtpDatabase.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/media/java/android/mtp/MtpDatabase.java b/media/java/android/mtp/MtpDatabase.java
index 4e271c7bf568..98617d200f54 100644..100755
--- a/media/java/android/mtp/MtpDatabase.java
+++ b/media/java/android/mtp/MtpDatabase.java
@@ -38,6 +38,7 @@ import android.view.WindowManager;
import java.io.File;
import java.util.HashMap;
+import java.util.Locale;
/**
* {@hide}
@@ -120,6 +121,20 @@ public class MtpDatabase {
mMediaStoragePath = storagePath;
mObjectsUri = Files.getMtpObjectsUri(volumeName);
mMediaScanner = new MediaScanner(context);
+
+ // Set locale to MediaScanner.
+ Locale locale = context.getResources().getConfiguration().locale;
+ if (locale != null) {
+ String language = locale.getLanguage();
+ String country = locale.getCountry();
+ if (language != null) {
+ if (country != null) {
+ mMediaScanner.setLocale(language + "_" + country);
+ } else {
+ mMediaScanner.setLocale(language);
+ }
+ }
+ }
initDeviceProperties(context);
}