summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2019-03-28 11:05:53 -0700
committerJosh Gao <jmgao@google.com>2019-04-02 10:56:07 -0700
commit87afd52fb594433bf2005b7c680b86737b096d1d (patch)
tree7780c10c625568124884ae64b316850fb30febc2 /adb
parent3b25a17a8a844ad6d9da8448ff0794bc8f813e27 (diff)
downloadsystem_core-87afd52fb594433bf2005b7c680b86737b096d1d.tar.gz
system_core-87afd52fb594433bf2005b7c680b86737b096d1d.tar.bz2
system_core-87afd52fb594433bf2005b7c680b86737b096d1d.zip
adbd: demote CHECKs to warning logs.
It seems like we don't actually always get these events in order, so demote them to a log and restart the connection instead of aborting. Bug: http://b/129464137 Test: mma Change-Id: I7dffbf62f9dea665cf9f9f9e1bd18d444b6905ec
Diffstat (limited to 'adb')
-rw-r--r--adb/daemon/usb.cpp48
1 files changed, 36 insertions, 12 deletions
diff --git a/adb/daemon/usb.cpp b/adb/daemon/usb.cpp
index 14cdb6961..8c33ca580 100644
--- a/adb/daemon/usb.cpp
+++ b/adb/daemon/usb.cpp
@@ -304,33 +304,57 @@ struct UsbFfsConnection : public Connection {
switch (event.type) {
case FUNCTIONFS_BIND:
- CHECK(!bound) << "received FUNCTIONFS_BIND while already bound?";
- CHECK(!enabled) << "received FUNCTIONFS_BIND while already enabled?";
- bound = true;
+ if (bound) {
+ LOG(WARNING) << "received FUNCTIONFS_BIND while already bound?";
+ running = false;
+ }
+
+ if (enabled) {
+ LOG(WARNING) << "received FUNCTIONFS_BIND while already enabled?";
+ running = false;
+ }
+ bound = true;
break;
case FUNCTIONFS_ENABLE:
- CHECK(bound) << "received FUNCTIONFS_ENABLE while not bound?";
- CHECK(!enabled) << "received FUNCTIONFS_ENABLE while already enabled?";
- enabled = true;
+ if (!bound) {
+ LOG(WARNING) << "received FUNCTIONFS_ENABLE while not bound?";
+ running = false;
+ }
+
+ if (enabled) {
+ LOG(WARNING) << "received FUNCTIONFS_ENABLE while already enabled?";
+ running = false;
+ }
+ enabled = true;
StartWorker();
break;
case FUNCTIONFS_DISABLE:
- CHECK(bound) << "received FUNCTIONFS_DISABLE while not bound?";
- CHECK(enabled) << "received FUNCTIONFS_DISABLE while not enabled?";
- enabled = false;
+ if (!bound) {
+ LOG(WARNING) << "received FUNCTIONFS_DISABLE while not bound?";
+ }
+
+ if (!enabled) {
+ LOG(WARNING) << "received FUNCTIONFS_DISABLE while not enabled?";
+ }
+ enabled = false;
running = false;
break;
case FUNCTIONFS_UNBIND:
- CHECK(!enabled) << "received FUNCTIONFS_UNBIND while still enabled?";
- CHECK(bound) << "received FUNCTIONFS_UNBIND when not bound?";
- bound = false;
+ if (enabled) {
+ LOG(WARNING) << "received FUNCTIONFS_UNBIND while still enabled?";
+ }
+
+ if (!bound) {
+ LOG(WARNING) << "received FUNCTIONFS_UNBIND when not bound?";
+ }
+ bound = false;
running = false;
break;
}