diff options
| author | 2011-11-22 13:18:27 -0800 | |
|---|---|---|
| committer | 2011-11-22 13:18:27 -0800 | |
| commit | eabde3d4a9027a19443a31c7c7cda3d44fb0ffe0 (patch) | |
| tree | 61c6212cb0987cd45b47d3ed10bd5d6601ec8ee5 | |
| parent | eff6ed0fee42e4324ceb8d5a20be09bb2f34aa9f (diff) | |
| parent | fe464a76d8fc858be971dbb5e67b1d22fd925347 (diff) | |
am fe464a76: [Prime K] Fix gabage character issue
* commit 'fe464a76d8fc858be971dbb5e67b1d22fd925347':
[Prime K] Fix gabage character issue
| -rwxr-xr-x[-rw-r--r--] | media/java/android/mtp/MtpDatabase.java | 15 |
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); } |