| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/midi/midi_device_android.h" | 5 #include "media/midi/midi_device_android.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "jni/MidiDeviceAndroid_jni.h" | 10 #include "jni/MidiDeviceAndroid_jni.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 jobject port = env->GetObjectArrayElement(raw_output_ports.obj(), i); | 45 jobject port = env->GetObjectArrayElement(raw_output_ports.obj(), i); |
| 46 output_ports_.push_back(new MidiOutputPortAndroid(env, port)); | 46 output_ports_.push_back(new MidiOutputPortAndroid(env, port)); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 MidiDeviceAndroid::~MidiDeviceAndroid() {} | 50 MidiDeviceAndroid::~MidiDeviceAndroid() {} |
| 51 | 51 |
| 52 std::string MidiDeviceAndroid::GetManufacturer() { | 52 std::string MidiDeviceAndroid::GetManufacturer() { |
| 53 JNIEnv* env = base::android::AttachCurrentThread(); | 53 JNIEnv* env = base::android::AttachCurrentThread(); |
| 54 return ConvertMaybeJavaString( | 54 return ConvertMaybeJavaString( |
| 55 env, Java_MidiDeviceAndroid_getManufacturer(env, raw_device_.obj())); | 55 env, Java_MidiDeviceAndroid_getManufacturer(env, raw_device_)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 std::string MidiDeviceAndroid::GetProductName() { | 58 std::string MidiDeviceAndroid::GetProductName() { |
| 59 JNIEnv* env = base::android::AttachCurrentThread(); | 59 JNIEnv* env = base::android::AttachCurrentThread(); |
| 60 return ConvertMaybeJavaString( | 60 return ConvertMaybeJavaString( |
| 61 env, Java_MidiDeviceAndroid_getProduct(env, raw_device_.obj())); | 61 env, Java_MidiDeviceAndroid_getProduct(env, raw_device_)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 std::string MidiDeviceAndroid::GetDeviceVersion() { | 64 std::string MidiDeviceAndroid::GetDeviceVersion() { |
| 65 JNIEnv* env = base::android::AttachCurrentThread(); | 65 JNIEnv* env = base::android::AttachCurrentThread(); |
| 66 return ConvertMaybeJavaString( | 66 return ConvertMaybeJavaString( |
| 67 env, Java_MidiDeviceAndroid_getVersion(env, raw_device_.obj())); | 67 env, Java_MidiDeviceAndroid_getVersion(env, raw_device_)); |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace midi | 70 } // namespace midi |
| 71 } // namespace media | 71 } // namespace media |
| OLD | NEW |