refactor(events): Simplify ScopedCallback creation with type deduction

Introduce a new template overload for `makeScopedCallback` that
automatically deduces the event type from the provided callback's
signature. This is achieved using a `function_traits` helper to inspect
the lambda's arguments.

Previously, creating a scoped callback was verbose:
auto handle = android::base::makeScopedCallback<
    SomeCallbackSource<MyEvent>, MyEvent>
    (source, [](const MyEvent& event) {});

Now, the compiler can deduce the template arguments automatically:
auto handle = android::base::makeScopedCallback(
    source, [](const MyEvent& event) {});

Change-Id: I4a95ba8715ea331d964c7a302afd65b31adcae55
2 files changed
tree: d65125fb6849b05ddbad4ae709a0fe20274552fe
  1. base/
  2. build-config/
  3. CMake/
  4. host-common/
  5. third-party/
  6. windows/
  7. .clang-format
  8. .gitignore
  9. Android.bp
  10. BUILD.bazel
  11. CMakeLists.txt
  12. LICENSE
  13. MODULE.bazel
  14. README.md
  15. rebuild.sh
README.md

AEMU library

This is an utility library for common functions used in the Android Emulator. External projects (gfxstream, QEMU) may use to perform C++ functions.