Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Unified Diff: media/midi/java/src/org/chromium/media/midi/UsbMidiDeviceFactoryAndroid.java

Issue 1065743003: Reland: Web MIDI: split build rules for media/midi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed patch set Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/midi/java/src/org/chromium/media/midi/UsbMidiDeviceAndroid.java ('k') | media/midi/midi.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/java/src/org/chromium/media/midi/UsbMidiDeviceFactoryAndroid.java
diff --git a/media/base/android/java/src/org/chromium/media/UsbMidiDeviceFactoryAndroid.java b/media/midi/java/src/org/chromium/media/midi/UsbMidiDeviceFactoryAndroid.java
similarity index 93%
rename from media/base/android/java/src/org/chromium/media/UsbMidiDeviceFactoryAndroid.java
rename to media/midi/java/src/org/chromium/media/midi/UsbMidiDeviceFactoryAndroid.java
index 814bb17c46ea1542c21c65978ab064363507f83b..e0033325e28f428d35dc1f69da386bc6ae30dfac 100644
--- a/media/base/android/java/src/org/chromium/media/UsbMidiDeviceFactoryAndroid.java
+++ b/media/midi/java/src/org/chromium/media/midi/UsbMidiDeviceFactoryAndroid.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.media;
+package org.chromium.media.midi;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
@@ -28,7 +28,7 @@ import java.util.Set;
* Owned by its native counterpart declared in
* usb_midi_device_factory_android.h. Refer to that class for general comments.
*/
-@JNINamespace("media")
+@JNINamespace("media::midi")
class UsbMidiDeviceFactoryAndroid {
/**
* The UsbManager of this system.
@@ -60,8 +60,7 @@ class UsbMidiDeviceFactoryAndroid {
*/
private long mNativePointer;
- private static final String ACTION_USB_PERMISSION =
- "org.chromium.media.USB_PERMISSION";
+ private static final String ACTION_USB_PERMISSION = "org.chromium.media.USB_PERMISSION";
/**
* Constructs a UsbMidiDeviceAndroid.
@@ -125,7 +124,7 @@ class UsbMidiDeviceFactoryAndroid {
mIsEnumeratingDevices = false;
return false;
}
- for (UsbDevice device: devices.values()) {
+ for (UsbDevice device : devices.values()) {
requestDevicePermissionIfNecessary(context, device);
}
return true;
@@ -138,7 +137,7 @@ class UsbMidiDeviceFactoryAndroid {
* @param device a USB device
*/
private void requestDevicePermissionIfNecessary(Context context, UsbDevice device) {
- for (UsbDevice d: mRequestedDevices) {
+ for (UsbDevice d : mRequestedDevices) {
if (d.getDeviceId() == device.getDeviceId()) {
// It is already requested.
return;
@@ -150,8 +149,9 @@ class UsbMidiDeviceFactoryAndroid {
if (iface.getInterfaceClass() == UsbConstants.USB_CLASS_AUDIO
&& iface.getInterfaceSubclass() == UsbMidiDeviceAndroid.MIDI_SUBCLASS) {
// There is at least one interface supporting MIDI.
- mUsbManager.requestPermission(device, PendingIntent.getBroadcast(
- context, 0, new Intent(ACTION_USB_PERMISSION), 0));
+ mUsbManager.requestPermission(
+ device, PendingIntent.getBroadcast(
+ context, 0, new Intent(ACTION_USB_PERMISSION), 0));
mRequestedDevices.add(device);
break;
}
@@ -164,7 +164,7 @@ class UsbMidiDeviceFactoryAndroid {
* @param device a USB device
*/
private void onUsbDeviceDetached(UsbDevice device) {
- for (UsbDevice usbDevice: mRequestedDevices) {
+ for (UsbDevice usbDevice : mRequestedDevices) {
if (usbDevice.getDeviceId() == device.getDeviceId()) {
mRequestedDevices.remove(usbDevice);
break;
@@ -214,7 +214,7 @@ class UsbMidiDeviceFactoryAndroid {
}
if (device != null) {
- for (UsbMidiDeviceAndroid registered: mDevices) {
+ for (UsbMidiDeviceAndroid registered : mDevices) {
if (!registered.isClosed()
&& registered.getUsbDevice().getDeviceId() == device.getDeviceId()) {
// The device is already registered.
« no previous file with comments | « media/midi/java/src/org/chromium/media/midi/UsbMidiDeviceAndroid.java ('k') | media/midi/midi.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698