summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2019-04-02 15:27:18 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-04-02 15:27:18 -0700
commit804ffede3e8c653f8b2b6752d2eb3d96d4b3c82d (patch)
treea44129950936e09df3d26fb9b1a031e34d363bd6 /adb
parente9d721e2f11649310e1185b3f5c33a0dab3a5790 (diff)
parent8cecb02a2c720a6427fb7f8edb727c20187b5a02 (diff)
downloadsystem_core-804ffede3e8c653f8b2b6752d2eb3d96d4b3c82d.tar.gz
system_core-804ffede3e8c653f8b2b6752d2eb3d96d4b3c82d.tar.bz2
system_core-804ffede3e8c653f8b2b6752d2eb3d96d4b3c82d.zip
Merge "adbd: demote CHECKs to warning logs." am: 16f4a033c3 am: 887e8f4bfd
am: 8cecb02a2c Change-Id: Id2ab6435ad2953cd4bb6348fc5166a07a598832f
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;
}