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

Commit bc635ea4 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "libbinder_ndk: backwards compatible include_cpp" am: 1ae1ad7c am:...

Merge "libbinder_ndk: backwards compatible include_cpp" am: 1ae1ad7c am: d6c2c257 am: fd7b5dbd

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1393657

Change-Id: I43fef254a423cfb9bc24a5ea15c8048fb4047fed
parents d3f29a65 fd7b5dbd
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -88,13 +88,21 @@ class SharedRefBase {

    static void operator delete(void* p) { std::free(p); }

   private:
    std::once_flag mFlagThis;
    std::weak_ptr<SharedRefBase> mThis;

    // Once minSdkVersion is 30, we are guaranteed to be building with the
    // Android 11 AIDL compiler which supports the SharedRefBase::make API.
    //
    // Use 'SharedRefBase::make<T>(...)' to make. SharedRefBase has implicit
    // ownership. Making this operator private to avoid double-ownership.
#if !defined(__ANDROID_API__) || __ANDROID_API__ >= 30
   private:
#else
    [[deprecated("Prefer SharedRefBase::make<T>(...) if possible.")]]
#endif
    static void* operator new(size_t s) { return std::malloc(s); }

   private:
    std::once_flag mFlagThis;
    std::weak_ptr<SharedRefBase> mThis;
};

/**