Add static list to reuse existing SynchronousResultReceiver

When instantiating a new SynchronousResultReceiver,
BinderProxy keeps a reference to its instance. As Bluetooth
makes a lot of calls to its service with this class, we
need to store and reuse instead of instantiate each time.
Tested with 4 process each creating 4 threads each calling
30000 times a service method through SyncResultReceiver,
all calls with a param value that is returned and checked
once the result is retrieved.

Bug: 217366135
Test: manual
Tag: #feature
Ignore-AOSP-First: cherry-pick
Change-Id: Ide3336c624a0e58896072656a2458f25fb0a3572
(cherry picked from commit 74c52917e753aa44f859000cd308486a00be0545)
Merged-In: Ide3336c624a0e58896072656a2458f25fb0a3572
2 files changed
tree: c5f2a2dcaf67f2585397b094ff8660b4db0a99e3
  1. build/
  2. java/
  3. javatests/
  4. tools/
  5. Android.bp
  6. OWNERS
  7. PREUPLOAD.cfg
  8. README.md
  9. TEST_MAPPING
README.md

frameworks/libs/modules-utils/

Libraries and utilities intended for use by module and framework code.

Since modules use the code in this project, it must adhere to mainline requirements, for example, by setting min_sdk_version in Soong modules.

Java code

This project uses a single source path for Java code. All Java code should go in the java directory with subdirectories corresponding to the java package. Android.bp files should go alongside the java source files, and should only include java source for a single java package to encourage good code hygiene.

Tests for java code should go in the javatests directory and follow the same structure.