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

Commit 26243be8 authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

Merge changes from topic "ndk-vendor" am: 28256695 am: 82d1e10e

am: 55b7e6a3

Change-Id: I030865b230555158a9396f4a78e20f2d30010cd9
parents 53df86e4 55b7e6a3
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -214,16 +214,21 @@ status_t BpBinder::transact(
{
    // Once a binder has died, it will never come back to life.
    if (mAlive) {
        bool privateVendor = flags & FLAG_PRIVATE_VENDOR;
        // don't send userspace flags to the kernel
        flags = flags & ~FLAG_PRIVATE_VENDOR;

        // user transactions require a given stability level
        if (code >= FIRST_CALL_TRANSACTION && code <= LAST_CALL_TRANSACTION) {
            using android::internal::Stability;

            auto stability = Stability::get(this);
            auto required = privateVendor ? Stability::VENDOR : Stability::kLocalStability;

            if (CC_UNLIKELY(!Stability::check(stability, Stability::kLocalStability))) {
            if (CC_UNLIKELY(!Stability::check(stability, required))) {
                ALOGE("Cannot do a user transaction on a %s binder in a %s context.",
                    Stability::stabilityString(stability).c_str(),
                    Stability::stabilityString(Stability::kLocalStability).c_str());
                    Stability::stabilityString(required).c_str());
                return BAD_TYPE;
            }
        }
+3 −0
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@
    {
      "name": "binderSafeInterfaceTest"
    },
    {
      "name": "binderVendorDoubleLoadTest"
    },
    {
      "name": "binderDriverInterfaceTest"
    },
+5 −1
Original line number Diff line number Diff line
@@ -62,7 +62,11 @@ public:
        DEBUG_PID_TRANSACTION   = B_PACK_CHARS('_', 'P', 'I', 'D'),

        // Corresponds to TF_ONE_WAY -- an asynchronous call.
        FLAG_ONEWAY             = 0x00000001
        FLAG_ONEWAY             = 0x00000001,

        // Private userspace flag for transaction which is being requested from
        // a vendor context.
        FLAG_PRIVATE_VENDOR     = 0x10000000,
    };

                          IBinder();
+3 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <android/binder_ibinder.h>
#include "ibinder_internal.h"

#include <android/binder_stability.h>
#include <android/binder_status.h>
#include "parcel_internal.h"
#include "status_internal.h"
@@ -542,7 +543,8 @@ binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code, APa
        return STATUS_UNKNOWN_TRANSACTION;
    }

    if ((flags & ~FLAG_ONEWAY) != 0) {
    constexpr binder_flags_t kAllFlags = FLAG_PRIVATE_VENDOR | FLAG_ONEWAY;
    if ((flags & ~kAllFlags) != 0) {
        LOG(ERROR) << __func__ << ": Unrecognized flags sent: " << flags;
        return STATUS_BAD_VALUE;
    }
+18 −0
Original line number Diff line number Diff line
@@ -20,9 +20,23 @@

__BEGIN_DECLS

/**
 * Private addition to binder_flag_t.
 */
enum {
    /**
     * Indicates that this transaction is coupled w/ vendor.img
     */
    FLAG_PRIVATE_VENDOR = 0x10000000,
};

#if defined(__ANDROID_APEX_COM_ANDROID_VNDK_CURRENT__) || \
        (defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__))

enum {
    FLAG_PRIVATE_LOCAL = FLAG_PRIVATE_VENDOR,
};

/**
 * This interface has the stability of the vendor image.
 */
@@ -35,6 +49,10 @@ static inline void AIBinder_markCompilationUnitStability(AIBinder* binder) {
#else  // defined(__ANDROID_APEX_COM_ANDROID_VNDK_CURRENT__) || (defined(__ANDROID_VNDK__) &&
       // !defined(__ANDROID_APEX__))

enum {
    FLAG_PRIVATE_LOCAL = 0,
};

/**
 * This interface has the stability of the system image.
 */
Loading