完成 #278 » 0001-feat-adbd-adbd-always-tries-to-configure-usb-gadget-.patch
packages/modules/adb/daemon/usb.cpp | ||
---|---|---|
#include <android-base/parsebool.h>
|
||
#include <android-base/properties.h>
|
||
#include <android-base/thread_annotations.h>
|
||
#include <android-base/file.h>
|
||
#include <android-base/strings.h>
|
||
#include "adb_unique_fd.h"
|
||
#include "adb_utils.h"
|
||
... | ... | |
bool enabled = false;
|
||
bool running = true;
|
||
while (running) {
|
||
std::string mode;
|
||
if (android::base::ReadFileToString("/sys/kernel/debug/usb/23000000.usb/mode", &mode)) {
|
||
mode = android::base::Trim(mode);
|
||
if (mode == "host") continue;
|
||
}
|
||
|
||
adb_pollfd pfd[2] = {
|
||
{ .fd = control_fd_.get(), .events = POLLIN, .revents = 0 },
|
||
{ .fd = monitor_event_fd_.get(), .events = POLLIN, .revents = 0 },
|
- « Previous
- 1
- …
- 3
- 4
- 5
- Next »