commit | f6658b6ea070681522e4cd77a787247c4f990a97 | [log] [tgz] |
---|---|---|
author | Sal Savage <salsavage@google.com> | Wed Nov 20 13:19:37 2019 -0800 |
committer | Sal Savage <salsavage@google.com> | Tue Nov 26 13:03:20 2019 -0800 |
tree | 4e14f7f20bfe163d8884b654307ad4f375c980c6 | |
parent | 13921c33d47225a7c88acbb2d062d22d5802f504 [diff] |
Explicitly stop existing objects before creating new ones to avoid leaks Its not okay to rely on preunbind and disconnected events being called before connected is called with our service listener. To avoid cases where we leak broadcast receivers (owned by objects created when the service connects) we need to explicitly stop() each one. We can do this by calling destroyUser(), effectively removing the entire user context safely, before initializing a new one off the new proxy objects. Bug: b/144080122 Test: Build, flash, interoperability testing with device, atest, automated reconnection tests (adapter toggle, user switch and reboot) Change-Id: Id7717ef5c22b8733766677980a1778dc94f86f05 Merged-In: Id7717ef5c22b8733766677980a1778dc94f86f05
Native (C++) code format is required to be compatible with .clang-format file. Run
git clang-format --style=file --extension='h,cpp,cc' HEAD~
Note that clang-format is not desirable for Android java files. Therefore the command line above is limited to specific extensions.