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

Commit d6050968 authored by Steven Moreland's avatar Steven Moreland
Browse files

Use libbinderthreadstateutils.

Clients needing to differentiate between system/vendor used to be able
to use isServingCall. However, this was expensive to implement. This
alternative approach instead requires users of this API to use
libbinderthreadstateutils which does a slighty different operation.

Bug: 148692216
Test: boot
Change-Id: I2c926107e43a47bd4e20e08f16a293e707ab03f7
parent e0fb3e2d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@ cc_library_shared {

            static_libs: [
                "libasync_safe",
                "libbinderthreadstateutils",
                "libdmabufinfo",
                "libgif",
                "libseccomp_policy",
+2 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include <binder/Parcel.h>
#include <binder/ProcessState.h>
#include <binder/Stability.h>
#include <binderthreadstate/CallerUtils.h>
#include <cutils/atomic.h>
#include <log/log.h>
#include <utils/KeyedVector.h>
@@ -927,7 +928,7 @@ static jint android_os_Binder_getCallingUid()

static jboolean android_os_Binder_isHandlingTransaction()
{
    return IPCThreadState::self()->isServingCall();
    return getCurrentServingCall() == BinderCallType::BINDER;
}

static jlong android_os_Binder_clearCallingIdentity()