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

Commit 235eb326 authored by William Escande's avatar William Escande
Browse files

Flagging: wrap injected flag usage

Provide macro to use injected flag while not having to deal with floss not
supporting it.
Usage is like follow:
      #include <android_bluetooth_flags.h>

      const PROVIDER_TYPE& mProvider

      Foo(PROVIDER_TYPE& provider) {
          mProvider = provider
      }

      if (IS_ENABLED(provider, myInjectedFlags)) {
          // new code
      }

Bug: 309697497
Fix: 309697497
Test: m Bluetooth | build change does not impact device code
Change-Id: I48e0b7bfd36fd3103bd3f1ef39d7864757dc7d44
parent 6c8ff0ca
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -21,10 +21,16 @@
#include <com_android_bluetooth_flags.h>

#define IS_FLAG_ENABLED(flag_name) com::android::bluetooth::flags::flag_name()
#define IS_FLAG_ENABLED_P(provider, flag_name) provider.flag_name()

#else

// FLOSS does not yet support android aconfig flags
#define IS_FLAG_ENABLED(flag_name) false
#define IS_FLAG_ENABLED_P(provider, flag_name) false

namespace com::android::bluetooth::flags {
struct flag_provider_interface {};
}  // namespace com::android::bluetooth::flags

#endif