adb: Make the Connection object a std::shared_ptr
This change is in preparation to allow the TCP-based transports to be able to reconnect. This is needed because multiple threads can access the Connection object. It used to be safe to do because one instance of atransport would have the same Connection instance throughout its lifetime, but now it is possible to replace the Connection instance, which could cause threads that were attempting to Write to an atransport* to use-after-free the Connection instance. Bug: 74411879 Test: system/core/adb/test_adb.py Change-Id: I4f092be11b2095088a9a9de2c0386086814d37ce
Loading
Please register or sign in to comment