system/core
Revisão | 887e8f4bfd29f6b6668a831f6d81e775ad2a17db (tree) |
---|---|
Hora | 2019-04-03 06:41:26 |
Autor | Josh Gao <jmgao@goog...> |
Commiter | android-build-merger |
Merge "adbd: demote CHECKs to warning logs."
am: 16f4a033c3
Change-Id: I15d430f0296231c56bd8e2a9826e2ede962145c6
@@ -304,33 +304,57 @@ struct UsbFfsConnection : public Connection { | ||
304 | 304 | |
305 | 305 | switch (event.type) { |
306 | 306 | case FUNCTIONFS_BIND: |
307 | - CHECK(!bound) << "received FUNCTIONFS_BIND while already bound?"; | |
308 | - CHECK(!enabled) << "received FUNCTIONFS_BIND while already enabled?"; | |
309 | - bound = true; | |
307 | + if (bound) { | |
308 | + LOG(WARNING) << "received FUNCTIONFS_BIND while already bound?"; | |
309 | + running = false; | |
310 | + } | |
311 | + | |
312 | + if (enabled) { | |
313 | + LOG(WARNING) << "received FUNCTIONFS_BIND while already enabled?"; | |
314 | + running = false; | |
315 | + } | |
310 | 316 | |
317 | + bound = true; | |
311 | 318 | break; |
312 | 319 | |
313 | 320 | case FUNCTIONFS_ENABLE: |
314 | - CHECK(bound) << "received FUNCTIONFS_ENABLE while not bound?"; | |
315 | - CHECK(!enabled) << "received FUNCTIONFS_ENABLE while already enabled?"; | |
316 | - enabled = true; | |
321 | + if (!bound) { | |
322 | + LOG(WARNING) << "received FUNCTIONFS_ENABLE while not bound?"; | |
323 | + running = false; | |
324 | + } | |
325 | + | |
326 | + if (enabled) { | |
327 | + LOG(WARNING) << "received FUNCTIONFS_ENABLE while already enabled?"; | |
328 | + running = false; | |
329 | + } | |
317 | 330 | |
331 | + enabled = true; | |
318 | 332 | StartWorker(); |
319 | 333 | break; |
320 | 334 | |
321 | 335 | case FUNCTIONFS_DISABLE: |
322 | - CHECK(bound) << "received FUNCTIONFS_DISABLE while not bound?"; | |
323 | - CHECK(enabled) << "received FUNCTIONFS_DISABLE while not enabled?"; | |
324 | - enabled = false; | |
336 | + if (!bound) { | |
337 | + LOG(WARNING) << "received FUNCTIONFS_DISABLE while not bound?"; | |
338 | + } | |
339 | + | |
340 | + if (!enabled) { | |
341 | + LOG(WARNING) << "received FUNCTIONFS_DISABLE while not enabled?"; | |
342 | + } | |
325 | 343 | |
344 | + enabled = false; | |
326 | 345 | running = false; |
327 | 346 | break; |
328 | 347 | |
329 | 348 | case FUNCTIONFS_UNBIND: |
330 | - CHECK(!enabled) << "received FUNCTIONFS_UNBIND while still enabled?"; | |
331 | - CHECK(bound) << "received FUNCTIONFS_UNBIND when not bound?"; | |
332 | - bound = false; | |
349 | + if (enabled) { | |
350 | + LOG(WARNING) << "received FUNCTIONFS_UNBIND while still enabled?"; | |
351 | + } | |
352 | + | |
353 | + if (!bound) { | |
354 | + LOG(WARNING) << "received FUNCTIONFS_UNBIND when not bound?"; | |
355 | + } | |
333 | 356 | |
357 | + bound = false; | |
334 | 358 | running = false; |
335 | 359 | break; |
336 | 360 | } |