summaryrefslogtreecommitdiffstats
path: root/include/android_runtime
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2014-09-08 16:15:21 -0700
committerMichael Wright <michaelwr@google.com>2014-09-08 17:05:44 -0700
commit9ee5e7e17f7d65620f21d1a42865981e7bc56593 (patch)
tree9e65103e7fc4429505ba2cd8c4a2ce84bddd39cb /include/android_runtime
parent3afd6e3fc612e12ad55de53747641f63f457bb42 (diff)
downloadframeworks_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.h3
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);