summaryrefslogtreecommitdiffstats
path: root/services/jni
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-03-11 20:00:53 -0500
committerMike Lockwood <lockwood@android.com>2011-03-11 20:02:43 -0500
commit2cc0377200b94b2f68f34e34554f2aa39e09cbce (patch)
tree5c31638c6a2905e5dfc13ae210b4c4837112df1d /services/jni
parent68f66b945e7a69549689becd2e656d9056f1e7f5 (diff)
downloadframeworks_base-2cc0377200b94b2f68f34e34554f2aa39e09cbce.zip
frameworks_base-2cc0377200b94b2f68f34e34554f2aa39e09cbce.tar.gz
frameworks_base-2cc0377200b94b2f68f34e34554f2aa39e09cbce.tar.bz2
DO NOT MERGE: backport recent USB accessory changes from honeycomb
Bug: 4082651 Change-Id: Ie7c2fc796dd3c64f803acbd14210e5949683f4ed Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'services/jni')
-rw-r--r--services/jni/com_android_server_UsbService.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/services/jni/com_android_server_UsbService.cpp b/services/jni/com_android_server_UsbService.cpp
index 08a526e..2ce0eaa 100644
--- a/services/jni/com_android_server_UsbService.cpp
+++ b/services/jni/com_android_server_UsbService.cpp
@@ -63,7 +63,6 @@ static void set_accessory_string(JNIEnv *env, int fd, int cmd, jobjectArray strA
buffer[0] = 0;
int length = ioctl(fd, cmd, buffer);
if (buffer[0]) {
- LOGD("string %d: %s", index, buffer);
jstring obj = env->NewStringUTF(buffer);
env->SetObjectArrayElement(strArray, index, obj);
env->DeleteLocalRef(obj);
@@ -73,19 +72,19 @@ static void set_accessory_string(JNIEnv *env, int fd, int cmd, jobjectArray strA
static jobjectArray android_server_UsbService_getAccessoryStrings(JNIEnv *env, jobject thiz)
{
- LOGD("getAccessoryStrings");
int fd = open(DRIVER_NAME, O_RDWR);
if (fd < 0) {
LOGE("could not open %s", DRIVER_NAME);
return NULL;
}
jclass stringClass = env->FindClass("java/lang/String");
- jobjectArray strArray = env->NewObjectArray(4, stringClass, NULL);
+ jobjectArray strArray = env->NewObjectArray(5, stringClass, NULL);
if (!strArray) goto out;
set_accessory_string(env, fd, ACCESSORY_GET_STRING_MANUFACTURER, strArray, 0);
set_accessory_string(env, fd, ACCESSORY_GET_STRING_MODEL, strArray, 1);
- set_accessory_string(env, fd, ACCESSORY_GET_STRING_TYPE, strArray, 2);
+ set_accessory_string(env, fd, ACCESSORY_GET_STRING_DESCRIPTION, strArray, 2);
set_accessory_string(env, fd, ACCESSORY_GET_STRING_VERSION, strArray, 3);
+ set_accessory_string(env, fd, ACCESSORY_GET_STRING_URI, strArray, 4);
out:
close(fd);