Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 17d6aef7 authored by Jack He's avatar Jack He
Browse files

Test: Stability improvements on bluetooth_stack_with_facade

Call std::map::erase before std::map::emplace
* std::map::emplace does not replace existing value if the key
  already exists. The newly constructed element will be destroyed
  immediately if there already is an element with the key in the
  container. Hence, if we want to emplace a new value, we should
  always erase the old one or use std::map::insert_or_assign
* If the value is move-only, insert_or_assign may not work

Avoid shutting down gRPC server in signal handler
* See https://github.com/grpc/grpc/issues/24884
* Create a separate shutdown thread for this purpose

Make sure all facade server values are deleted when exit
* To avoid memory leak

Do not call server->Wait() on a deleted gRPC server
* Instead, use a std::uniptr to hold the server object until the
  wrapper class is freed

Bug: 228619929
Bug: 235872679
Bug: 232048916
Ignore-AOSP-First: cherry-pick

Merged-In: Idf64df4ca61e0820ec9d48fdc9b0d191ddf0d352
Change-Id: Idf64df4ca61e0820ec9d48fdc9b0d191ddf0d352
parent df236fc7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment