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

Unified Diff: device/usb/usb_service_android.cc

Issue 1561283003: Revert of Implement basic USB device enumeration on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « device/usb/usb_service_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_service_android.cc
diff --git a/device/usb/usb_service_android.cc b/device/usb/usb_service_android.cc
index 3bdf3bc6332650f8b426a8c18cff7586a36ef251..45ce49979eccdecd82f239e7b8f3834eadc196c0 100644
--- a/device/usb/usb_service_android.cc
+++ b/device/usb/usb_service_android.cc
@@ -4,30 +4,14 @@
#include "device/usb/usb_service_android.h"
-#include <string>
-#include <vector>
-
-#include "base/android/context_utils.h"
#include "base/bind.h"
#include "base/location.h"
#include "base/thread_task_runner_handle.h"
-#include "device/usb/usb_device_android.h"
-#include "jni/ChromeUsbService_jni.h"
-
-using base::android::AttachCurrentThread;
-using base::android::ScopedJavaLocalRef;
+#include "device/usb/usb_device.h"
namespace device {
-// static
-bool UsbServiceAndroid::RegisterJNI(JNIEnv* env) {
- return RegisterNativesImpl(env); // Generated in ChromeUsbService_jni.h
-}
-
-UsbServiceAndroid::UsbServiceAndroid() {
- j_object_.Reset(Java_ChromeUsbService_create(
- AttachCurrentThread(), base::android::GetApplicationContext()));
-}
+UsbServiceAndroid::UsbServiceAndroid() {}
UsbServiceAndroid::~UsbServiceAndroid() {}
@@ -36,20 +20,9 @@
}
void UsbServiceAndroid::GetDevices(const GetDevicesCallback& callback) {
- JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jobjectArray> devices =
- Java_ChromeUsbService_getDevices(env, j_object_.obj());
- jsize length = env->GetArrayLength(devices.obj());
-
- std::vector<scoped_refptr<UsbDevice>> results;
- for (jsize i = 0; i < length; ++i) {
- ScopedJavaLocalRef<jobject> raw_device(
- env, env->GetObjectArrayElement(devices.obj(), i));
- results.push_back(UsbDeviceAndroid::Create(env, raw_device));
- }
-
+ std::vector<scoped_refptr<UsbDevice>> empty;
base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
- base::Bind(callback, results));
+ base::Bind(callback, empty));
}
} // namespace device
« no previous file with comments | « device/usb/usb_service_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698