diff options
author | Mike Lockwood <lockwood@google.com> | 2014-09-08 16:15:21 -0700 |
---|---|---|
committer | Michael Wright <michaelwr@google.com> | 2014-09-08 17:05:44 -0700 |
commit | 9ee5e7e17f7d65620f21d1a42865981e7bc56593 (patch) | |
tree | 9e65103e7fc4429505ba2cd8c4a2ce84bddd39cb /include/android_runtime | |
parent | 3afd6e3fc612e12ad55de53747641f63f457bb42 (diff) | |
download | frameworks_base-9ee5e7e17f7d65620f21d1a42865981e7bc56593.zip frameworks_base-9ee5e7e17f7d65620f21d1a42865981e7bc56593.tar.gz frameworks_base-9ee5e7e17f7d65620f21d1a42865981e7bc56593.tar.bz2 |
USB string descriptors are not UTF8, so it is not safe to treat them as such.
Add AndroidRuntime::NewStringLatin1() to convert non-UTF8 strings to Java strings.
Bug: 17427781
Change-Id: I7df1d4e94a7beebc8b1a74c0c0a163b794025ae8
Diffstat (limited to 'include/android_runtime')
-rw-r--r-- | include/android_runtime/AndroidRuntime.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/android_runtime/AndroidRuntime.h b/include/android_runtime/AndroidRuntime.h index 51e47e6..a882870 100644 --- a/include/android_runtime/AndroidRuntime.h +++ b/include/android_runtime/AndroidRuntime.h @@ -114,6 +114,9 @@ public: /** return a new string corresponding to 'className' with all '.'s replaced by '/'s. */ static char* toSlashClassName(const char* className); + /** Create a Java string from an ASCII or Latin-1 string */ + static jstring NewStringLatin1(JNIEnv* env, const char* bytes); + private: static int startReg(JNIEnv* env); void addOption(const char* optionString, void* extra_info = NULL); |