commit | 325464a69de7572e5566a73b8b016cf0d05cf184 | [log] [tgz] |
---|---|---|
author | Mark Tabry <mtab@google.com> | Thu Jul 18 14:11:22 2019 -0700 |
committer | Mark Tabry <mtab@google.com> | Thu Aug 01 13:59:43 2019 -0700 |
tree | 972fe8dfec4ca6345d8320d3abe6bdec8cb69925 | |
parent | 3bbfd832f281b420b8d1253db2e7030a0ebfb7c1 [diff] |
Implement onBindingDied callback to catch client crashes. This CL makes the following changes in binding behavior: - onBindingDied is implemented to schedule a rebind - this resolves the case where a client crashes before the connection is established - rebind is split into scheduleRebind and doRebind operations - scheduleRebind will only schedule a task if there isn't one pending - doRebind only rebinds if the service did not reconnect on its own - unbinding the ServiceConnection is deferred until doRebind The resulting behavior is such that the first few crashes of a client will be re-bound faster (as ActivityManager will restart it after 2, 4, and 8 seconds), but after the configured delay the client manager will then unbind + bind, retaining the existing behavior of capping the backoff. Bug: 137656857 Test: Manual testing against P.car and Q Test: Updated VmsClientManagerTest Test: atest AndroidCarApiTest CarServiceTest CarServiceUnitTest Change-Id: I1372eae1b0b7fcbe77f982e59236fff71df13356 (cherry picked from commit 8d64eb3f5fe522ac7ced070b789c9c0ced79a8f7)
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.