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 "jni/MidiDeviceAndroid_jni.h" | 9 #include "jni/MidiDeviceAndroid_jni.h" |
10 #include "media/midi/midi_output_port_android.h" | 10 #include "media/midi/midi_output_port_android.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 std::string MidiDeviceAndroid::GetDeviceVersion() { | 55 std::string MidiDeviceAndroid::GetDeviceVersion() { |
56 JNIEnv* env = base::android::AttachCurrentThread(); | 56 JNIEnv* env = base::android::AttachCurrentThread(); |
57 ScopedJavaLocalRef<jstring> ret = | 57 ScopedJavaLocalRef<jstring> ret = |
58 Java_MidiDeviceAndroid_getVersion(env, raw_device_.obj()); | 58 Java_MidiDeviceAndroid_getVersion(env, raw_device_.obj()); |
59 return std::string(env->GetStringUTFChars(ret.obj(), nullptr), | 59 return std::string(env->GetStringUTFChars(ret.obj(), nullptr), |
60 env->GetStringUTFLength(ret.obj())); | 60 env->GetStringUTFLength(ret.obj())); |
61 } | 61 } |
62 | 62 |
63 bool MidiDeviceAndroid::Register(JNIEnv* env) { | |
64 return RegisterNativesImpl(env); | |
65 } | |
66 | |
67 } // namespace midi | 63 } // namespace midi |
68 } // namespace media | 64 } // namespace media |
OLD | NEW |