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 package org.chromium.midi; | 5 package org.chromium.midi; |
6 | 6 |
7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.media.midi.MidiDevice; | 9 import android.media.midi.MidiDevice; |
10 import android.media.midi.MidiDeviceInfo; | 10 import android.media.midi.MidiDeviceInfo; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 @CalledByNative | 60 @CalledByNative |
61 static MidiManagerAndroid create(Context context, long nativeManagerPointer)
{ | 61 static MidiManagerAndroid create(Context context, long nativeManagerPointer)
{ |
62 return new MidiManagerAndroid(context, nativeManagerPointer); | 62 return new MidiManagerAndroid(context, nativeManagerPointer); |
63 } | 63 } |
64 | 64 |
65 /** | 65 /** |
66 * @param context | 66 * @param context |
67 * @param nativeManagerPointer The native pointer to a midi::MidiManagerAndr
oid object. | 67 * @param nativeManagerPointer The native pointer to a midi::MidiManagerAndr
oid object. |
68 */ | 68 */ |
69 private MidiManagerAndroid(Context context, long nativeManagerPointer) { | 69 private MidiManagerAndroid(Context context, long nativeManagerPointer) { |
70 assert ThreadUtils.runningOnUiThread(); | 70 // TODO(crbug.com/665157) |
| 71 // assert ThreadUtils.runningOnUiThread(); |
71 | 72 |
72 mManager = (MidiManager) context.getSystemService(Context.MIDI_SERVICE); | 73 mManager = (MidiManager) context.getSystemService(Context.MIDI_SERVICE); |
73 mHandler = new Handler(ThreadUtils.getUiThreadLooper()); | 74 mHandler = new Handler(ThreadUtils.getUiThreadLooper()); |
74 mNativeManagerPointer = nativeManagerPointer; | 75 mNativeManagerPointer = nativeManagerPointer; |
75 } | 76 } |
76 | 77 |
77 /** | 78 /** |
78 * Initializes this object. | 79 * Initializes this object. |
79 * This function must be called right after creation. | 80 * This function must be called right after creation. |
80 */ | 81 */ |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 mIsInitialized = true; | 166 mIsInitialized = true; |
166 } | 167 } |
167 } | 168 } |
168 | 169 |
169 static native void nativeOnInitialized( | 170 static native void nativeOnInitialized( |
170 long nativeMidiManagerAndroid, MidiDeviceAndroid[] devices); | 171 long nativeMidiManagerAndroid, MidiDeviceAndroid[] devices); |
171 static native void nativeOnInitializationFailed(long nativeMidiManagerAndroi
d); | 172 static native void nativeOnInitializationFailed(long nativeMidiManagerAndroi
d); |
172 static native void nativeOnAttached(long nativeMidiManagerAndroid, MidiDevic
eAndroid device); | 173 static native void nativeOnAttached(long nativeMidiManagerAndroid, MidiDevic
eAndroid device); |
173 static native void nativeOnDetached(long nativeMidiManagerAndroid, MidiDevic
eAndroid device); | 174 static native void nativeOnDetached(long nativeMidiManagerAndroid, MidiDevic
eAndroid device); |
174 } | 175 } |
OLD | NEW |