services/vr/bufferhubd/buffer_client.cpp
0 → 100644
+18
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
Calling BufferClient::duplicate() will now return you an uint64_t token stands for a specific BufferNode. In later CLs users could pass this IPC-friendly token everywhere and use it to create a IBufferClient linked to that BufferNode. The token is derived from the mt19936_64 random algorithm. No same tokens will be generated at the same time by checking the token_map_. The map holds a weak_ptr so that if the BufferNode goes away by some reason the map will not keep it, preventing from memory leak. Add test case to test on the function. Test: "atest buffer_hub_binder_service-test" passed. Bug: 116681016 Change-Id: I54c34d9fabe882326faa141a6f0691419b740694